Commit 9dd2eae3 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'qa-staging-15-use-existing-users-ce' into 'master'

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

See merge request gitlab-org/gitlab-ce!22864
parents 9cbc82ef 4ef5d1fd
...@@ -76,6 +76,17 @@ module QA ...@@ -76,6 +76,17 @@ module QA
} }
end 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 private
def fetch_id(username) def fetch_id(username)
......
...@@ -75,6 +75,22 @@ module QA ...@@ -75,6 +75,22 @@ module QA
ENV['GITLAB_FORKER_PASSWORD'] ENV['GITLAB_FORKER_PASSWORD']
end 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 def ldap_username
ENV['GITLAB_LDAP_USERNAME'] ENV['GITLAB_LDAP_USERNAME']
end end
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) 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| project = Resource::Project.fabricate! do |resource|
resource.name = 'add-member-project' 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