Fix flaky system specs for account request and partner group editing - #5653
Open
rodrigovirgilio wants to merge 1 commit into
Open
Fix flaky system specs for account request and partner group editing#5653rodrigovirgilio wants to merge 1 commit into
rodrigovirgilio wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes two intermittently failing system specs that caused the rspec-system workflow to fail on CI.
spec/system/account_request_system_spec.rbThe test asserted
expect { click_button "Submit" }.to change(AccountRequest, :count).by(1), but the count was read before the async form submission had been processed by the server, so the change was reported as0. The assertion now clicks the button, waits for the redirect (Request Received!), and only then asserts the record count.spec/system/partner_system_spec.rb(partner group "deadline and reminder form" shared examples)click_on "Edit"could run before the Groups tab-pane was actually displayed, raisingCapybara::ElementNotFound. The precedinghas_content?check was a false positive because the group name also appears in the (visible) Partners tab. The wait and click are now scoped withwithin "#nav-partner-groups", so the test waits for the tab to be shown before interacting with it.Type of change
How Has This Been Tested?
bundle exec rspec spec/system/account_request_system_spec.rb→ 4 examples, 0 failures (repeated runs)bundle exec rspec spec/system/partner_system_spec.rb→ 47 examples, 0 failuresbundle exec rubocop spec/system/account_request_system_spec.rb spec/system/partner_system_spec.rb→ no offenses