diff --git a/e2e/specs/register-new-patient.spec.ts b/e2e/specs/register-new-patient.spec.ts index 4a180ad21..a9e7be5e3 100644 --- a/e2e/specs/register-new-patient.spec.ts +++ b/e2e/specs/register-new-patient.spec.ts @@ -31,7 +31,7 @@ test('Register a new patient', async ({ page, api }) => { await patientRegistrationPage.waitUntilTheFormIsLoaded(); }); - await test.step('And then I click on fill new values into the registration form and then click the `Submit` button', async () => { + await test.step('And then I fill the registration form and then click the `Submit` button', async () => { await patientRegistrationPage.fillPatientRegistrationForm(formValues); }); @@ -54,6 +54,21 @@ test('Register a new patient', async ({ page, api }) => { expect(person.preferredAddress.stateProvince).toBe(formValues.stateProvince); expect(person.preferredAddress.country).toBe(formValues.country); expect(person.attributes[0].display).toBe(formValues.phone); + + await expect(page.getByRole('main')).toContainText(person.display); + await expect(page.getByRole('main')).toContainText(/male/i); + await expect(page.getByRole('main')).toContainText(/4 yrs, 6 mths/i); + await expect(page.getByRole('main')).toContainText(/01 — Feb — 2020/i); + await expect(page.getByRole('main')).toContainText(/OpenMRS ID/i); + await page.getByRole('button', { name: /show details/i }).click(); + await expect(page.getByRole('button', { name: /hide details/i })).toBeVisible(); + await expect(page.getByText(/^address$/i)).toBeVisible(); + await expect(page.getByText(/address line 1: bom jesus street/i)).toBeVisible(); + await expect(page.getByText(/city: recife/i)).toBeVisible(); + await expect(page.getByText(/state: pernambuco/i)).toBeVisible(); + await expect(page.getByText(/country: brazil/i)).toBeVisible(); + await expect(page.getByText(/contact details/i)).toBeVisible(); + await expect(page.getByText(/telephone number: 5555551234/i)).toBeVisible(); }); });