Skip to content

[QA] Allow login validation before creating personal access token

Mark Lapierre requested to merge qa-fix-api-client-login-validation into master

What does this MR do?

Removes a block so that the login page is validated before the code in the block, while the login page is still present, instead of after it when the login page is long gone.

An example of the failure this fixes: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/222017921

1) API basics user creates a project with a file and deletes them afterwards
     Failure/Error: create_project_request = Runtime::API::Request.new(@api_client, '/projects')
     
     QA::Page::Validatable::PageValidationError:
       login_page did not appear on QA::Page::Main::Login as expected
     # ./qa/page/validatable.rb:16:in `block in validate_elements_present!'
     # ./qa/page/validatable.rb:11:in `each'
     # ./qa/page/validatable.rb:11:in `validate_elements_present!'
     # ./qa/runtime/browser.rb:36:in `visit'
     # ./qa/runtime/api/client.rb:29:in `create_personal_access_token'
     # ./qa/runtime/api/client.rb:21:in `personal_access_token'
     # ./qa/runtime/api/request.rb:10:in `initialize'
     # ./qa/specs/features/api/3_create/repository/files_spec.rb:15:in `new'
     # ./qa/specs/features/api/3_create/repository/files_spec.rb:15:in `block (2 levels) in <module:QA>'

See also: https://gitlab.com/gitlab-org/quality/nightly/issues/103 for related errors

Does this MR meet the acceptance criteria?

Conformity

Edited by Mark Lapierre

Merge request reports