summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorSanad Liaquat <sliaquat@gitlab.com>2018-11-19 22:20:47 +0000
committerMark Lapierre <mlapierre@gitlab.com>2018-11-19 22:20:47 +0000
commit4ef5d1fd8bbc2a95e77be19c3144e0ba71b211ea (patch)
tree2b8178be49325a79b20d6d36147110a3f2dc13ac /qa
parent9cbc82ef30c61b76a4156aa14c20c3c3e5c5eec1 (diff)
downloadgitlab-ce-4ef5d1fd8bbc2a95e77be19c3144e0ba71b211ea.tar.gz
CE port of "qa-staging-15-use-existing-users-ee"
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/resource/user.rb11
-rw-r--r--qa/qa/runtime/env.rb16
-rw-r--r--qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb2
3 files changed, 28 insertions, 1 deletions
diff --git a/qa/qa/resource/user.rb b/qa/qa/resource/user.rb
index 16f0b311fa9..9be88ba4211 100644
--- a/qa/qa/resource/user.rb
+++ b/qa/qa/resource/user.rb
@@ -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)
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index c4500f9be90..1154eaca6a9 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -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
diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb
index bef89d5be24..4070a225260 100644
--- a/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb
+++ b/qa/qa/specs/features/browser_ui/1_manage/project/add_project_member_spec.rb
@@ -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'