Skip to content

Commit

Permalink
(fix) Adapt registration E2E tests to redesigned patient header
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Nov 8, 2024
1 parent 86f1c48 commit 6a81c79
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions e2e/specs/register-new-patient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ test('Register a new patient', async ({ page }) => {
await expect(patientBanner).toBeVisible();
await expect(patientBanner.getByText('Johnny Donny Ronny')).toBeVisible();
await expect(patientBanner.getByText(/male/i)).toBeVisible();
await expect(patientBanner.getByText(/01Feb2020/i)).toBeVisible();
await expect(patientBanner.getByText(/01-Feb-2020/i)).toBeVisible();
await expect(patientBanner.getByText(/OpenMRS ID/i)).toBeVisible();
});

await test.step('And when I click the `Show details` button in the patient banner', async () => {
await test.step('And when I click the `Show more` button in the patient banner', async () => {
await page
.getByLabel('patient banner')
.getByRole('button', { name: /show details/i })
.getByRole('button', { name: /show more/i })
.click();
});

await test.step("Then I should see the patient's address and contact details displayed in the patient banner", async () => {
const patientBanner = page.locator('header[aria-label="patient banner"]');

await expect(patientBanner.getByRole('button', { name: /hide details/i })).toBeVisible();
await expect(patientBanner.getByRole('button', { name: /show less/i })).toBeVisible();
await expect(patientBanner.getByText(/^address$/i)).toBeVisible();
await expect(patientBanner.getByText(/address line 1: Bom Jesus Street/i)).toBeVisible();
await expect(patientBanner.getByText(/city: Recife/i)).toBeVisible();
Expand Down Expand Up @@ -127,7 +127,7 @@ test('Register an unknown patient', async ({ api, page }) => {
await expect(patientBanner.getByText('Unknown Unknown')).toBeVisible();
await expect(patientBanner.getByText(/female/i)).toBeVisible();
await expect(patientBanner.getByText(/25 yrs/i)).toBeVisible();
await expect(patientBanner.getByText(/01Jan1999/i)).toBeVisible();
await expect(patientBanner.getByText(/01-Jan-1999/i)).toBeVisible();
await expect(patientBanner.getByText(/OpenMRS ID/i)).toBeVisible();
});
});
Expand Down

0 comments on commit 6a81c79

Please sign in to comment.