-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
5 deletions.
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
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 |
---|---|---|
|
@@ -30,6 +30,7 @@ public/assets/ | |
.env.test | ||
.env.sentry-build-plugin | ||
playwright-report | ||
test-results | ||
|
||
.vscode | ||
|
||
|
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
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,36 @@ | ||
// @ts-check | ||
|
||
import { test, expect } from "@playwright/test"; | ||
|
||
test("test", async ({ page }) => { | ||
// this is on staging; don't delete this document | ||
const title = "FINALSeasonal_allergies_pollen_and_mold_2023__EN_"; | ||
const url = | ||
"/documents/20000007-finalseasonal_allergies_pollen_and_mold_2023__en"; | ||
await page.goto(url); | ||
|
||
await expect(page.locator(".sidebar").getByRole("heading")).toHaveText(title); | ||
|
||
await page.getByRole("link", { name: "Original Document (PDF) »" }).click(); | ||
|
||
await expect(page.locator("h1")).toHaveText(title); | ||
|
||
await page.getByRole("link", { name: "p. 1" }).click(); | ||
|
||
const currentUrl = new URL(page.url()); | ||
|
||
expect(currentUrl.hash).toEqual("#document/p1"); | ||
|
||
await page | ||
.locator("div") | ||
.filter({ hasText: /^DocumentPlain TextThumbnailSearch Results$/ }) | ||
.getByRole("combobox") | ||
.selectOption("text"); | ||
|
||
// check that text view loaded | ||
await expect(page.locator(".text").first()).toHaveText(/^MARCH 2023/); | ||
|
||
// switch to thumbnail view, click the first image | ||
await page.getByRole("combobox").selectOption("thumbnail"); | ||
await page.locator("img").first().click(); | ||
}); |