Skip to content

Add a warning log to help avoid slowness due to using has_no_element

What does this MR do and why?

Adds logging to QA has_no_element? method to hint callers to consider using a shorter wait time, or perhaps an alternative mechanism.
Using has_no_element? with default values will lead to long waits up to the value defined in MAX_CAPYBARA_WAIT_TIME

Ideally - when we don't expect an element to be present - we should use a shorter wait time, or alternative to avoid long pauses in our tests.

Future iterations can improve this by hardcoding a shorter wait here, but this will give us an opportunity to monitor how many such calls are being made today.

How to set up and validate locally

  1. Set env MAX_CAPYBARA_WAIT_TIME=20 (or some long value)
  2. Set QA_DEBUG=true
  3. Unset GITLAB_QA_ACCESS_TOKEN (I noted when GITLAB_QA_ACCESS_TOKEN is not set locally, during the setup steps we has_no_personal_area? is called which has this issue)
  4. Run some specs and note in the logs the new log message e.g bundle exec bin/qa Test::Instance::All http://gdk.test:3000 -- qa/specs/features/ee/browser_ui/11_fulfillment/license/license_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.

Merge request reports

Loading