Commit 356645b7 authored by Walmyr Lima's avatar Walmyr Lima

Refactor many tests to use login flow

This way we avoid lots of duplications.
parent b3cd6fd5
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Configure', :orchestrated, :mattermost do context 'Configure', :orchestrated, :mattermost do
describe 'Mattermost support' do describe 'Mattermost support' do
it 'user creates a group with a mattermost team' do it 'user creates a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_groups) Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform do |groups| Page::Dashboard::Groups.perform do |groups|
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage' do context 'Manage' do
describe 'Project transfer between groups' do describe 'Project transfer between groups' do
it 'user transfers a project between groups' do it 'user transfers a project between groups' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
source_group = Resource::Group.fabricate_via_api! do |group| source_group = Resource::Group.fabricate_via_api! do |group|
group.path = 'source-group' group.path = 'source-group'
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage', :smoke do context 'Manage', :smoke do
describe 'basic user login' do describe 'basic user login' do
it 'user logs in using basic credentials and logs out' do it 'user logs in using basic credentials and logs out' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
expect(menu).to have_personal_area expect(menu).to have_personal_area
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage', :orchestrated, :ldap_no_tls, :ldap_tls do context 'Manage', :orchestrated, :ldap_no_tls, :ldap_tls do
describe 'LDAP login' do describe 'LDAP login' do
it 'user logs into GitLab using LDAP credentials' do it 'user logs into GitLab using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
expect(menu).to have_personal_area expect(menu).to have_personal_area
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage', :orchestrated, :mattermost do context 'Manage', :orchestrated, :mattermost do
describe 'Mattermost login' do describe 'Mattermost login' do
it 'user logs into Mattermost using GitLab OAuth' do it 'user logs into Mattermost using GitLab OAuth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Support::Retrier.retry_on_exception do Support::Retrier.retry_on_exception do
Runtime::Browser.visit(:mattermost, Page::Mattermost::Login) Runtime::Browser.visit(:mattermost, Page::Mattermost::Login)
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage' do context 'Manage' do
describe 'Add project member' do describe 'Add project member' do
it 'user adds project member' do it 'user adds project member' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage', :smoke do context 'Manage', :smoke do
describe 'Project creation' do describe 'Project creation' do
it 'user creates a new project' do it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
created_project = Resource::Project.fabricate_via_browser_ui! do |project| created_project = Resource::Project.fabricate_via_browser_ui! do |project|
project.name = 'awesome-project' project.name = 'awesome-project'
......
...@@ -23,8 +23,7 @@ module QA ...@@ -23,8 +23,7 @@ module QA
end end
it 'user imports a GitHub repo' do it 'user imports a GitHub repo' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
imported_project # import the project imported_project # import the project
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Manage' do context 'Manage' do
describe 'Project activity' do describe 'Project activity' do
it 'user creates an event in the activity page upon Git push' do it 'user creates an event in the activity page upon Git push' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project_push = Resource::Repository::ProjectPush.fabricate! do |push| project_push = Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md' push.file_name = 'README.md'
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'Create a new merge request' do describe 'Create a new merge request' do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@project = Resource::Project.fabricate_via_api! do |project| @project = Resource::Project.fabricate_via_api! do |project|
project.name = 'project' project.name = 'project'
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'Merge request creation from fork' do describe 'Merge request creation from fork' do
it 'user forks a project, submits a merge request and maintainer merges it' do it 'user forks a project, submits a merge request and maintainer merges it' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
merge_request = Resource::MergeRequestFromFork.fabricate! do |merge_request| merge_request = Resource::MergeRequestFromFork.fabricate! do |merge_request|
merge_request.fork_branch = 'feature-branch' merge_request.fork_branch = 'feature-branch'
......
...@@ -5,8 +5,7 @@ module QA ...@@ -5,8 +5,7 @@ module QA
context 'Create', :quarantine do context 'Create', :quarantine do
describe 'Merge request rebasing' do describe 'Merge request rebasing' do
it 'user rebases source branch of merge request' do it 'user rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate! do |project|
project.name = "only-fast-forward" project.name = "only-fast-forward"
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'Merge request squashing' do describe 'Merge request squashing' do
it 'user squashes commits while merging' do it 'user squashes commits while merging' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate! do |project|
project.name = "squash-before-merge" project.name = "squash-before-merge"
......
...@@ -16,8 +16,7 @@ module QA ...@@ -16,8 +16,7 @@ module QA
commit_message_of_third_branch = "Add #{file_third_branch}" commit_message_of_third_branch = "Add #{file_third_branch}"
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project = Resource::Project.fabricate! do |proj| project = Resource::Project.fabricate! do |proj|
proj.name = 'project-qa-test' proj.name = 'project-qa-test'
......
...@@ -6,8 +6,7 @@ module QA ...@@ -6,8 +6,7 @@ module QA
let(:key_title) { "key for ssh tests #{Time.now.to_f}" } let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
it 'user adds and then removes an SSH key', :smoke do it 'user adds and then removes an SSH key', :smoke do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
key = Resource::SSHKey.fabricate! do |resource| key = Resource::SSHKey.fabricate! do |resource|
resource.title = key_title resource.title = key_title
......
...@@ -6,8 +6,7 @@ module QA ...@@ -6,8 +6,7 @@ module QA
context 'Create', :quarantine do context 'Create', :quarantine do
describe 'Push over HTTP using Git protocol version 2', :requires_git_protocol_v2 do describe 'Push over HTTP using Git protocol version 2', :requires_git_protocol_v2 do
it 'user pushes to the repository' do it 'user pushes to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
# Create a project to push to # Create a project to push to
project = Resource::Project.fabricate! do |project| project = Resource::Project.fabricate! do |project|
......
...@@ -17,20 +17,15 @@ module QA ...@@ -17,20 +17,15 @@ module QA
end end
end end
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
end
around do |example| around do |example|
# Create an SSH key to be used with Git # Create an SSH key to be used with Git
login Flow::Login.sign_in
ssh_key ssh_key
example.run example.run
# Remove the SSH key # Remove the SSH key
login Flow::Login.sign_in
Page::Main::Menu.perform(&:click_settings_link) Page::Main::Menu.perform(&:click_settings_link)
Page::Profile::Menu.perform(&:click_ssh_keys) Page::Profile::Menu.perform(&:click_ssh_keys)
Page::Profile::SSHKeys.perform do |ssh_keys| Page::Profile::SSHKeys.perform do |ssh_keys|
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do describe 'Git push over HTTP', :ldap_no_tls do
it 'user using a personal access token pushes code to the repository' do it 'user using a personal access token pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
access_token = Resource::PersonalAccessToken.fabricate!.access_token access_token = Resource::PersonalAccessToken.fabricate!.access_token
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'Git push over HTTP', :ldap_no_tls do describe 'Git push over HTTP', :ldap_no_tls do
it 'user pushes code to the repository' do it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project_push = Resource::Repository::ProjectPush.fabricate! do |push| project_push = Resource::Repository::ProjectPush.fabricate! do |push|
push.file_name = 'README.md' push.file_name = 'README.md'
......
...@@ -9,8 +9,7 @@ module QA ...@@ -9,8 +9,7 @@ module QA
let(:key_title) { "key for ssh tests #{Time.now.to_f}" } let(:key_title) { "key for ssh tests #{Time.now.to_f}" }
it 'user adds an ssh key and pushes code to the repository' do it 'user adds an ssh key and pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
key = Resource::SSHKey.fabricate! do |resource| key = Resource::SSHKey.fabricate! do |resource|
resource.title = key_title resource.title = key_title
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create', :smoke do context 'Create', :smoke do
describe 'Snippet creation' do describe 'Snippet creation' do
it 'User creates a snippet' do it 'User creates a snippet' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_snippets) Page::Main::Menu.perform(&:go_to_snippets)
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'Wiki management' do describe 'Wiki management' do
it 'user creates, edits, clones, and pushes to the wiki' do it 'user creates, edits, clones, and pushes to the wiki' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
wiki = Resource::Wiki.fabricate! do |resource| wiki = Resource::Wiki.fabricate! do |resource|
resource.title = 'Home' resource.title = 'Home'
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Release' do context 'Release' do
describe 'Deploy key creation' do describe 'Deploy key creation' do
it 'user adds a deploy key' do it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
key = Runtime::Key::RSA.new key = Runtime::Key::RSA.new
deploy_key_title = 'deploy key title' deploy_key_title = 'deploy key title'
......
...@@ -10,8 +10,7 @@ module QA ...@@ -10,8 +10,7 @@ module QA
@job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json') @job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json')
Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@runner_name = "qa-runner-#{Time.now.to_i}" @runner_name = "qa-runner-#{Time.now.to_i}"
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Release' do context 'Release' do
describe 'Deploy token creation' do describe 'Deploy token creation' do
it 'user adds a deploy token' do it 'user adds a deploy token' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
deploy_token_name = 'deploy token name' deploy_token_name = 'deploy token name'
one_week_from_now = Date.today + 7 one_week_from_now = Date.today + 7
......
...@@ -26,8 +26,7 @@ module QA ...@@ -26,8 +26,7 @@ module QA
menu.sign_out if menu.has_personal_area?(wait: 0) menu.sign_out if menu.has_personal_area?(wait: 0)
end end
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
end end
context 'when restricted by another ip address' do context 'when restricted by another ip address' do
......
...@@ -119,8 +119,7 @@ module QA ...@@ -119,8 +119,7 @@ module QA
def sign_in def sign_in
unless Page::Main::Menu.perform { |p| p.has_personal_area?(wait: 0) } unless Page::Main::Menu.perform { |p| p.has_personal_area?(wait: 0) }
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
end end
end end
end end
......
...@@ -37,8 +37,7 @@ module QA ...@@ -37,8 +37,7 @@ module QA
context 'built-in', :requires_admin do context 'built-in', :requires_admin do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in_as_admin
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
@group = Resource::Group.fabricate_via_api! @group = Resource::Group.fabricate_via_api!
end end
...@@ -68,8 +67,7 @@ module QA ...@@ -68,8 +67,7 @@ module QA
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/61 # Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/61
context 'instance level', :quarantine, :requires_admin do context 'instance level', :quarantine, :requires_admin do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in_as_admin
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
Page::Main::Menu.perform(&:go_to_admin_area) Page::Main::Menu.perform(&:go_to_admin_area)
Page::Admin::Menu.perform(&:go_to_template_settings) Page::Admin::Menu.perform(&:go_to_template_settings)
...@@ -111,8 +109,7 @@ module QA ...@@ -111,8 +109,7 @@ module QA
context 'group level' do context 'group level' do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:go_to_groups) Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform { |groups| groups.click_group(Runtime::Namespace.sandbox_name) } Page::Dashboard::Groups.perform { |groups| groups.click_group(Runtime::Namespace.sandbox_name) }
......
...@@ -9,8 +9,7 @@ module QA ...@@ -9,8 +9,7 @@ module QA
let(:annotation) { "This design is great!" } let(:annotation) { "This design is great!" }
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
end end
it 'user adds a design and annotation' do it 'user adds a design and annotation' do
......
...@@ -10,8 +10,7 @@ module QA ...@@ -10,8 +10,7 @@ module QA
@project_file_name = 'elasticsearch.rb' @project_file_name = 'elasticsearch.rb'
@project_file_content = 'elasticsearch: true' @project_file_content = 'elasticsearch: true'
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
QA::EE::Resource::Settings::Elasticsearch.fabricate_via_browser_ui! QA::EE::Resource::Settings::Elasticsearch.fabricate_via_browser_ui!
......
...@@ -105,8 +105,7 @@ module QA ...@@ -105,8 +105,7 @@ module QA
end end
def login_to_gitlab def login_to_gitlab
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
end end
def patch_host_name(host_name, container_name) def patch_host_name(host_name, container_name)
...@@ -131,8 +130,7 @@ module QA ...@@ -131,8 +130,7 @@ module QA
def allow_requests_to_local_networks def allow_requests_to_local_networks
Page::Main::Menu.perform(&:sign_out_if_signed_in) Page::Main::Menu.perform(&:sign_out_if_signed_in)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in_as_admin
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
Page::Main::Menu.perform(&:go_to_admin_area) Page::Main::Menu.perform(&:go_to_admin_area)
Page::Admin::Menu.perform(&:go_to_network_settings) Page::Admin::Menu.perform(&:go_to_network_settings)
......
...@@ -17,8 +17,7 @@ module QA ...@@ -17,8 +17,7 @@ module QA
end end
it 'user submits, discards batch comments' do it 'user submits, discards batch comments' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
merge_request.visit! merge_request.visit!
......
...@@ -19,8 +19,7 @@ module QA ...@@ -19,8 +19,7 @@ module QA
project.add_member(approver, Resource::Members::AccessLevel::DEVELOPER) project.add_member(approver, Resource::Members::AccessLevel::DEVELOPER)
project.add_member(non_approver, Resource::Members::AccessLevel::DEVELOPER) project.add_member(non_approver, Resource::Members::AccessLevel::DEVELOPER)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project.visit! project.visit!
end end
......
...@@ -18,8 +18,7 @@ module QA ...@@ -18,8 +18,7 @@ module QA
before do before do
# Add two new users to a project as members # Add two new users to a project as members
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) @user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
@user2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) @user2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2)
......
...@@ -4,8 +4,7 @@ module QA ...@@ -4,8 +4,7 @@ module QA
context 'Create' do context 'Create' do
describe 'File Locking' do describe 'File Locking' do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@user_one = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) @user_one = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
@user_two = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) @user_two = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2)
......
...@@ -6,8 +6,7 @@ module QA ...@@ -6,8 +6,7 @@ module QA
# See https://gitlab.com/gitlab-org/gitlab/issues/13769 # See https://gitlab.com/gitlab-org/gitlab/issues/13769
describe 'Pull mirror a repository over HTTP', :requires_admin do describe 'Pull mirror a repository over HTTP', :requires_admin do
it 'configures and syncs a (pull) mirrored repository with password auth' do it 'configures and syncs a (pull) mirrored repository with password auth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in_as_admin
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
source = Resource::Repository::ProjectPush.fabricate! do |project_push| source = Resource::Repository::ProjectPush.fabricate! do |project_push|
project_push.project_name = 'pull-mirror-source-project' project_push.project_name = 'pull-mirror-source-project'
......
...@@ -20,8 +20,7 @@ module QA ...@@ -20,8 +20,7 @@ module QA
end end
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
target_project.visit! target_project.visit!
end end
......
...@@ -161,8 +161,7 @@ module QA ...@@ -161,8 +161,7 @@ module QA
end end
def prepare def prepare
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@project = Resource::Project.fabricate_via_api! do |project| @project = Resource::Project.fabricate_via_api! do |project|
project.name = 'push_rules' project.name = 'push_rules'
......
...@@ -42,8 +42,7 @@ module QA ...@@ -42,8 +42,7 @@ module QA
END END
end end
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
project.visit! project.visit!
end end
......
...@@ -10,8 +10,7 @@ module QA ...@@ -10,8 +10,7 @@ module QA
let(:package_name) { "#{group_id}/#{artifact_id}".tr('.', '/') } let(:package_name) { "#{group_id}/#{artifact_id}".tr('.', '/') }
let(:auth_token) do let(:auth_token) do
unless Page::Main::Menu.perform(&:signed_in?) unless Page::Main::Menu.perform(&:signed_in?)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
end end
Resource::PersonalAccessToken.fabricate!.access_token Resource::PersonalAccessToken.fabricate!.access_token
......
...@@ -9,8 +9,7 @@ module QA ...@@ -9,8 +9,7 @@ module QA
let(:package_name) { "@#{registry_scope}/#{project.name}" } let(:package_name) { "@#{registry_scope}/#{project.name}" }
let(:auth_token) do let(:auth_token) do
unless Page::Main::Menu.perform(&:signed_in?) unless Page::Main::Menu.perform(&:signed_in?)
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
end end
Resource::PersonalAccessToken.fabricate!.access_token Resource::PersonalAccessToken.fabricate!.access_token
......
...@@ -61,8 +61,7 @@ module QA ...@@ -61,8 +61,7 @@ module QA
CI CI
end end
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
Resource::MergeRequest.fabricate_via_api! do |merge_request| Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = upstream_project merge_request.project = upstream_project
......
...@@ -30,8 +30,7 @@ module QA ...@@ -30,8 +30,7 @@ module QA
end end
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@project.visit! @project.visit!
......
...@@ -28,8 +28,7 @@ module QA ...@@ -28,8 +28,7 @@ module QA
@job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json') @job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json')
Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@project = Resource::Project.fabricate_via_api! do |p| @project = Resource::Project.fabricate_via_api! do |p|
p.name = Runtime::Env.auto_devops_project_name || 'project-with-secure' p.name = Runtime::Env.auto_devops_project_name || 'project-with-secure'
......
...@@ -9,8 +9,7 @@ module QA ...@@ -9,8 +9,7 @@ module QA
describe 'License Compliance settings page' do describe 'License Compliance settings page' do
before do before do
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@project = Resource::Project.fabricate_via_api! do |project| @project = Resource::Project.fabricate_via_api! do |project|
project.name = Runtime::Env.auto_devops_project_name || 'project-with-secure' project.name = Runtime::Env.auto_devops_project_name || 'project-with-secure'
...@@ -53,8 +52,7 @@ module QA ...@@ -53,8 +52,7 @@ module QA
@job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json') @job_log_json_flag_enabled = Runtime::Feature.enabled?('job_log_json')
Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled Runtime::Feature.disable('job_log_json') if @job_log_json_flag_enabled
Runtime::Browser.visit(:gitlab, Page::Main::Login) Flow::Login.sign_in
Page::Main::Login.perform(&:sign_in_using_credentials)
@project = Resource::Project.fabricate_via_api! do |project| @project = Resource::Project.fabricate_via_api! do |project|
project.name = Runtime::Env.auto_devops_project_name || 'project-with-secure' project.name = Runtime::Env.auto_devops_project_name || 'project-with-secure'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment