Skip to content

Don't use rapid mode for searching dropdowns in E2E tests

Jay McCure requested to merge jmc-fix-approvals-e2e-test-rapid into master

What does this MR do and why?

Resolves #387607 (closed)

The dropdown list control has recently changed on the new MR Approvals modal. The current issue the E2E tests are having with this control is that characters are being lost intermittently when searching for an approval group. Strangely this only seems to occur on master builds.

For example, in a failure case the search field was being set to qa-te1b rather than qa-test-2023-01-18-21-42-39-f2b0f8418a7e4e1b (it was missing most of the characters in the string)

Screenshot example of these lost characters

Although this failure cannot be reproduced locally, I suspect this issue is caused by Capybara's #set_text method when the string is over 30 chars. If the string is over 30 chars, it will use rapid mode, but rapid mode is known to lose characters. This would explain why we are losing chars for the group name and not the user name (under 30 chars).

Capybara documentation warning about losing characters

It seems risky to have two different behaviours dependant on the length of the string, so this MR changes the search_item method to never use rapid mode.

This MR also changes the group search back to full_path to make it unambiguous, and adds some extra logging.

How to set up and validate locally

GITLAB_QA_PASSWORD_1=XXX GITLAB_QA_PASSWORD_2=XXX bundle exec rspec qa/specs/features/ee/browser_ui/3_create/merge_request/approval_rules_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.

Edited by Jay McCure

Merge request reports

Loading