Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DFPL-2289 - Upgrade Playwright and Introduce Linting for Tests #5286

Merged
merged 48 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1b9eb18
CVE-2024-1597
GauravChawlaMOJ Mar 27, 2024
7a0f9c6
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 2, 2024
05d0a88
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 3, 2024
baea01a
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 3, 2024
82b646f
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 5, 2024
7b0902e
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 9, 2024
c097468
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 11, 2024
3ef4029
DFPL-2289 update Playwright
Apr 15, 2024
a9a78aa
DFPL-2289 add typescript-eslint + fix lint issues
Apr 15, 2024
36988f8
DFPL-2289 WIP fixing linting issues
Apr 15, 2024
cecdabf
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 15, 2024
8d17c1c
commit
GauravChawlaMOJ Apr 15, 2024
823b391
commit
GauravChawlaMOJ Apr 15, 2024
540d617
commit
GauravChawlaMOJ Apr 17, 2024
5c9d075
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ Apr 17, 2024
491315e
commit
GauravChawlaMOJ Apr 17, 2024
bf3037e
Merge remote-tracking branch 'origin/DFPL-2289-temp' into DFPL-2289-temp
GauravChawlaMOJ Apr 17, 2024
bd7c7a1
commit
GauravChawlaMOJ Apr 17, 2024
44d4502
commit
GauravChawlaMOJ Apr 17, 2024
9ef9844
commit
GauravChawlaMOJ Apr 17, 2024
b038fa0
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ Apr 17, 2024
db69cc9
Merge branch 'master' into DFPL-2289-temp
Iphiclus Apr 18, 2024
9529d77
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ Apr 18, 2024
143f92c
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ Apr 19, 2024
02f8016
packages updated
GauravChawlaMOJ Apr 23, 2024
527ffed
package added
GauravChawlaMOJ Apr 24, 2024
3f18f4c
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ Apr 24, 2024
9b76e4c
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ Apr 25, 2024
78371ce
yarn.lock update
GauravChawlaMOJ Apr 26, 2024
c7be22e
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ Apr 29, 2024
e5f8366
Merge branch 'master' into DFPL-2289-temp
abigailsmith97 May 1, 2024
b0992a1
Merge branch 'master' into DFPL-2289-temp
Iphiclus May 2, 2024
45a9379
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ May 3, 2024
01ee5c4
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ May 3, 2024
e68a70d
Merge remote-tracking branch 'origin/master'
GauravChawlaMOJ May 3, 2024
3925f57
re-create yarn.lock
GauravChawlaMOJ May 3, 2024
a2b5cbe
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ May 3, 2024
45d9a5d
re-create yarn.lock
GauravChawlaMOJ May 3, 2024
1995615
re-create yarn.lock
GauravChawlaMOJ May 3, 2024
da09d23
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ May 3, 2024
090c77d
update yarn to 3.8.2
GauravChawlaMOJ May 3, 2024
7057bdc
Merge remote-tracking branch 'origin/DFPL-2289-temp' into DFPL-2289-temp
GauravChawlaMOJ May 3, 2024
6fae647
updated tests
GauravChawlaMOJ May 3, 2024
c23417a
updated tests
GauravChawlaMOJ May 3, 2024
284d95d
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ May 3, 2024
4aca628
updated tests
GauravChawlaMOJ May 3, 2024
224b85b
updated tests
GauravChawlaMOJ May 3, 2024
ba1b3d1
Merge branch 'master' into DFPL-2289-temp
GauravChawlaMOJ May 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DFPL-2289 WIP fixing linting issues
  • Loading branch information
Georgina committed Apr 15, 2024
commit 36988f8bc23db1ea31a4e19a9a044484a5088c93
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fpl-ccd-configuration",
"version": "1.0.0",
"type": "module",

"description": "FPL CCD e2e tests",
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/additional-applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class AdditionalApplications extends BasePage {
}

public async expectAllUploadsCompleted() {
let locs = await this.page.getByText('Cancel upload').all();
const locs = await this.page.getByText('Cancel upload').all();
for (let i = 0; i < locs.length; i++) {
await expect(locs[i]).toBeDisabled();
}
Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/allocation-proposal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, type Locator, expect } from "@playwright/test";
import { type Page, type Locator } from "@playwright/test";

export class AllocationProposal {

Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/applicant-details.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, type Locator, expect } from "@playwright/test";
import { type Page, type Locator } from "@playwright/test";
import { BasePage } from "./base-page";

export class ApplicantDetails extends BasePage{
Expand Down
4 changes: 2 additions & 2 deletions playwright-e2e/pages/base-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class BasePage {
}

async waitForAllUploadsToBeCompleted() {
let locs = await this.page.getByText('Cancel upload').all();
const locs = await this.page.getByText('Cancel upload').all();
for (let i = 0; i < locs.length; i++) {
await expect(locs[i]).toBeDisabled();
}
Expand All @@ -60,7 +60,7 @@ export class BasePage {
expect(await this.reloadAndCheckForText(userName, 10000, 3)).toBeTruthy();
}

async reloadAndCheckForText(text: string, timeout?: number, maxAttempts?: number): Promise<Boolean> {
async reloadAndCheckForText(text: string, timeout?: number, maxAttempts?: number): Promise<boolean> {
// reload the page, wait 5s, see if it's there
for (let attempt = 0; attempt < (maxAttempts ?? 12); attempt++) {
await this.page.reload();
Expand Down
4 changes: 2 additions & 2 deletions playwright-e2e/pages/create-case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class CreateCase {
readonly createCaseLink: Locator;
readonly addApplicationTitle: Locator;
readonly viewHistory: Locator;
generatedCaseName: any;
generatedCaseName: String;

public constructor(page: Page) {
this.page = page;
Expand Down Expand Up @@ -40,7 +40,7 @@ export class CreateCase {
}

caseName() {
let formattedDate = CreateCaseName.getFormattedDate();
const formattedDate = CreateCaseName.getFormattedDate();
this.generatedCaseName = `Smoke Test ${formattedDate}`;
}

Expand Down
1 change: 0 additions & 1 deletion playwright-e2e/pages/gatekeeping-listing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {BasePage} from "./base-page";
import {expect, Page} from "@playwright/test";
import {ManageHearings} from "./manage-hearings";
import {HearingDetailsMixin} from "./mixins/hearing-details-mixin";

export class GatekeepingListing extends HearingDetailsMixin(BasePage)
Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/international-element.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, type Locator, expect } from "@playwright/test";
import { type Page, type Locator } from "@playwright/test";
import { BasePage } from "./base-page";

export class InternationalElement extends BasePage {
Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/manage-hearings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {type Page, type Locator, expect} from "@playwright/test";
import {type Page, type Locator } from "@playwright/test";
import {BasePage} from "./base-page";
import {HearingDetailsMixin} from "./mixins/hearing-details-mixin";

Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/respondent-details.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, type Locator, expect } from "@playwright/test";
import { type Page, type Locator } from "@playwright/test";

export class RespondentDetails {

Expand Down
2 changes: 1 addition & 1 deletion playwright-e2e/pages/welsh-lang-requirements.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Page, type Locator, expect } from "@playwright/test";
import { type Page, type Locator } from "@playwright/test";
import { BasePage } from "./base-page";

export class WelshLangRequirements extends BasePage {
Expand Down
14 changes: 9 additions & 5 deletions playwright-e2e/settings/test-docs/config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import path from "path";
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

export interface testFiles {}
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

interface testFiles {}

interface Config {
[key: string]: testFiles | string;
}

const config: Config = {
testPdfFile: path.resolve(
testPdfFile: join(
__dirname,
"../test-docs/testPdf.pdf",
),
testWordFile: path.resolve(
testWordFile: join(
__dirname,
"../test-docs/testWordDoc.docx",
),
testTextFile: path.resolve(
testTextFile: join(
__dirname,
"../test-docs/testTextFile.txt",
),
Expand Down
4 changes: 2 additions & 2 deletions playwright-e2e/tests/additional-applications.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { test } from '../fixtures/create-fixture';
import { Apihelp } from '../utils/api-helper';
import caseData from '../caseData/mandatorySubmissionFieldsWithoutAdditionalApp.json';
import { caseData } from '../caseData/mandatorySubmissionFieldsWithoutAdditionalApp.json';
import { newSwanseaLocalAuthorityUserOne, judgeWalesUser } from '../settings/user-credentials';
import { expect } from "@playwright/test";
import { testConfig } from '../settings/test-config';

test.describe('Upload additional applications', () => {
let apiDataSetup = new Apihelp();
const apiDataSetup = new Apihelp();
const dateTime = new Date().toISOString();
let caseNumber: string;
let casename: string;
Expand Down
11 changes: 5 additions & 6 deletions playwright-e2e/tests/judicial-message.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { test} from '../fixtures/create-fixture';
import {Apihelp} from '../utils/api-helper';
//import {urlConfig} from "../settings/urls";
import caseData from '../caseData/mandatorySubmissionFields.json';
import caseDataJudgeMessage from '../caseData/caseWithJudgeMessage.json';
import caseDataCloseMessage from '../caseData/caseWithJudicialMessageReply.json';
import { Apihelp } from '../utils/api-helper';
import * as caseData from '../caseData/mandatorySubmissionFields.json' assert { type: 'json' };
import * as caseDataJudgeMessage from '../caseData/caseWithJudgeMessage.json' assert { type: 'json' };
import * as caseDataCloseMessage from '../caseData/caseWithJudicialMessageReply.json' assert { type: 'json' };
import { newSwanseaLocalAuthorityUserOne,CTSCUser ,judgeUser} from '../settings/user-credentials';
import { expect } from '@playwright/test';


test.describe('send and reply message',()=>{
let apiDataSetup = new Apihelp();
const apiDataSetup = new Apihelp();
const dateTime = new Date().toISOString();
let caseNumber : string;
let casename : string;
Expand Down
4 changes: 2 additions & 2 deletions playwright-e2e/tests/manage-documents.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { test } from '../fixtures/create-fixture';
import { testConfig } from '../settings/test-config';
import { CTSCUser, newSwanseaLocalAuthorityUserOne } from '../settings/user-credentials';
import { Apihelp } from '../utils/api-helper';
import caseData from '../caseData/mandatorySubmissionFields.json';
import * as caseData from '../caseData/mandatorySubmissionFields.json' assert { type: 'json' };
import { expect } from '@playwright/test';

test.describe('Manage Documents', () => {
let apiDataSetup = new Apihelp();
const apiDataSetup = new Apihelp();
const dateTime = new Date().toISOString();
let caseNumber: string;
let casename: string;
Expand Down
8 changes: 4 additions & 4 deletions playwright-e2e/tests/manage-hearings.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { test } from '../fixtures/create-fixture';
import {Apihelp} from '../utils/api-helper';
import caseData from '../caseData/caseWithHearingDetails.json';
import vacatedHearingCaseData from '../caseData/caseWithVacatedHearing.json';
import preJudgeAllocationCaseData from '../caseData/casePreAllocationDecision.json';
import * as caseData from '../caseData/caseWithHearingDetails.json' assert { type: 'json' };
import * as vacatedHearingCaseData from '../caseData/caseWithVacatedHearing.json' assert { type: 'json' };
import * as preJudgeAllocationCaseData from '../caseData/casePreAllocationDecision.json' assert { type: 'json' };
import {
CTSCUser,
newSwanseaLocalAuthorityUserOne,
Expand All @@ -12,7 +12,7 @@ import {expect} from "@playwright/test";
import {testConfig} from "../settings/test-config";

test.describe('manage hearings', () => {
let apiDataSetup = new Apihelp();
const apiDataSetup = new Apihelp();
const dateTime = new Date().toISOString();
let caseNumber : string;
let caseName : string;
Expand Down
3 changes: 0 additions & 3 deletions playwright-e2e/tests/smoke-test.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { test, expect } from "../fixtures/fixtures";
import { BasePage } from "../pages/base-page";
import { newSwanseaLocalAuthorityUserOne } from "../settings/user-credentials";

test("Smoke Test @smoke-test @accessibility", async ({
Expand All @@ -18,11 +17,9 @@ test("Smoke Test @smoke-test @accessibility", async ({
childDetails,
welshLangRequirements,
internationalElement,
page,
makeAxeBuilder
},testInfo) => {

const basePage = new BasePage(page);
// 1. Sign in as local-authority user
await signInPage.visit();
await signInPage.login(
Expand Down
4 changes: 2 additions & 2 deletions playwright-e2e/tests/upload-draft-orders.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { test } from '../fixtures/create-fixture';
import { newSwanseaLocalAuthorityUserOne } from '../settings/user-credentials';
import { Apihelp } from '../utils/api-helper';
import caseData from '../caseData/caseWithHearingDetails.json';
import * as caseData from '../caseData/caseWithHearingDetails.json' assert { type: 'json' };
import { expect } from '@playwright/test';

test.describe('Upload draft orders', () => {
let apiDataSetup = new Apihelp();
const apiDataSetup = new Apihelp();
const dateTime = new Date().toISOString();
let caseNumber: string;
let casename: string;
Expand Down