Skip to content

E2E test: log element names

Jay McCure requested to merge jmc-logging-bug into master

What does this MR do and why?

log_has_element_or_not also works with when name is set to a QA::Page::Element, however the logging logs the actual object, rather than the name of the element. This MR logs the element name if it is a QA::Page::Element

Screenshots or screen recordings

Before https://gitlab.com/gitlab-org/gitlab/-/jobs/7141414196/artifacts/external_file/gitlab-qa-run-2024-06-20-03-34-07-7e9d7b98/gitlab-ee-qa-3fb99d81/qa-tests.log (line 64)

[Jun 20 2024 03:52:52 UTC (QA Tests)] DEBUG -- end within element :flash-container with args {}
[Jun 20 2024 03:52:53 UTC (QA Tests)] DEBUG -- waiting for loading to complete...
[Jun 20 2024 03:52:53 UTC (QA Tests)] DEBUG -- has_no_element? :#<QA::Page::Element:0x0000785e93b2d9e0> (wait: 0) returned: false
[Jun 20 2024 03:52:53 UTC (QA Tests)] DEBUG -- waiting for loading to complete...
[Jun 20 2024 03:52:53 UTC (QA Tests)] DEBUG -- has_no_element? :#<QA::Page::Element:0x0000785e93b2d6c0> (wait: 0) returned: true

After https://gitlab.com/gitlab-org/gitlab/-/jobs/7141500810/artifacts/external_file/gitlab-qa-run-2024-06-20-03-30-27-15f41adc/gitlab-ee-qa-e5e099cc/qa-tests.log

[Jun 20 2024 03:37:30 UTC (QA Tests)] DEBUG -- end within element :flash-container with args {}
[Jun 20 2024 03:37:31 UTC (QA Tests)] DEBUG -- waiting for loading to complete...
[Jun 20 2024 03:37:31 UTC (QA Tests)] DEBUG -- has_no_element? :user-avatar-content (wait: 0) returned: false
[Jun 20 2024 03:37:31 UTC (QA Tests)] DEBUG -- waiting for loading to complete...
[Jun 20 2024 03:37:31 UTC (QA Tests)] DEBUG -- has_no_element? :terms-content (wait: 0) returned: true

How to set up and validate locally

Run any test with debug logging, e.g:

QA_LOG_LEVEL=DEBUG QA_GITLAB_URL=https://gdk.test:3443  GITLAB_QA_PASSWORD_1=x bundle exec rspec qa/specs/features/browser_ui/3_create/web_ide/upload_new_file_in_web_ide_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