diff --git a/e2e/pages/form-builder-page.ts b/e2e/pages/form-builder-page.ts index 59dfff64..713a72af 100644 --- a/e2e/pages/form-builder-page.ts +++ b/e2e/pages/form-builder-page.ts @@ -134,6 +134,7 @@ export class FormBuilderPage { await this.formNameInput().fill(formName); await this.formVersionInput().click(); await this.formVersionInput().fill("1.0"); + await this.formDescriptionInput().fill("This is a test form"); await this.formEncounterType().selectOption("Admission"); await this.formSaveButton().click(); } diff --git a/e2e/specs/create-form-using-custom-schema.spec.ts b/e2e/specs/create-form-using-custom-schema.spec.ts index 36a9c68d..4faf94f5 100644 --- a/e2e/specs/create-form-using-custom-schema.spec.ts +++ b/e2e/specs/create-form-using-custom-schema.spec.ts @@ -18,8 +18,9 @@ test("Create a form using a custom JSON schema", async ({ page }) => { }); await test.step("Then I paste in a custom JSON schema into the schema editor and click the `Render Changes` button", async () => { - await formBuilderPage.schemaInput().fill(JSON.stringify(customSchema)); - // Inputs the custom schema and render changes + await formBuilderPage + .schemaInput() + .fill(JSON.stringify(customSchema, null, 2)); await formBuilderPage.renderChangesButton().click(); }); diff --git a/e2e/specs/edit-existing-form.spec.ts b/e2e/specs/edit-existing-form.spec.ts index 373d503e..a0485284 100644 --- a/e2e/specs/edit-existing-form.spec.ts +++ b/e2e/specs/edit-existing-form.spec.ts @@ -28,7 +28,10 @@ test("Editing an existing form", async ({ page }) => { }); await test.step("And I click the `Edit` button on the form I need to edit", async () => { - await page.getByRole('row', { name: form.name }).getByLabel('Edit Schema').click(); + await page + .getByRole("row", { name: form.name }) + .getByLabel("Edit Schema") + .click(); }); await test.step("Then I click the `Save Form` button then the `Update existing version` button, and finally the `Save` button", async () => { diff --git a/e2e/specs/interactive-builder.spec.ts b/e2e/specs/interactive-builder.spec.ts index 5a44a58e..21a90de9 100644 --- a/e2e/specs/interactive-builder.spec.ts +++ b/e2e/specs/interactive-builder.spec.ts @@ -18,14 +18,13 @@ test("Create a schema using the interactive builder", async ({ page }) => { await test.step("Then I should see the new schema in the schema editor and a success notification", async () => { await expect(page.getByText(/new question created/i)).toBeVisible(); - await expect( - page - .getByRole("tabpanel", { name: "Schema Editor" }) - .locator("div") - .filter({ - hasText: '{ "name": "Covid-19 Screening"', - }) - .nth(2) - ).toBeVisible(); + await page + .locator("#schemaEditor div") + .filter({ + hasText: + '{ "name": "Covid-19 Screening", "pages": [ { "label": "Screening", "sections": [', + }) + .nth(1) + .click(); }); }); diff --git a/e2e/support/custom-schema.json b/e2e/support/custom-schema.json index 442d6728..3df45a9c 100644 --- a/e2e/support/custom-schema.json +++ b/e2e/support/custom-schema.json @@ -1,5 +1,5 @@ { - "encounterType": "", + "encounterType": "e22e39fd-7db2-45e7-80f1-60fa0d5a4378", "name": "UI Select Form Test", "pages": [ { @@ -25,5 +25,7 @@ ], "processor": "EncounterFormProcessor", "referencedForms": [], - "uuid": "xxx" + "uuid": "xxx", + "version": "1", + "description": "This is test description" } diff --git a/playwright.config.ts b/playwright.config.ts index 030a38bb..215e1360 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,16 +10,18 @@ const config: PlaywrightTestConfig = { timeout: 20 * 1000, }, fullyParallel: true, + outputDir: "../test-results/results", forbidOnly: !!process.env.CI, retries: 0, reporter: process.env.CI ? [["junit", { outputFile: "results.xml" }], ["html"]] - : [["line"]], + : [["html", { outputFolder: "../test-results/report" }]], globalSetup: require.resolve("./e2e/core/global-setup"), use: { baseURL: `${process.env.E2E_BASE_URL}/spa/`, locale: "en-US", storageState: "e2e/storageState.json", + video: "retain-on-failure", }, projects: [ {