Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-30 21:11:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-30 21:11:31 +0300
commitc753fd0bf4a5cc09f69941daef0f6fe99d61f20e (patch)
tree9aee7f1af879446f226d7a67c149c817ace3f69f /qa/lib
parenteaec42f9e37fe51f9c53fa7079639ec9f4c40efc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/lib')
-rw-r--r--qa/lib/gitlab/page/main/login.rb18
-rw-r--r--qa/lib/gitlab/page/main/login.stub.rb82
2 files changed, 99 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
diff --git a/qa/lib/gitlab/page/main/login.stub.rb b/qa/lib/gitlab/page/main/login.stub.rb
index a4cef291616..a819ca4bcc8 100644
--- a/qa/lib/gitlab/page/main/login.stub.rb
+++ b/qa/lib/gitlab/page/main/login.stub.rb
@@ -95,6 +95,88 @@ module Gitlab
def sign_in_button?
# This is a stub, used for indexing. The method is dynamically generated.
end
+
+ # @note Defined as +button :accept_terms+
+ # Clicks +accept_terms+
+ def accept_terms
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # expect(login.accept_terms_element).to exist
+ # end
+ # @return [Watir::Button] The raw +Button+ element
+ def accept_terms_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # expect(login).to be_accept_terms
+ # end
+ # @return [Boolean] true if the +accept_terms+ element is present on the page
+ def accept_terms?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +text_field :password_confirmation_field+
+ # @return [String] The text content or value of +password_confirmation_field+
+ def password_confirmation_field
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # Set the value of password_confirmation_field
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # login.password_confirmation_field = 'value'
+ # end
+ # @param value [String] The value to set.
+ def password_confirmation_field=(value)
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # expect(login.password_confirmation_field_element).to exist
+ # end
+ # @return [Watir::TextField] The raw +TextField+ element
+ def password_confirmation_field_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # expect(login).to be_password_confirmation_field
+ # end
+ # @return [Boolean] true if the +password_confirmation_field+ element is present on the page
+ def password_confirmation_field?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @note Defined as +button :change_password_button+
+ # Clicks +change_password_button+
+ def change_password_button
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # expect(login.change_password_button_element).to exist
+ # end
+ # @return [Watir::Button] The raw +Button+ element
+ def change_password_button_element
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
+
+ # @example
+ # Gitlab::Page::Main::Login.perform do |login|
+ # expect(login).to be_change_password_button
+ # end
+ # @return [Boolean] true if the +change_password_button+ element is present on the page
+ def change_password_button?
+ # This is a stub, used for indexing. The method is dynamically generated.
+ end
end
end
end