diff --git a/e2e/specs/register-new-patient.spec.ts b/e2e/specs/register-new-patient.spec.ts index a217a8c82..503729627 100644 --- a/e2e/specs/register-new-patient.spec.ts +++ b/e2e/specs/register-new-patient.spec.ts @@ -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();