-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise playwright tests to match AI chat updates.
- Loading branch information
1 parent
dbc362e
commit 7d8b9cf
Showing
5 changed files
with
82 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { test as base, expect } from "@playwright/test"; | ||
|
||
const WORK_404_ID = "00000000-0000-0000-0000-000000000000"; | ||
|
||
const test = base.extend({}); | ||
|
||
test.describe("404 page component", async () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto(`/items/${WORK_404_ID}`); | ||
}); | ||
|
||
test("renders the 404 page", async ({ page }) => { | ||
await expect(page).toHaveURL(`/items/${WORK_404_ID}`); | ||
|
||
const figure = await page.locator("main .swiper figure"); | ||
|
||
await expect(figure.locator(".slide-label")).toHaveText("Page Not Found"); | ||
await expect(figure.locator(".slide-summary")).toHaveText( | ||
"Sorry the page you are looking for does not exist. It's possible the resource, work, or collection is no longer available. If you think you reached this page in error, please contact us.", | ||
); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { type Page } from "@playwright/test"; | ||
|
||
export const CANARY_WORK_ID = "cb8a19a7-3dec-47f3-80c0-12872ae61f8f"; | ||
|
||
export class WorkPage { | ||
readonly route: string = "/items"; | ||
readonly route: string = `/items/${CANARY_WORK_ID}`; | ||
|
||
constructor(public readonly page: Page) {} | ||
|
||
async goto() { | ||
await this.page.goto(this.route); | ||
} | ||
} |
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