E2E tests: Wait for requests after adding suggestion
What does this MR do and why?
Resolves #377680 (closed) Resolves #366447 (closed)
For more context #377680 (comment 1211724650)
In the browser_ui/3_create/merge_request/suggestions/*
E2E tests we log in as one user to make the suggestion, and then we log in as another user to accept the suggestion.
Occasionally we get a 422 when clicking on the sign in button when switching users. This is reproducible locally with the GDK about 10% of the time if you continually run the test.
The solution is to wait for requests to finish before clicking sign in. When timing wait_for_requests
there was evidence of requests still running when clicking sign in. After this change I no longer received the 422. (tested with many test runs)
The same issue was also discovered and fixed in the feature specs: !101276 (diffs)
How to set up and validate locally
bundle exec rspec --order defined qa/specs/features/browser_ui/3_create/merge_request/suggestions/custom_commit_suggestion_spec.rb
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.