Skip to content

Commit 0d573e8

Browse files
committed
format
1 parent fb0240d commit 0d573e8

File tree

3 files changed

+20
-37
lines changed

3 files changed

+20
-37
lines changed

playwright-e2e/tests/dsm/kitUploadFlow/kit-upload-ui.spec.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import {WelcomePage} from 'dsm/pages/welcome-page';
44
import {Navigation} from 'dsm/component/navigation/navigation';
55
import {StudyEnum} from 'dsm/component/navigation/enums/selectStudyNav-enum';
66
import {SamplesNavEnum} from 'dsm/component/navigation/enums/samplesNav-enum';
7-
import {KitTypeEnum} from 'dsm/component/kitType/enums/kitType-enum';
87
import KitUploadPage from 'dsm/pages/kitUpload-page/kitUpload-page';
8+
import {getExpectedKitSelection} from 'utils/test-utils';
99

10-
// don't run in parallel
11-
test.describe.serial('Blood Kits upload flow', () => {
10+
test.describe('Kits Upload UI', () => {
1211
let welcomePage: WelcomePage;
1312
let navigation: Navigation;
1413

@@ -20,11 +19,10 @@ test.describe.serial('Blood Kits upload flow', () => {
2019
});
2120

2221
for (const study of studies) {
23-
test(`Kit Upload page ui @dsm @${study} @kit`, async ({page}) => {
22+
test(`Page verifications @dsm @${study} @kit`, async () => {
2423
const expectedKitSelection = getExpectedKitSelection(study);
2524
await welcomePage.selectStudy(study);
2625

27-
// Kit Upload page
2826
const kitUploadPage = await navigation.selectFromSamples<KitUploadPage>(SamplesNavEnum.KIT_UPLOAD);
2927
await kitUploadPage.waitForReady(expectedKitSelection);
3028

@@ -38,17 +36,4 @@ test.describe.serial('Blood Kits upload flow', () => {
3836
expect(test.info().errors).toHaveLength(0);
3937
})
4038
}
41-
42-
function getExpectedKitSelection(study: StudyEnum): KitTypeEnum[] {
43-
let types = [KitTypeEnum.SALIVA, KitTypeEnum.BLOOD];
44-
switch (study) {
45-
case StudyEnum.PANCAN:
46-
types = types.concat([KitTypeEnum.STOOL]);
47-
break;
48-
case StudyEnum.RGP:
49-
types = [KitTypeEnum.BLOOD, KitTypeEnum.BLOOD_AND_RNA];
50-
break;
51-
}
52-
return types;
53-
}
5439
})

playwright-e2e/tests/dsm/kitUploadFlow/kit-without-labels-ui.spec.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import {WelcomePage} from 'dsm/pages/welcome-page';
44
import {Navigation} from 'dsm/component/navigation/navigation';
55
import {StudyEnum} from 'dsm/component/navigation/enums/selectStudyNav-enum';
66
import {SamplesNavEnum} from 'dsm/component/navigation/enums/samplesNav-enum';
7-
import {KitTypeEnum} from 'dsm/component/kitType/enums/kitType-enum';
87
import KitsWithoutLabelPage from 'dsm/pages/kitsInfo-pages/kitsWithoutLabel-page';
98
import {KitsColumnsEnum} from 'dsm/pages/kitsInfo-pages/enums/kitsColumns-enum';
10-
import { studyShortName } from 'utils/test-utils';
9+
import {getExpectedKitSelection, studyShortName} from 'utils/test-utils';
1110

12-
// don't run in parallel
13-
test.describe.serial('Blood Kits upload flow', () => {
11+
test.describe('Kits without Labels UI', () => {
1412
let welcomePage: WelcomePage;
1513
let navigation: Navigation;
1614

@@ -22,12 +20,11 @@ test.describe.serial('Blood Kits upload flow', () => {
2220
});
2321

2422
for (const study of studies) {
25-
test(`Kit Upload page ui @dsm @${study} @kit`, async ({page}) => {
23+
test(`Page verifications @dsm @${study} @kit`, async ({page}) => {
2624
const expectedKitSelection = getExpectedKitSelection(study);
2725
const { realm: expectedRealm } = studyShortName(study);
2826
await welcomePage.selectStudy(study);
2927

30-
// Kit Upload page
3128
const kitsWithoutLabelPage = await navigation.selectFromSamples<KitsWithoutLabelPage>(SamplesNavEnum.KITS_WITHOUT_LABELS);
3229
await kitsWithoutLabelPage.waitForReady(expectedKitSelection);
3330
const kitsTable = kitsWithoutLabelPage.kitsWithoutLabelTable;
@@ -57,17 +54,4 @@ test.describe.serial('Blood Kits upload flow', () => {
5754
expect(test.info().errors).toHaveLength(0);
5855
})
5956
}
60-
61-
function getExpectedKitSelection(study: StudyEnum): KitTypeEnum[] {
62-
let types = [KitTypeEnum.SALIVA, KitTypeEnum.BLOOD];
63-
switch (study) {
64-
case StudyEnum.PANCAN:
65-
types = types.concat([KitTypeEnum.STOOL]);
66-
break;
67-
case StudyEnum.RGP:
68-
types = [KitTypeEnum.BLOOD, KitTypeEnum.BLOOD_AND_RNA];
69-
break;
70-
}
71-
return types;
72-
}
7357
})

playwright-e2e/utils/test-utils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Checkbox from 'dss/component/checkbox';
55
import Select from 'dss/component/select';
66
import axios from 'axios';
77
import { logError } from './log-utils';
8+
import { KitTypeEnum } from 'dsm/component/kitType/enums/kitType-enum';
89

910
export interface WaitForResponse {
1011
uri: string;
@@ -273,6 +274,19 @@ export function studyShortName(study: StudyEnum): { shortName: string | null; re
273274
return { shortName, realm, collaboratorPrefix };
274275
}
275276

277+
export function getExpectedKitSelection(study: StudyEnum): KitTypeEnum[] {
278+
let types = [KitTypeEnum.SALIVA, KitTypeEnum.BLOOD];
279+
switch (study) {
280+
case StudyEnum.PANCAN:
281+
types = types.concat([KitTypeEnum.STOOL]);
282+
break;
283+
case StudyEnum.RGP:
284+
types = [KitTypeEnum.BLOOD, KitTypeEnum.BLOOD_AND_RNA];
285+
break;
286+
}
287+
return types;
288+
}
289+
276290
export function shuffle(array: any[]): any[] {
277291
for (let i = array.length - 1; i > 0; i--) {
278292
const j = Math.floor(Math.random() * (i + 1));

0 commit comments

Comments
 (0)