Skip to content

Commit

Permalink
Address reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
kdaud committed Feb 26, 2024
1 parent e4d51c9 commit bead9ea
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions e2e/specs/return-to-patient-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import {
removePatientFromCohort,
} from '../commands';

let createdCohortMember: CohortMember;
let createdCohortUuid: string;
let cohortMemberShip: CohortMember;
let cohort: Cohort;
let patient: Patient;

test.beforeEach(async ({ api }) => {
patient = await generateRandomPatient(api);
cohort = await generateRandomCohort(api);
createdCohortMember = await addPatientToCohort(api, cohort.uuid, patient.uuid);
cohortMemberShip = await addPatientToCohort(api, cohort.uuid, patient.uuid);
});

test('Return to patient list from the patient chart', async ({ page }) => {
Expand All @@ -31,7 +30,7 @@ test('Return to patient list from the patient chart', async ({ page }) => {
await patientListPage.goto(cohort.uuid);
});

await test.step('And I click on the patient {{name}} in the list', async () => {
await test.step('And I click on the patient in the list', async () => {
await page.locator('table tbody tr td:nth-child(1) a').click();
});

Expand Down Expand Up @@ -59,7 +58,7 @@ test('Return to patient list after navigating to visits page from the patient ch
await patientListPage.goto(cohort.uuid);
});

await test.step('And I click on the patient {{name}} in the list', async () => {
await test.step('And I click on the patient in the list', async () => {
await page.locator('table tbody tr td:nth-child(1) a').click();
});

Expand All @@ -73,7 +72,7 @@ test('Return to patient list after navigating to visits page from the patient ch
await page.getByLabel('Open menu').click();
});

await test.step('And I click on the `Visits` link', async () => {
await test.step('And I click on the `Visits` tab', async () => {
await page.getByRole('link', { name: 'Visits' }).click();
});

Expand All @@ -95,7 +94,7 @@ test('Return to patient list after navigating to visits and refreshing the page'
await patientListPage.goto(cohort.uuid);
});

await test.step('And I click on the patient {{name}} in the list', async () => {
await test.step('And I click on the patient in the list', async () => {
await page.locator('table tbody tr td:nth-child(1) a').click();
});

Expand All @@ -109,7 +108,7 @@ test('Return to patient list after navigating to visits and refreshing the page'
await page.getByLabel('Open menu').click();
});

await test.step('And I click on the `Visits` link', async () => {
await test.step('And I click on the `Visits` tab', async () => {
await page.getByRole('link', { name: 'Visits' }).click();
});

Expand Down Expand Up @@ -170,11 +169,8 @@ test('Return to patient list from the patient chart on a new tab', async ({ page
});

test.afterEach(async ({ api }) => {
if (createdCohortMember) {
await removePatientFromCohort(api, createdCohortMember.uuid);
}
if (createdCohortUuid) {
await deleteCohort(api, createdCohortUuid);
if (cohortMemberShip) {
await removePatientFromCohort(api, cohortMemberShip.uuid);
}
await deletePatient(api, patient.uuid);
await deleteCohort(api, cohort.uuid);
Expand Down

0 comments on commit bead9ea

Please sign in to comment.