Commit 4ef5d1fd authored by Sanad Liaquat's avatar Sanad Liaquat Committed by Mark Lapierre

CE port of "qa-staging-15-use-existing-users-ee"

parent 9cbc82ef
......@@ -76,6 +76,17 @@ module QA
}
end
def self.fabricate_or_use(username, password)
if Runtime::Env.signup_disabled?
self.new.tap do |user|
user.username = username
user.password = password
end
else
self.fabricate!
end
end
private
def fetch_id(username)
......
......@@ -75,6 +75,22 @@ module QA
ENV['GITLAB_FORKER_PASSWORD']
end
def gitlab_qa_username_1
ENV['GITLAB_QA_USERNAME_1'] || 'gitlab-qa-user1'
end
def gitlab_qa_password_1
ENV['GITLAB_QA_PASSWORD_1']
end
def gitlab_qa_username_2
ENV['GITLAB_QA_USERNAME_2'] || 'gitlab-qa-user2'
end
def gitlab_qa_password_2
ENV['GITLAB_QA_PASSWORD_2']
end
def ldap_username
ENV['GITLAB_LDAP_USERNAME']
end
......
......@@ -7,7 +7,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
user = Resource::User.fabricate!
user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
project = Resource::Project.fabricate! do |resource|
resource.name = 'add-member-project'
......
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