Skip to content
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

Testing: Fail E2E tests when uncaught page error occurs #6713

Merged
merged 1 commit into from
May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/e2e/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ export async function newPost( postType ) {

export async function newDesktopBrowserPage() {
global.page = await browser.newPage();

page.on( 'pageerror', ( error ) => {
// Disable reason: `jest/globals` doesn't include `fail`, but it is
// part of the global context supplied by the underlying Jasmine:
//
// https://jasmine.github.io/api/3.0/global.html#fail

// eslint-disable-next-line no-undef
fail( error );
} );

await page.setViewport( { width: 1000, height: 700 } );
}

Expand Down