-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
align customize query flow to design #17
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dd038d1
link together customize query
fzhao99 4495909
add checks for flaking test
fzhao99 5413fdd
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] a6201ba
use chlamydia as the default
fzhao99 b989ee4
Merge branch 'bob/2663-query-flow-redirect' of https://github.com/CDC…
fzhao99 da4223c
actually commit change
fzhao99 122841c
lint
fzhao99 dc967b0
Merge branch 'main' into bob/2663-query-flow-redirect
fzhao99 a1f9e86
add a comment
fzhao99 8ce561d
merge
fzhao99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { TEST_URL } from "../playwright-setup"; | ||
import { STEP_TWO_PAGE_TITLE } from "@/app/query/components/patientSearchResults/PatientSearchResultsTable"; | ||
import { STEP_THREE_PAGE_TITLE } from "@/app/query/components/selectQuery/SelectSavedQuery"; | ||
import { TEST_PATIENT, TEST_PATIENT_NAME } from "./constants"; | ||
|
||
test.describe("alternate queries with the Query Connector", () => { | ||
test.beforeEach(async ({ page }) => { | ||
// Start every test on our main landing page | ||
await page.goto(TEST_URL); | ||
}); | ||
|
||
test("query using form-fillable demo patient by phone number", async ({ | ||
page, | ||
}) => { | ||
await page.getByRole("button", { name: "Go to the demo" }).click(); | ||
await page.getByRole("button", { name: "Fill fields" }).click(); | ||
|
||
// Delete last name and MRN to force phone number as one of the 3 fields | ||
await page.getByLabel("Last Name").clear(); | ||
await page.getByLabel("Medical Record Number").clear(); | ||
|
||
// Among verification, make sure phone number is right | ||
await page.getByRole("button", { name: "Search for patient" }).click(); | ||
await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); | ||
await expect( | ||
page.getByRole("heading", { name: STEP_TWO_PAGE_TITLE }), | ||
).toBeVisible(); | ||
await page.getByRole("link", { name: "Select patient" }).click(); | ||
await expect( | ||
page.getByRole("heading", { name: STEP_THREE_PAGE_TITLE }), | ||
).toBeVisible(); | ||
await page.getByRole("button", { name: "Submit" }).click(); | ||
await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); | ||
|
||
await expect(page.getByText("Patient Name")).toBeVisible(); | ||
await expect(page.getByText(TEST_PATIENT_NAME)).toBeVisible(); | ||
await expect(page.getByText("Contact")).toBeVisible(); | ||
await expect(page.getByText(TEST_PATIENT.Phone)).toBeVisible(); | ||
await expect(page.getByText("Patient Identifiers")).toBeVisible(); | ||
await expect(page.getByText(TEST_PATIENT.MRN)).toBeVisible(); | ||
}); | ||
|
||
test("social determinants query with generalized function", async ({ | ||
page, | ||
}) => { | ||
await page.getByRole("button", { name: "Go to the demo" }).click(); | ||
await page.getByRole("button", { name: "Fill fields" }).click(); | ||
await page.getByRole("button", { name: "Search for patient" }).click(); | ||
await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); | ||
|
||
await page.getByRole("link", { name: "Select patient" }).click(); | ||
await expect( | ||
page.getByRole("heading", { name: "Select a query" }), | ||
).toBeVisible(); | ||
await page.getByTestId("Select").selectOption("social-determinants"); | ||
await page.getByRole("button", { name: "Submit" }).click(); | ||
await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); | ||
|
||
await expect( | ||
page.getByRole("heading", { name: "Patient Record" }), | ||
).toBeVisible(); | ||
}); | ||
|
||
test("form-fillable STI query using generalized function", async ({ | ||
page, | ||
}) => { | ||
await page.getByRole("button", { name: "Go to the demo" }).click(); | ||
await page.getByRole("button", { name: "Fill fields" }).click(); | ||
await page.getByRole("button", { name: "Search for patient" }).click(); | ||
await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); | ||
await page.getByRole("link", { name: "Select patient" }).click(); | ||
await page.getByTestId("Select").selectOption("chlamydia"); | ||
await page.getByRole("button", { name: "Submit" }).click(); | ||
await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); | ||
|
||
await expect( | ||
page.getByRole("heading", { name: "Patient Record" }), | ||
).toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { hyperUnluckyPatient } from "@/app/constants"; | ||
|
||
export const TEST_PATIENT = hyperUnluckyPatient; | ||
export const TEST_PATIENT_NAME = | ||
hyperUnluckyPatient.FirstName + " A. " + hyperUnluckyPatient.LastName; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { TEST_URL } from "../playwright-setup"; | ||
import { metadata } from "@/app/constants"; | ||
|
||
test("landing page loads", async ({ page }) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this whole page is just a copy-paste from the existing file to help parallelize the playwright runners |
||
await page.goto(TEST_URL); | ||
|
||
// Check that each expected text section is present | ||
await expect( | ||
page.getByRole("heading", { name: "Data collection made easier" }), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole("heading", { name: "What is it?" }), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole("heading", { name: "How does it work?" }), | ||
).toBeVisible(); | ||
|
||
// Check that interactable elements are present (header and Get Started) | ||
await expect(page.getByRole("link", { name: metadata.title })).toBeVisible(); | ||
await expect( | ||
page.getByRole("button", { name: "Go to the demo" }), | ||
).toBeVisible(); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this whole page is just a copy-paste from the existing file to help parallelize the playwright runners