Skip to content

Commit

Permalink
Fix all the e2e stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bamader committed Oct 28, 2024
1 parent fdea5d6 commit 8ac5e0c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 2 additions & 0 deletions query-connector/e2e/customize_query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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();

Expand Down
16 changes: 8 additions & 8 deletions query-connector/e2e/query_workflow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
7 changes: 5 additions & 2 deletions query-connector/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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: [
Expand Down
2 changes: 1 addition & 1 deletion query-connector/src/app/query/SelectQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const SelectQuery: React.FC<SelectQueryProps> = ({
[] as ValueSet[],
);
const [loadingQueryValueSets, setLoadingQueryValueSets] =
useState<boolean>(false);
useState<boolean>(true);

const [loadingResultResponse, setLoadingResultResponse] =
useState<boolean>(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,12 @@ const SelectSavedQuery: React.FC<SelectSavedQueryProps> = ({
<div className="margin-top-5">
<Button
type="button"
disabled={!selectedQuery && !loadingQueryValueSets}
className={selectedQuery ? "usa-button" : "usa-button disabled"}
disabled={!selectedQuery || loadingQueryValueSets}
className={
selectedQuery && !loadingQueryValueSets
? "usa-button"
: "usa-button disabled"
}
onClick={() => handleSubmit()}
>
Submit
Expand Down

0 comments on commit 8ac5e0c

Please sign in to comment.