-
Notifications
You must be signed in to change notification settings - Fork 0
DR-3790: Fix timeouts on homepage localhost tests #465
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1c558a2
trying some timeout options
jbdalton 6cf13ab
add route-filters to block 3rd-party calls, change wait to load
jbdalton f8c9f39
dial overall timeout down to 30s but keep expect-timeouts at 20s for …
jbdalton 0b34250
remove the scalpel
jbdalton 27b42a9
make goto default
jbdalton fced17e
Update changelog
jbdalton 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -2,7 +2,23 @@ import { test, expect } from "@playwright/test"; | |
| import { DCHomepage } from "../pages/homepage.page"; | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto("/", { waitUntil: "domcontentloaded" }); | ||
| // Block analytics, tracking, and third-party domains | ||
| await page.route(/.*googletagmanager\.com.*/, (route) => route.abort()); | ||
| await page.route(/.*demdex\.net.*/, (route) => route.abort()); | ||
| await page.route(/.*adobedtm\.com.*/, (route) => route.abort()); | ||
| await page.route(/.*everesttech\.net.*/, (route) => route.abort()); | ||
| await page.route(/.*ipify\.org.*/, (route) => route.abort()); | ||
| await page.route(/.*google\.com.*/, (route) => route.abort()); | ||
| await page.route(/.*omappapi\.com.*/, (route) => route.abort()); | ||
| await page.route(/.*google-analytics\.com.*/, (route) => route.abort()); | ||
|
|
||
| // If necessary, block the main-image overlay from iiif | ||
| // When running the whole suite, feedback on the homepage will often | ||
| // timeout when default img overlays are slow | ||
| await page.route("**/default.jpg", (route) => route.abort()); | ||
|
|
||
| // Navigate to the page after setting up the routing rules. | ||
| await page.goto("/", { waitUntil: "load" }); | ||
|
Collaborator
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. The default behavior for Playwright's
Member
Author
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. removed the explicit "load" |
||
| }); | ||
|
|
||
| test("verify navigation menu is displayed (items, collections, divisions, about)", async ({ | ||
|
|
@@ -66,14 +82,18 @@ test("verify explore further section is visible", async ({ page }) => { | |
| }); | ||
|
|
||
| test("verify footer links are visible", async ({ page }) => { | ||
| page.setDefaultTimeout(30000); // 30 seconds | ||
| const dchomepage = new DCHomepage(page); | ||
| // the full footer content should be tested in the footer repo, not here in DC | ||
|
|
||
| await expect(dchomepage.footerAccessibilityLink).toBeVisible(); | ||
| }); | ||
|
|
||
| test("verify feedback button is visible", async ({ page }) => { | ||
| // this test is flaky; increasing timeout | ||
| test.setTimeout(120000); | ||
| // With route-filtering on, extending timeouts might not be necessary | ||
| // for feedback button tests. | ||
| test.setTimeout(60000); | ||
|
|
||
| const dchomepage = new DCHomepage(page); | ||
| await expect(dchomepage.feedbackButton).toBeVisible(); | ||
| await dchomepage.feedbackButton.click(); | ||
|
|
||
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.
nice! if we find this helpful on the homepage, we could make a change to abort these calls for all tests on all pages using a global setup file. definitely doesn't need to happen on this PR.