Skip to content

Commit 2f8e9a1

Browse files
authored
[Playwright] Failed kit test fix and update some libraries to latest version (#2241)
* update playwright lib and tests
1 parent bab221a commit 2f8e9a1

File tree

6 files changed

+52
-33
lines changed

6 files changed

+52
-33
lines changed

playwright-e2e/authentication/auth-base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Page } from '@playwright/test';
22
import { generateEmailAlias } from 'utils/faker-utils';
3+
import { logInfo } from 'utils/log-utils';
34

45
/**
56
*
@@ -37,5 +38,6 @@ export async function createAccountWithEmailAlias(
3738
}
3839
const emailAlias = generateEmailAlias(email);
3940
await fillInEmailPassword(page, { email: emailAlias, password, waitForNavigation, waitForAuth });
41+
logInfo(`Created account with email alias: ${emailAlias}`);
4042
return emailAlias;
4143
}

playwright-e2e/package-lock.json

Lines changed: 38 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

playwright-e2e/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
"lint:fix": "eslint --fix --ext .js,.ts ."
1616
},
1717
"devDependencies": {
18-
"@faker-js/faker": "^7.6.0",
18+
"@faker-js/faker": "^8.1.0",
1919
"@playwright/test": "^1.38.0",
2020
"@types/file-saver": "^2.0.5",
2121
"@types/mailparser": "^3.4.0",
22-
"@types/uuid": "^8.3.4",
22+
"@types/uuid": "^9.0.4",
2323
"@typescript-eslint/eslint-plugin": "^5.54.0",
2424
"@typescript-eslint/parser": "^5.54.0",
25+
"axios": "^1.5.0",
2526
"csv-parser": "^3.0.0",
27+
"dotenv": "^16.3.1",
2628
"eslint": "^8.35.0",
2729
"eslint-plugin-import": "^2.27.5",
28-
"uuid": "^9.0.0"
30+
"uuid": "^9.0.1"
2931
},
3032
"dependencies": {
3133
"@google-cloud/local-auth": "^2.1.1",
3234
"@googleapis/gmail": "^1.1.1",
3335
"@types/lodash": "^4.14.191",
3436
"@types/node": "^18.14.2",
35-
"axios": "^1.3.4",
3637
"cross-env": "^7.0.3",
37-
"dotenv": "^16.1.4",
3838
"googleapis": "^105.0.0",
3939
"lodash": "^4.17.21",
4040
"mailparser": "^3.6.3",

playwright-e2e/tests/dsm/kitUploadFlow/blood-kit-prefix-check.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test.describe.serial('Blood Kit Upload', () => {
4444
const studies = [StudyEnum.LMS]; // StudyEnum.OSTEO2;
4545
const kitType = KitTypeEnum.BLOOD;
4646
const expectedKitTypes = [KitTypeEnum.SALIVA, KitTypeEnum.BLOOD];
47-
const kitLabel = `${crypto.randomUUID().toString().substring(0, 10)}`;
47+
const kitLabel = crypto.randomUUID().toString().substring(0, 14);
4848

4949
const mockedCanadaAddress = {
5050
street1: mock.canada.street,

playwright-e2e/tests/dsm/kitUploadFlow/saliva-kit-prefix-check.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test.describe.serial('Saliva Kit Upload with a Canadian or New York address', ()
4444
const studies = [StudyEnum.OSTEO2];
4545
const kitType = KitTypeEnum.SALIVA;
4646
const expectedKitTypes = [KitTypeEnum.SALIVA, KitTypeEnum.BLOOD];
47-
const kitLabel = `saliva-${crypto.randomUUID().toString().substring(0, 7)}`; // alphanumerical string length should be 14
47+
const kitLabel = crypto.randomUUID().toString().substring(0, 14); // alphanumerical string length should be 14
4848

4949
const mockedCanadaAddress = {
5050
street1: mock.canada.street,

playwright-e2e/tests/dsm/participant-list/pancan-diagnosis-type-picklist-search.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { logInfo } from 'utils/log-utils';
88
test.describe('Pancan study picklist search', () => {
99
// CMI research studies
1010
const studies = [StudyEnum.PANCAN];
11-
const cancers = ['Lung cancers', 'Neuroblastoma (NB)', 'Gallbladder cancer', 'Small intestine cancer'];
11+
const cancers = ['Gynecologic cancers', 'Leukemias', 'Sarcomas', 'Small intestine cancer', 'Gastrointestinal cancers'];
1212

1313
for (const study of studies) {
1414
test(`@${study} @dsm`, async ({ page, request }) => {
@@ -33,7 +33,9 @@ test.describe('Pancan study picklist search', () => {
3333
let participantsCount = await participantsTable.getRowsCount();
3434
expect(participantsCount).toBeGreaterThan(1);
3535

36-
while (participantsCount > 0) {
36+
let pageCount = 0;
37+
// Stops when participantsCount <= 0 and gone thru 3 table pages already
38+
while (participantsCount > 0 && pageCount <= 3) {
3739
// Verify only participants with at least one diagnosis type that match the above selected cancers are displayed
3840
for (let i = 0; i < participantsCount; i++) {
3941
const columnData: string = await participantsTable.getParticipantDataAt(i, 'DIAGNOSIS_TYPE');
@@ -44,10 +46,10 @@ test.describe('Pancan study picklist search', () => {
4446
if (hasNextPage) {
4547
await participantsTable.nextPage();
4648
participantsCount = await participantsTable.getRowsCount();
49+
pageCount++;
4750
} else {
4851
participantsCount = 0
4952
}
50-
console.log(`participantsCount: ${participantsCount}`)
5153
}
5254
expect(test.info().errors).toHaveLength(0);
5355
});

0 commit comments

Comments
 (0)