From 8ac5e0c3f1da3c844e5ea1f9b9ff72c4d9c8c306 Mon Sep 17 00:00:00 2001 From: bamader Date: Mon, 28 Oct 2024 11:31:52 -0400 Subject: [PATCH 01/22] Fix all the e2e stuff --- query-connector/e2e/customize_query.spec.ts | 2 ++ query-connector/e2e/query_workflow.spec.ts | 16 ++++++++-------- query-connector/playwright.config.ts | 7 +++++-- query-connector/src/app/query/SelectQuery.tsx | 2 +- .../components/selectQuery/SelectSavedQuery.tsx | 8 ++++++-- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/query-connector/e2e/customize_query.spec.ts b/query-connector/e2e/customize_query.spec.ts index 0673b1272..cbe16de1e 100644 --- a/query-connector/e2e/customize_query.spec.ts +++ b/query-connector/e2e/customize_query.spec.ts @@ -39,6 +39,7 @@ test.describe("querying with the Query Connector", () => { }); test("customize query successfully filtering some data", async ({ page }) => { + test.slow(); await expect( page.getByText( "249 labs found, 4 medications found, 104 conditions found.", @@ -104,6 +105,7 @@ test.describe("querying with the Query Connector", () => { test("customize query select / deselect all filters whole DibbsConceptType, across tabs", async ({ page, }) => { + test.slow(); await page.getByRole("link", { name: "Labs" }).click(); await page.getByRole("button", { name: "Deselect all labs" }).click(); diff --git a/query-connector/e2e/query_workflow.spec.ts b/query-connector/e2e/query_workflow.spec.ts index b944dec0c..08ee052bb 100644 --- a/query-connector/e2e/query_workflow.spec.ts +++ b/query-connector/e2e/query_workflow.spec.ts @@ -75,14 +75,14 @@ test.describe("querying with the Query Connector", () => { // and seems to apply with no rhyme or reason to use case. Commenting this out // because it no longer acts as a sanity check but leaving it here as a warning // to others. - // await page.getByRole("button", { name: "Customize Query" }).click(); - // await expect( - // page.getByRole("heading", { name: "Customize Query" }), - // ).toBeVisible(); - // await expect( - // page.getByText("0 labs found, 0 medications found, 0 conditions found."), - // ).not.toBeVisible(); - // await page.getByText("Return to Select query").click(); + await page.getByRole("button", { name: "Customize Query" }).click(); + await expect( + page.getByRole("heading", { name: "Customize Query" }), + ).toBeVisible(); + await expect( + page.getByText("0 labs found, 0 medications found, 0 conditions found."), + ).not.toBeVisible(); + await page.getByText("Return to Select query").click(); await page.getByRole("button", { name: "Submit" }).click(); await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); diff --git a/query-connector/playwright.config.ts b/query-connector/playwright.config.ts index 56d3016f6..28e7d8660 100644 --- a/query-connector/playwright.config.ts +++ b/query-connector/playwright.config.ts @@ -17,8 +17,8 @@ export default defineConfig({ /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - workers: process.env.CI ? 1 : 1, + retries: process.env.CI ? 2 : 2, + workers: process.env.CI ? 2 : 2, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: "html", /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ @@ -30,6 +30,9 @@ export default defineConfig({ trace: "on-first-retry", video: "on-first-retry", }, + expect: { + timeout: 10 * 1000, + }, /* Configure projects for major browsers */ projects: [ diff --git a/query-connector/src/app/query/SelectQuery.tsx b/query-connector/src/app/query/SelectQuery.tsx index 716282c52..0beefd245 100644 --- a/query-connector/src/app/query/SelectQuery.tsx +++ b/query-connector/src/app/query/SelectQuery.tsx @@ -61,7 +61,7 @@ const SelectQuery: React.FC = ({ [] as ValueSet[], ); const [loadingQueryValueSets, setLoadingQueryValueSets] = - useState(false); + useState(true); const [loadingResultResponse, setLoadingResultResponse] = useState(false); diff --git a/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx b/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx index 8bc6659e0..ccd5f21f2 100644 --- a/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx +++ b/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx @@ -133,8 +133,12 @@ const SelectSavedQuery: React.FC = ({