Fix flaky qa/specs/features/ee/browser_ui/3_create/repository/prevent_forking_outside_group_spec.rb
What does this MR do and why?
Fixes flaky test: qa/specs/features/ee/browser_ui/3_create/repository/prevent_forking_outside_group_spec.rb
The set_prevent_forking_outside_group method clicks a save button that triggers an AJAX request to persist the group setting. However, click_element only waits for pending requests before clicking—not after. This means the method returns while the AJAX request is still in flight.
Without waiting for this AJAX to complete, project.visit! is called before the setting has been saved to the database, causing the page load to timeout as it waits for the setting to take effect.
Adding wait_for_requests after the method ensures the AJAX completes before attempting to visit the project, eliminating the race condition.
References
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.
Resolves https://gitlab.com/gitlab-org/quality/test-failure-issues/-/issues/16720