-
Notifications
You must be signed in to change notification settings - Fork 166
Fail JavaScript feature specs if any console messages are logged #5492
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 all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b0d8046
Configure global feature spec console log monitoring
aduth a8c6570
Refactor message customization as custom class
aduth a7c0780
Temporarily allow document-capture errors
aduth 14810b6
Allow skipping expected browser console errors
aduth b0aaa14
Only assert console logging on supported browser drivers
aduth e1ede13
Remove redundant visit
aduth e2510fd
Fix path for email delete confirmation accessibility
aduth e9b5706
Increment reload times for JS-disabled doc polling scenario
aduth 2fbabe1
Rename allow_js_error to allow_browser_log
aduth 1ed8d6a
Always get logs
aduth 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
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
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| class BrowserConsoleLogError < StandardError | ||
| def initialize(messages) | ||
| @messages = messages | ||
| end | ||
|
|
||
| def to_s | ||
| "Unexpected browser console logging:\n\n#{@messages.join("\n\n")}" | ||
| end | ||
| end |
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.
maybe we do some sort like
next if spec.metadata[:allow_js_error]and then addallow_js_error: trueto the polling spec mentioned in #5492 (comment)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.
Yeah, I like that idea. It's a bit trickier though, since any spec which would include document capture as part of its prerequisite setup would fail (e.g.
complete_doc_auth_steps_before_verify_step), so it's not very self-contained. That being said, I only see 3 failures currently in Circle, so maybe it's fine enough.Alternatively, we could target the offending script here as being allowed to log errors.
Feels pretty gross, but also I'm really thinking maybe to refactor the document capture polling to not rely on these errors, so could be a temporary band-aid fix.
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.
I had an idea that inside the
complete_doc_auth_steps_before_verify_stepwe could modifyspec.metadata[:allow_js_error] = true... however, ran into this error: :[