-
Notifications
You must be signed in to change notification settings - Fork 166
Use faster default driver for feature tests not requiring JavaScript #11077
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,13 +15,18 @@ | |
| ) | ||
| end | ||
|
|
||
| it 'allows the user to sign in if webauthn is successful' do | ||
| mock_webauthn_verification_challenge | ||
| context 'with javascript enabled', :js do | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I restored some JavaScript-enabled testing in this file, since part of the idea with #8761 was to have more realistic testing for how WebAuthn is expected to work in a real browser. I think it should suffice to do this once for the critical path, and use the default driver for everything else. |
||
| # While JavaScript tests are slower to run, these tests provide increased confidence in the | ||
| # real-world behavior of WebAuthn browser interaction for the critical pathways. | ||
|
|
||
| sign_in_user(user) | ||
| mock_successful_webauthn_authentication { click_webauthn_authenticate_button } | ||
| it 'allows the user to sign in if webauthn is successful' do | ||
| mock_webauthn_verification_challenge | ||
|
|
||
| expect(page).to have_current_path(account_path) | ||
| sign_in_user(user) | ||
| mock_successful_webauthn_authentication { click_webauthn_authenticate_button } | ||
|
|
||
| expect(page).to have_current_path(account_path) | ||
| end | ||
| end | ||
|
|
||
| it 'does not allow the user to sign in if the challenge/secret is incorrect' do | ||
|
|
@@ -44,7 +49,7 @@ | |
| expect(page).to have_current_path(login_two_factor_webauthn_path) | ||
| end | ||
|
|
||
| it 'does not show error after successful challenge/secret reattempt', :js do | ||
| it 'does not show error after successful challenge/secret reattempt' do | ||
| mock_webauthn_verification_challenge | ||
|
|
||
| sign_in_user(user) | ||
|
|
@@ -57,7 +62,7 @@ | |
| expect(page).to_not have_content(general_error) | ||
| end | ||
|
|
||
| it 'maintains correct platform attachment content if cancelled', :js do | ||
| it 'maintains correct platform attachment content if cancelled' do | ||
| mock_webauthn_verification_challenge | ||
|
|
||
| sign_in_user(user) | ||
|
|
@@ -71,7 +76,7 @@ | |
| create(:user, :with_webauthn_platform, with: { credential_id:, credential_public_key: }) | ||
| end | ||
|
|
||
| it 'maintains correct platform attachment content if cancelled', :js do | ||
| it 'maintains correct platform attachment content if cancelled' do | ||
| mock_webauthn_verification_challenge | ||
|
|
||
| sign_in_user(user) | ||
|
|
||
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.
We already have an identical test for this outside the JavaScript context, and there's nothing particular about JavaScript which we'd expect to influence this behavior.