Skip to content

Use faster default driver for feature tests not requiring JavaScript#11077

Merged
aduth merged 3 commits intomainfrom
aduth-avoid-js-feature-specs-unless-necessary
Aug 14, 2024
Merged

Use faster default driver for feature tests not requiring JavaScript#11077
aduth merged 3 commits intomainfrom
aduth-avoid-js-feature-specs-unless-necessary

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Aug 14, 2024

🛠 Summary of changes

Updates a few feature specs to avoid opting into the JavaScript-enabled driver where not strictly necessary to do so.

Why?

  • Improve build speed, since the default driver is faster

📜 Testing Plan

Verify build passes.

changelog: Internal, Automated Testing, Use faster default driver for feature tests not requiring JavaScript
aduth added 2 commits August 14, 2024 10:01
Same test case already exists in no-JavaScript context
Comment on lines -244 to -251

it 'allows a user to sign up with backup codes and add methods without reauthentication' do
sign_in_user
select_2fa_option('backup_code')

visit phone_setup_path
expect(page).to have_current_path phone_setup_path
end
Copy link
Contributor Author

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.


it 'allows the user to sign in if webauthn is successful' do
mock_webauthn_verification_challenge
context 'with javascript enabled', :js do
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

@aduth aduth requested a review from jmax-gsa August 14, 2024 14:04
@aduth aduth merged commit c21975d into main Aug 14, 2024
@aduth aduth deleted the aduth-avoid-js-feature-specs-unless-necessary branch August 14, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants