summaryrefslogtreecommitdiff
path: root/qa/lib/gitlab/page/main/login.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/lib/gitlab/page/main/login.rb')
-rw-r--r--qa/lib/gitlab/page/main/login.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/qa/lib/gitlab/page/main/login.rb b/qa/lib/gitlab/page/main/login.rb
index 9f20a040550..de05df1a086 100644
--- a/qa/lib/gitlab/page/main/login.rb
+++ b/qa/lib/gitlab/page/main/login.rb
@@ -10,11 +10,27 @@ module Gitlab
text_field :password_field
button :sign_in_button
- def sign_in_as(username:, password:)
+ button :accept_terms, text: 'Accept terms'
+
+ # password change tab
+ text_field :password_confirmation_field
+ button :change_password_button
+
+ # Sign in using a given username and password
+ # @note this will also automatically accept terms if prompted
+ # @param [String] username the username to sign in with
+ # @param [String] password the password to sign in with
+ # @example
+ # Page::Main::Login.perform do |login|
+ # login.sign_in_as(username: 'username', password: 'password')
+ # login.sign_in_as(username: 'username', password: 'password', accept_terms: false)
+ # end
+ def sign_in_as(username:, password:, accept_terms: true)
self.login_field = username
self.password_field = password
sign_in_button
+ self.accept_terms if accept_terms && accept_terms?
end
end
end