Test: Add BrowserConsoleHelpers for Capybara
Issue: Add console.error assertion to Web IDE feature ... (#478037 - closed)
What does this MR do and why?
As part of #478037 (closed), this MR does 2 things:
- It adds a
BrowserConsoleHelpers
module for feature specs in Capybara. This introduces a methodexpect_page_to_have_no_console_errors
. - It shows this in action by fixing a bug on
.com
that would have been caught by this behavior.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Here's the new BrowserConsoleHelpers
in action:
Here's the result of the frequent items fix:
How to test?
To test that expect_page_to_have_no_console_errors
fails when a console error is thrown:
- Checkout the changes in this commit 834e0243
- Run
bundle exec spring rspec spec/features/global_search_spec.rb
To test the console-error-throwing bug that this MR fixes
- Checkout all the changes in this MR.
- Start GDK
- If you're signed into GDK, then sign out.
- Visit a public project as a signed out user and open the browser console.
- Click the Search or go to... button.
Related to #478037 (closed)
Edited by Paul Slaughter