diff --git a/playwright-e2e/data/fake-user.json b/playwright-e2e/data/fake-user.json index 51ae06c967..bfe4b412db 100644 --- a/playwright-e2e/data/fake-user.json +++ b/playwright-e2e/data/fake-user.json @@ -30,12 +30,12 @@ }, "brother": { "firstName": "Test Brother", "lastName": "Playwright", - "relationshipID": "14" + "relationshipID": "8" }, "maternalGrandFather": { "firstName": "Test Maternal Grandfather", "lastName": "Playwright", - "relationshipID": "70" + "relationshipID": "77" }, "doctor": { "name": "John Strange", diff --git a/playwright-e2e/dsm/pages/participant-page/rgp/family-member-tab.ts b/playwright-e2e/dsm/pages/participant-page/rgp/family-member-tab.ts index 0cf462c4af..d986014450 100644 --- a/playwright-e2e/dsm/pages/participant-page/rgp/family-member-tab.ts +++ b/playwright-e2e/dsm/pages/participant-page/rgp/family-member-tab.ts @@ -77,7 +77,7 @@ export default class FamilyMemberTab { * @returns the family id from the family member tab */ public async getFamilyIDFromFamilyMemberTab(): Promise { - const familyMemberTab = this.getFamilyMemberTab(); + const familyMemberTab = await this.getFamilyMemberTab(); const memberTabParts = (await familyMemberTab.innerText()).split('-'); //Family member tabs are usually {first name} - {subject id} const retreivedSubjectID = memberTabParts[1]; const subjectIDParts = retreivedSubjectID.split('_'); //Subject id is usually in the format of RGP_{family id here}_{relationship id here} @@ -91,9 +91,28 @@ export default class FamilyMemberTab { * Uses the relationshipID to find the family member tab to be returned, must be ran only after setting the relationshipID * @returns locator for a family member's tab */ - public getFamilyMemberTab(): Locator { + public async getFamilyMemberTab(): Promise { //todo Needs a better general locator - the last contains could capture more webelements than intended once family id is in 3,000's - return this.page.locator(`//li//a[contains(., 'RGP') and contains(., '_${this.relationshipID}')]`); + const familyMemberTabs = this.page.locator(`//li//a[contains(., 'RGP_')]`).all(); + const amountOfFamilyMembers = (await familyMemberTabs).length; + let relationID; + let familyID; + let familyMemberTab: Locator; + for (let familyMemberIndex = 0; familyMemberIndex < amountOfFamilyMembers; familyMemberIndex++) { + const familyMember = (await familyMemberTabs)[familyMemberIndex]; + const tabText = await familyMember.innerText(); + const familyMemberTabParts = tabText.split('_'); + relationID = familyMemberTabParts[2] as string; + if (!(relationID === this._relationshipID)) { + continue; + } + if (relationID === this._relationshipID) { + familyID = familyMemberTabParts[1] as string; + familyMemberTab = this.page.locator(`//li//a[contains(., 'RGP') and contains(., '${familyID}_${relationID}')]`); + break; + } + } + return familyMemberTab!; } public getJumpToMenuText(): Locator { diff --git a/playwright-e2e/tests/dsm/kitUploadFlow/blood-and-rna-kit-upload-flow.spec.ts b/playwright-e2e/tests/dsm/kitUploadFlow/blood-and-rna-kit-upload-flow.spec.ts index af33d10a41..0c71f6a893 100644 --- a/playwright-e2e/tests/dsm/kitUploadFlow/blood-and-rna-kit-upload-flow.spec.ts +++ b/playwright-e2e/tests/dsm/kitUploadFlow/blood-and-rna-kit-upload-flow.spec.ts @@ -24,7 +24,7 @@ import { saveParticipantGuid } from 'utils/faker-utils'; import { ParticipantListTable } from 'dsm/component/tables/participant-list-table'; test.describe('Blood & RNA Kit Upload', () => { -test.skip('Verify that a blood & rna kit can be uploaded @rgp @functional @upload', async ({ page, request}, testInfo) => { +test('Verify that a blood & rna kit can be uploaded @rgp @functional @upload', async ({ page, request}, testInfo) => { const testResultDirectory = testInfo.outputDir; const study = StudyEnum.RGP; @@ -53,7 +53,7 @@ test.skip('Verify that a blood & rna kit can be uploaded @rgp @functional @uploa const proband = new FamilyMemberTab(page, FamilyMember.PROBAND); proband.relationshipID = user.patient.relationshipID; - const probandTab = proband.getFamilyMemberTab(); + const probandTab = await proband.getFamilyMemberTab(); await expect(probandTab).toBeVisible(); await probandTab.click(); await expect(probandTab).toHaveClass('nav-link active');//Make sure the tab is in view and selected diff --git a/playwright-e2e/tests/rgp/adult-enrollment.spec.ts b/playwright-e2e/tests/rgp/adult-enrollment.spec.ts index 7559432110..a4141dca8b 100644 --- a/playwright-e2e/tests/rgp/adult-enrollment.spec.ts +++ b/playwright-e2e/tests/rgp/adult-enrollment.spec.ts @@ -155,7 +155,7 @@ test.describe.serial('Adult Self Enrollment', () => { }); //Skipping until PEPPER-692 is done - which will let this pass consistently in dev and not just test - test.skip('Go to DSM to verify the newly created account can be found @functional @rgp', async ({ page, request }) => { + test('Go to DSM to verify the newly created account can be found @functional @rgp', async ({ page, request }) => { //Go to DSM to verify the newly created account can be found there await login(page); const navigation = new Navigation(page, request); diff --git a/playwright-e2e/tests/rgp/dsm-family-enrollment.spec.ts b/playwright-e2e/tests/rgp/dsm-family-enrollment.spec.ts index 388483c5cb..6b517e4ba6 100644 --- a/playwright-e2e/tests/rgp/dsm-family-enrollment.spec.ts +++ b/playwright-e2e/tests/rgp/dsm-family-enrollment.spec.ts @@ -15,7 +15,7 @@ import { calculateAge } from 'utils/date-utils'; let rgpEmail: string; test.describe.serial('DSM Family Enrollment Handling', () => { - test.skip('Verify the display and functionality of family account dynamic fields @functional @rgp', async ({ page, request}) => { + test('Verify the display and functionality of family account dynamic fields @functional @rgp', async ({ page, request}) => { const navigation = new Navigation(page, request); //select RGP study @@ -84,7 +84,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { //Skipping until housekeeping stuff is fixed - test.skip('Verify that the proband family member tab can be filled out @functional @rgp @proband', async ({ page, request }) => { + test('Verify that the proband family member tab can be filled out @functional @rgp @proband', async ({ page, request }) => { //Go into DSM const navigation = new Navigation(page, request); @@ -110,7 +110,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { //Initial setup proband.relationshipID = user.patient.relationshipID; - const probandTab = proband.getFamilyMemberTab(); + const probandTab = await proband.getFamilyMemberTab(); await expect(probandTab).toBeVisible(); //Verify that the dynamic form menu is present @@ -518,7 +518,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { await redCapSurveyCompletedDate.fill(`${currentDate[0]}/${currentDate[1]}/${currentDate[2]}`);//[0] is MM, [1] is DD, [2] is YYYY }); - test.skip('Verify that a family member can be added without copying proband info @rgp @functional', async ({ page, request }) => { + test('Verify that a family member can be added without copying proband info @rgp @functional', async ({ page, request }) => { //Add a new family member //Go into DSM const navigation = new Navigation(page, request); @@ -558,7 +558,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { }); //Check that the expected Participant Info fields have been filled after non-copied family member creation - const maternalGrandFatherFamilyMemberTab = grandfather.getFamilyMemberTab(); + const maternalGrandFatherFamilyMemberTab = await grandfather.getFamilyMemberTab(); await maternalGrandFatherFamilyMemberTab.scrollIntoViewIfNeeded(); await expect(maternalGrandFatherFamilyMemberTab).toBeVisible(); @@ -597,7 +597,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { const proband = new FamilyMemberTab(page, FamilyMember.PROBAND); proband.relationshipID = user.patient.relationshipID; - const probandFamilyMemberTab = proband.getFamilyMemberTab(); + const probandFamilyMemberTab = await proband.getFamilyMemberTab(); await expect(probandFamilyMemberTab).toBeVisible(); const probandFamilyID = await proband.getFamilyIDFromFamilyMemberTab(); @@ -605,7 +605,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { await expect(maternalGrandfatherFamilyID).toEqual(probandFamilyID); }); - test.skip('Verify that a family member can be added using copied proband info @rgp @functional', async ({ page, request }) => { + test('Verify that a family member can be added using copied proband info @rgp @functional', async ({ page, request }) => { //Go into DSM const navigation = new Navigation(page, request); @@ -652,7 +652,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { }); await test.step(`Check that brother's info matches proband info`, async () => { - const brotherFamilyMemberTab = brother.getFamilyMemberTab(); + const brotherFamilyMemberTab = await brother.getFamilyMemberTab(); await brotherFamilyMemberTab.scrollIntoViewIfNeeded(); await expect(brotherFamilyMemberTab).toBeVisible(); await brotherFamilyMemberTab.click(); @@ -704,7 +704,7 @@ test.describe.serial('DSM Family Enrollment Handling', () => { const brotherMixedRaceNotes = await brother.getMixedRaceNotesContent(); //Do Participant Info comparison of proband and brother - const probandTab = proband.getFamilyMemberTab(); + const probandTab = await proband.getFamilyMemberTab(); await probandTab.click(); const probandParticipantInfoSection = proband.getParticipantInfoSection();