Add measure function to identity slow qa selectors
What does this MR do and why?
Adds a method to log how long a range of methods linked to finding and interacting with QA elements.
Adds log at WARN level to anything that exceeds 0.5s as an initial baseline figure. This should help draw attention to any specific test or selectors that may be inadvertently adding excessive time to the test suite.
e.g. looking at the logs on in this MR e.g. this job - we can see a regular pattern where our login flow appears to have adding a 4sec overhead to each test which may be something that we want to revisit.
[Apr 24 2023 11:24:14 UTC (QA Tests)] INFO -- Starting test: Plan Design Management user adds a design and annotates it
[Apr 24 2023 11:24:15 UTC (QA Tests)] WARN -- Executed method has_element? in 1.025s -- login_page
[Apr 24 2023 11:24:16 UTC (QA Tests)] WARN -- Executed method has_element? in 1.024s -- user_avatar_content
[Apr 24 2023 11:24:17 UTC (QA Tests)] WARN -- Executed method has_element? in 1.023s -- sign_in_tab
[Apr 24 2023 11:24:18 UTC (QA Tests)] WARN -- Executed method has_element? in 1.027s -- standard_tab
[Apr 24 2023 11:24:18 UTC (QA Tests)] INFO -- filling :login_field with "root"
NB - Rework logic on has_element? to avoid excessive... (!118405 - merged) as a followup to address the login slowness
How to set up and validate locally
- tests should run as before, but with additional logging info capturing the duration of methods when they exceed 0.5seconds
- search for string
WARN -- Executed method
in logs
- search for string
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.