-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve reliability of Click to Load integration tests
While they run reliably locally, some of the Click to Load integration tests are flaking on CI. These improvements aim to help reduce those flakes: - If a test page fails to load, let's mark the test as skipped rather than as a failure. There's not much we can do to get around network failure. - Take care to wait between unblocking a YouTube video and clicking to play it. - Take care to wait for pages to finish closing. - Avoid exceeding Jasmine's 20 second timeout when waiting for the extension configuration to load. If extension configuration fails to load, throw a clear exception to explain that. - When clicking the Facebook Click to Load buttons, ignore buttons that Puppeteer fails to click. - Fix a bug where the test extension configuration would still attempt to be unloaded, even when the test configuration failed to load. - When API schema tests timeout, mark them as skipped with a clear message.
- Loading branch information
Showing
6 changed files
with
94 additions
and
47 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
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
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 @@ | ||
async function forGoto (page, url) { | ||
try { | ||
await page.goto(url, { waitUntil: 'networkidle0' }) | ||
} catch (e) { | ||
pending('Failed to load URL: ' + url) | ||
} | ||
await page.waitForNetworkIdle({ idleTime: 1000 }) | ||
} | ||
|
||
async function forReload (page) { | ||
try { | ||
await page.reload({ waitUntil: 'networkidle0' }) | ||
} catch (e) { | ||
pending('Failed to reload page: ' + page.url()) | ||
} | ||
await page.waitForNetworkIdle({ idleTime: 1000 }) | ||
} | ||
|
||
module.exports = { | ||
forGoto, | ||
forReload | ||
} |
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