Skip to content

QA: Log page actions

Mark Lapierre requested to merge ml-qa-logging into master

What does this MR do?

A very basic MVC of logging actions made via the methods page objects inherit from Page::Base

Logging is enabled by default but can be toggled off by setting VERBOSE to falsey. This is the way it'll be done for API logging in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21302 but this might change because it is really quite verbose. We might want to consider different log levels where this output would be at the debug level, enabled by a --debug flag.

Output looks like:

manage
  basic user login
debug: with wait: max 500; time 0.1; reload true
debug: end wait
debug: has_element? :sign_in_tab returned false
debug: has_element? :standard_tab returned true
debug: found :standard_tab
debug: clicked :standard_tab
debug: found :login_field
debug: filled :login_field with "root"
debug: found :password_field
debug: filled :password_field with "********"
debug: found :sign_in_button
debug: clicked :sign_in_button
    user logs in using basic credentials

Note that it looks like wait just starts and ends with nothing in between:

debug: with wait: max 500; time 0.1; reload true
debug: end wait

This is because the code inside the wait block isn't using the methods from Page::Base where the logging happens:

          wait(max: 500) do
            has_css?('.login-page') ||
              Page::Menu::Main.act { has_personal_area?(wait: 0) }
          end

We'll need to fix that otherwise we'll have actions that don't get logged.

EE port here: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7803

MR to document new env vars: gitlab-qa!189 (merged)

What are the relevant issue numbers?

Closes gitlab-qa#142 (closed)

Does this MR meet the acceptance criteria?

Edited by Mark Lapierre

Merge request reports