Skip to content

Commit

Permalink
Wait for patient banner to render before running assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
denniskigen committed Aug 19, 2024
1 parent 5e1ccbd commit 9c71181
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e2e/specs/register-new-patient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ test('Register a new patient', async ({ page, api }) => {
const patientChartUrlRegex = new RegExp('^[\\w\\d:\\/.-]+\\/patient\\/[\\w\\d-]+\\/chart\\/.*$');
await page.waitForURL(patientChartUrlRegex);
await expect(page).toHaveURL(patientChartUrlRegex);
await expect(page.getByText(/Johnny Donny Ronny/i)).toBeVisible();
await page.locator('header[data-openmrs-role="patient banner"]').waitFor();
await expect(page.locator('header[data-openmrs-role="patient banner"]')).toBeVisible();
await expect(page.getByText(/johnny donny ronny/i)).toBeVisible();
await expect(page.getByText(/male/i)).toBeVisible();
await expect(page.getByText(/4 yrs, 6 mths/i)).toBeVisible();
await expect(page.getByText(/01 — Feb — 2020/i)).toBeVisible();
Expand Down

0 comments on commit 9c71181

Please sign in to comment.