E2E test: search for file if not visible in MR file tree
What does this MR do and why?
Fixes #392006 (closed)
Example failure: https://gitlab.com/gitlab-org/gitlab/-/jobs/3792533313 (only occurs on large-setup job as it uses a large MR)
The E2E tests check the file tree on the Changes tab of an MR. This started failing for large merge requests because virtual scrolling was implemented for the file tree. This means the element isn't created when it is out of the viewport and Selenium cannot find it.
This MR, now searches the file tree if it cannot find the file.
How to set up and validate locally
To invoke file tree search usecase:
In merge_request.rb
replace return fabricate_large_merge_request if large_setup?
with return fabricate_large_merge_request if true
bundle exec rspec qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_spec.rb
To invoke normal usecase:
bundle exec rspec qa/specs/features/browser_ui/3_create/merge_request/revert/reverting_merge_request_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.