From acabfe22ee90927b6dea45961a3e5b7bc932431a Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Thu, 15 Jun 2023 17:04:11 +0530 Subject: [PATCH 1/8] Add the playwright video tracing feature --- playwright.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 030a38bb..9e34912b 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -14,12 +14,13 @@ const config: PlaywrightTestConfig = { retries: 0, reporter: process.env.CI ? [["junit", { outputFile: "results.xml" }], ["html"]] - : [["line"]], + : [["html"]], 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: [ { From 6c858a74e063d4c869a4de62d3fa715abe99b356 Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Fri, 28 Jul 2023 21:44:21 +0530 Subject: [PATCH 2/8] Update the reporter output folder --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 9e34912b..4261e875 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -14,7 +14,7 @@ const config: PlaywrightTestConfig = { retries: 0, reporter: process.env.CI ? [["junit", { outputFile: "results.xml" }], ["html"]] - : [["html"]], + : [["html", { outputFolder: "test-results" }]], globalSetup: require.resolve("./e2e/core/global-setup"), use: { baseURL: `${process.env.E2E_BASE_URL}/spa/`, From 44893e7ca22beeef04a8b66d71c187f1d06d48fe Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Fri, 28 Jul 2023 22:06:56 +0530 Subject: [PATCH 3/8] Update the config --- playwright.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 4261e875..83e0b3f3 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,11 +10,12 @@ 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"]] - : [["html", { outputFolder: "test-results" }]], + : [["html", { outputFolder: "test-results/report" }]], globalSetup: require.resolve("./e2e/core/global-setup"), use: { baseURL: `${process.env.E2E_BASE_URL}/spa/`, From f736c4e171649f7fd5f3c318366efec0f2de2c43 Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Tue, 1 Aug 2023 22:41:40 +0530 Subject: [PATCH 4/8] Disable parallel testing --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 83e0b3f3..8aa4918a 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -9,7 +9,7 @@ const config: PlaywrightTestConfig = { expect: { timeout: 20 * 1000, }, - fullyParallel: true, + fullyParallel: false, outputDir: "test-results/results", forbidOnly: !!process.env.CI, retries: 0, From 8a70d0a8acd2b1e127be6dbcd7755a2058f7b479 Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Sun, 6 Aug 2023 15:15:37 +0530 Subject: [PATCH 5/8] Update the test file paths --- playwright.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 8aa4918a..12530949 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -10,12 +10,12 @@ const config: PlaywrightTestConfig = { timeout: 20 * 1000, }, fullyParallel: false, - outputDir: "test-results/results", + outputDir: "../test-results/results", forbidOnly: !!process.env.CI, retries: 0, reporter: process.env.CI ? [["junit", { outputFile: "results.xml" }], ["html"]] - : [["html", { outputFolder: "test-results/report" }]], + : [["html", { outputFolder: "../test-results/report" }]], globalSetup: require.resolve("./e2e/core/global-setup"), use: { baseURL: `${process.env.E2E_BASE_URL}/spa/`, From 843e30fa2eaf0641eb633a9271899de259021a07 Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Sun, 6 Aug 2023 18:35:20 +0530 Subject: [PATCH 6/8] Enable the parellel testing --- playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 12530949..215e1360 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -9,7 +9,7 @@ const config: PlaywrightTestConfig = { expect: { timeout: 20 * 1000, }, - fullyParallel: false, + fullyParallel: true, outputDir: "../test-results/results", forbidOnly: !!process.env.CI, retries: 0, From 291783a8eda2066bcce829e2c5f277c09812e65e Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Mon, 21 Aug 2023 17:21:33 +0530 Subject: [PATCH 7/8] Update the custom config --- e2e/pages/form-builder-page.ts | 1 + e2e/specs/create-form-using-custom-schema.spec.ts | 1 - e2e/specs/edit-existing-form.spec.ts | 5 ++++- e2e/support/custom-schema.json | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) 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..7dafd3cb 100644 --- a/e2e/specs/create-form-using-custom-schema.spec.ts +++ b/e2e/specs/create-form-using-custom-schema.spec.ts @@ -19,7 +19,6 @@ 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.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/support/custom-schema.json b/e2e/support/custom-schema.json index 442d6728..9f5f46b3 100644 --- a/e2e/support/custom-schema.json +++ b/e2e/support/custom-schema.json @@ -25,5 +25,6 @@ ], "processor": "EncounterFormProcessor", "referencedForms": [], - "uuid": "xxx" + "uuid": "xxx", + "version": 1 } From 95459785a6293a32dfb6d753cc939ba669f2661b Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Tue, 22 Aug 2023 17:42:28 +0530 Subject: [PATCH 8/8] Update the custom schema --- .../create-form-using-custom-schema.spec.ts | 4 +++- e2e/specs/interactive-builder.spec.ts | 17 ++++++++--------- e2e/support/custom-schema.json | 5 +++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/e2e/specs/create-form-using-custom-schema.spec.ts b/e2e/specs/create-form-using-custom-schema.spec.ts index 7dafd3cb..4faf94f5 100644 --- a/e2e/specs/create-form-using-custom-schema.spec.ts +++ b/e2e/specs/create-form-using-custom-schema.spec.ts @@ -18,7 +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)); + await formBuilderPage + .schemaInput() + .fill(JSON.stringify(customSchema, null, 2)); await formBuilderPage.renderChangesButton().click(); }); 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 9f5f46b3..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": [ { @@ -26,5 +26,6 @@ "processor": "EncounterFormProcessor", "referencedForms": [], "uuid": "xxx", - "version": 1 + "version": "1", + "description": "This is test description" }