Skip to content

Output JS errors encountered during UI tests. [test ui]#8870

Merged
bcjordan merged 4 commits into
stagingfrom
ui-test-js-error-recording
Aug 3, 2016
Merged

Output JS errors encountered during UI tests. [test ui]#8870
bcjordan merged 4 commits into
stagingfrom
ui-test-js-error-recording

Conversation

@bcjordan

@bcjordan bcjordan commented Jun 9, 2016

Copy link
Copy Markdown
Contributor

The main drawback of this approach is that it does not catch errors during page load (only after Selenium considers the page sufficiently loaded).

To get page errors on load as well, it looks like we could either (1) use a man-in-the-middle proxy like fiddler or mitmproxy or (2) maybe include the reporting javascript snippet on our pages in the test environment.

@bcjordan bcjordan changed the title [Experimental] Record and fail on JS errors encountered during UI tests. [test ui] Record and fail on JS errors encountered during UI tests. [test ui] Jun 9, 2016
window.onerror = function (msg) {
window.detectedJSErrors = window.detectedJSErrors || [];
window.detectedJSErrors.push(msg);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we might want to store the original window.onerror if it exists, and then also call it, so that if we depend on a different window.onerror defined elsewhere we're not blowing it away

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Bjvanminnen

Copy link
Copy Markdown
Contributor

I think starting out failing is fine, and if we find that's too problematic we can try dialing back.

@bcjordan bcjordan changed the title Record and fail on JS errors encountered during UI tests. [test ui] Output JS errors encountered during UI tests. [test ui] Aug 3, 2016
@bcjordan bcjordan merged commit e6cad20 into staging Aug 3, 2016
@bcjordan bcjordan deleted the ui-test-js-error-recording branch August 3, 2016 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants