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: Trigger E2E test failure on console logging #8721

Merged
merged 3 commits into from
Aug 9, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Aug 8, 2018

This pull request seeks to enhance end-to-end tests to protect against unexpected console logging. While our use of jest-puppeteer will capture and fail tests on pageerror events, often we have other errors which occur that either do not crash the page or are captured by the top-level application error handler and handled gracefully. This console monitoring should also help protect against internal use of deprecated functionality.

Implementation notes:

One point of stability I introduced here is automated handling of teardown of page event bindings. We should probably apply this to browser as well, and probably on afterEach, to improve isolation between tests and avoid event handler leaking. This should be done separately.

Testing instructions:

Verify end-to-end tests pass successfully:

npm run test-e2e

You can trigger a failure by introducing a console.error somewhere which would be covered by E2E tests.

@aduth aduth added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Aug 8, 2018
@aduth aduth requested a review from gziolo August 8, 2018 16:07
@aduth aduth mentioned this pull request Aug 8, 2018
2 tasks
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very solid refactoring. It should improve the reliability of the tests run 💯

@gziolo gziolo added this to the 3.5 milestone Aug 9, 2018
@gziolo gziolo merged commit 9bacc93 into master Aug 9, 2018
@gziolo gziolo deleted the add/e2e-console-monitor branch August 9, 2018 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants