diff --git a/playwright-e2e/dsm/component/tables/onc-history-table.ts b/playwright-e2e/dsm/component/tables/onc-history-table.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/localControl-enum.ts b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/localControl-enum.ts new file mode 100644 index 0000000000..b2011156a5 --- /dev/null +++ b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/localControl-enum.ts @@ -0,0 +1,6 @@ +export enum LocalControlEnum { + BLANK = '', + YES = 'Yes', + NO = 'No', + UNKNOWN = 'Unknown' +} diff --git a/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/methodOfDecalcification-enum.ts b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/methodOfDecalcification-enum.ts new file mode 100644 index 0000000000..5f379a83cd --- /dev/null +++ b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/methodOfDecalcification-enum.ts @@ -0,0 +1,11 @@ +export enum MethodOfDecalcificationEnum { + NITRIC_ACID = "Nitric Acid (includes Perenyi's fluid)", + HYDROCHLORIC_ACID = "Hydrochloric Acid (includes Von Ebner's solution)", + FORMIC_ACID = 'Formic Acid (includes Evans/Kajan, Kristensen/Gooding/Stewart)', + ACID_NOS = 'Acid NOS', + EDTA = 'EDTA', + SAMPLE_NOT_DECALCIFIED = 'Sample not decalcified', + OTHER = 'Other', + UNKNOWN = 'Unknown', + IMMUNOCAL_OR_SOFT_DECAL = 'Immunocal/ Soft Decal' +} \ No newline at end of file diff --git a/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/request-enum.ts b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/request-enum.ts new file mode 100644 index 0000000000..144a66a678 --- /dev/null +++ b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/request-enum.ts @@ -0,0 +1,10 @@ +export enum RequestStatusEnum { + NEEDS_REVIEW = 'Needs Review', + DONT_REQUEST = "Don't Request", + ON_HOLD = 'On Hold', + REQUEST = 'Request', + SENT = 'Sent', + RECEIVED = 'Received', + RETURNED = 'Returned', + UNABLE_TO_OBTAIN = 'Unable To Obtain' +} diff --git a/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/sampleFFPE-enum.ts b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/sampleFFPE-enum.ts new file mode 100644 index 0000000000..91f353af93 --- /dev/null +++ b/playwright-e2e/dsm/component/tabs/enums/oncHistory-enums/sampleFFPE-enum.ts @@ -0,0 +1,6 @@ +export enum SampleFFPEEnum { + BLANK = '', + YES = 'Yes', + NO = 'No', + UNKNOWN = 'Unknown' +} diff --git a/playwright-e2e/dsm/component/tabs/enums/tab-enum.ts b/playwright-e2e/dsm/component/tabs/enums/tab-enum.ts index f6787bcf9c..589234bcd2 100644 --- a/playwright-e2e/dsm/component/tabs/enums/tab-enum.ts +++ b/playwright-e2e/dsm/component/tabs/enums/tab-enum.ts @@ -2,5 +2,8 @@ export enum TabEnum { SURVEY_DATA = 'Survey Data', CONTACT_INFORMATION = 'Contact Information', SAMPLE_INFORMATION = 'Sample Information', + MEDICAL_RECORDS = 'Medical Records', + ONC_HISTORY = 'Onc History', + SEQUENCING_ORDER = 'Sequencing Order', INVITAE = 'Invitae' } diff --git a/playwright-e2e/dsm/component/tabs/model/oncHistoryModel.ts b/playwright-e2e/dsm/component/tabs/model/oncHistoryModel.ts new file mode 100644 index 0000000000..7b745e784d --- /dev/null +++ b/playwright-e2e/dsm/component/tabs/model/oncHistoryModel.ts @@ -0,0 +1,25 @@ +import { Locator } from '@playwright/test'; +import { LocalControlEnum } from '../enums/oncHistory-enums/localControl-enum'; +import { MethodOfDecalcificationEnum } from '../enums/oncHistory-enums/methodOfDecalcification-enum'; +import { SampleFFPEEnum } from '../enums/oncHistory-enums/sampleFFPE-enum'; +import { RequestStatusEnum } from '../enums/oncHistory-enums/request-enum'; + +export default class OncHistory { + constructor( + public request: Locator, + public dateOfPX: string = '', + public typeOfPX: string = '', + public locationOfPX: string = '', + public histology: string = '', + public accessionNumber: string = '', + public facility: string = '', + public phone: string = '', + public fax: string = '', + public destructionYears: string = '', + public sampleIsFromLocalControl: LocalControlEnum, + public methodOfDecalcification: MethodOfDecalcificationEnum, + public sampleIsFFPE: SampleFFPEEnum, + public tissueNotes: Locator, + public requestStatus: RequestStatusEnum + ) {} +} diff --git a/playwright-e2e/dsm/component/tabs/oncHistoryTab.ts b/playwright-e2e/dsm/component/tabs/oncHistoryTab.ts new file mode 100644 index 0000000000..0c7c070c84 --- /dev/null +++ b/playwright-e2e/dsm/component/tabs/oncHistoryTab.ts @@ -0,0 +1,11 @@ +import {expect, Locator, Page} from '@playwright/test'; + +export default class OncHistoryTab { + constructor(private readonly page: Page) {} + + /** + * This tab collects information such as the participant's diagnosis, where and when diagnosis was acquired, + * and whether further information from the listed facility has been requested for, received, etc. + * Note: The day that information is first inputted into this tab for a participant is automatically used as the Onc History Created Date + */ +} diff --git a/playwright-e2e/dsm/component/tabs/tabs.ts b/playwright-e2e/dsm/component/tabs/tabs.ts index 22de4b27e5..3ca8a38c26 100644 --- a/playwright-e2e/dsm/component/tabs/tabs.ts +++ b/playwright-e2e/dsm/component/tabs/tabs.ts @@ -2,11 +2,13 @@ import {Locator, Page} from '@playwright/test'; import {TabEnum} from 'dsm/component/tabs/enums/tab-enum'; import ContactInformationTab from 'dsm/component/tabs/contactInformationTab'; import SampleInformationTab from 'dsm/component/tabs/sampleInformationTab'; +import OncHistoryTab from './oncHistoryTab'; export default class Tabs { private readonly tabs = new Map([ [TabEnum.CONTACT_INFORMATION, new ContactInformationTab(this.page)], - [TabEnum.SAMPLE_INFORMATION, new SampleInformationTab(this.page)] + [TabEnum.SAMPLE_INFORMATION, new SampleInformationTab(this.page)], + [TabEnum.ONC_HISTORY, new OncHistoryTab(this.page)] ]) constructor(private readonly page: Page) {} diff --git a/playwright-e2e/tests/dsm/kitUploadFlow/sample-received-event-flow.spec.ts b/playwright-e2e/tests/dsm/kitUploadFlow/sample-received-event-flow.spec.ts new file mode 100644 index 0000000000..5c1dd71ae2 --- /dev/null +++ b/playwright-e2e/tests/dsm/kitUploadFlow/sample-received-event-flow.spec.ts @@ -0,0 +1,57 @@ +import { Page, test, Locator } from '@playwright/test'; +import { StudyEnum } from 'dsm/component/navigation/enums/selectStudyNav-enum'; +import { Navigation } from 'dsm/component/navigation/navigation'; +import HomePage from 'dsm/pages/home-page'; +import { WelcomePage } from 'dsm/pages/welcome-page'; +import {login} from 'authentication/auth-dsm'; +import ParticipantListPage from 'dsm/pages/participant-list-page'; +import { StudyNavEnum } from 'dsm/component/navigation/enums/studyNav-enum'; +import { KitTypeEnum } from 'dsm/component/kitType/enums/kitType-enum'; + +test.describe('PE-CGS Sample Received Event', () => { + const studies = [StudyEnum.LMS, StudyEnum.OSTEO2]; + + let welcomePage: WelcomePage; + let homePage: HomePage; + let navigation: Navigation; + + test.beforeEach(async ({ page, request }) => { + await login(page); + welcomePage = new WelcomePage(page); + homePage = new HomePage(page); + navigation = new Navigation(page, request); + }); + + //For each clinical study, check that the sample received event is working as expected + for (const study of studies) { + test(`Scenario 1: Saliva kit is received first; Tumor sample is received second`, async ({ page }) => { + await welcomePage.selectStudy(study); + await homePage.assertWelcomeTitle(); + await homePage.assertSelectedStudyTitle(study); + + const participantListPage = await navigation.selectFromStudy(StudyNavEnum.PARTICIPANT_LIST); + await participantListPage.assertPageTitle(); + + /** + * Find a participant that fits the following criteria: + * 1. Is enrolled + * 2. Has at least 1 saliva kit uploaded + * 3. One of the saliva kits has the status 'Waiting for GP' (for ease of testing) + * 4. Has at least 1 known physician (in order to ensure Onc History tab is/was created) + * 5. Does not already have a germline consent addendum activity created + */ + const participant = findValidParticipant(page, participantListPage, KitTypeEnum.SALIVA); + }) + } +}); + + +async function findValidParticipant(page: Page, participantListPage: ParticipantListPage, kitType: KitTypeEnum): Promise { + //Add the necessary columns needed to check to see if a valid participant exists + + //Do the relevant filtering to find which of the available participants fit the criteria for this test file + + //Pick the first relevant participant that shows up + + //Handle what should happen if no relevant participants can be found - otherwise, return the found participant +}