Document feature spec readiness waits
What does this MR do and why?
Documents reliable readiness and synchronization patterns for feature specs.
- Replaces the accessibility-guide example that recommends
wait_for_requests. - Adds canonical guidance on why
wait_for_requestsandwait_for_all_requestsrace, and links the RuboCop cop directly to it. - Documents concrete replacements from !246008 (merged): waiting matchers, modal readiness,
wait_forpolling, script reads, shared-example gates, and narrowly scoped JavaScript readiness signals. - Clarifies that
have_gitlab_http_statusaccepts a Capybara session.
Related issues
Resolves #608154
References
- !246008 (merged)
- &22879
- Slack thread: https://gitlab.slack.com/archives/C9X79MNJ3/p1785916768087989?thread_ts=1785894398.639519&cid=C9X79MNJ3
How to set up and validate locally
- Run
bundle exec rspec spec/rubocop/cop/rspec/avoid_wait_for_requests_spec.rb. - Run
bundle exec rubocop rubocop/cop/rspec/avoid_wait_for_requests.rb spec/rubocop/cop/rspec/avoid_wait_for_requests_spec.rb. - Run
scripts/lint-doc.sh doc/development/fe_guide/accessibility/feature_tests.md doc/development/fe_guide/style/javascript.md doc/development/testing_guide/best_practices.md doc/development/testing_guide/unhealthy_tests.md. - Run
lychee --offline --include-fragments doc/development/fe_guide/accessibility/feature_tests.md doc/development/fe_guide/style/javascript.md doc/development/testing_guide/best_practices.md doc/development/testing_guide/unhealthy_tests.md.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Pedro Pombeiro