Commit 05c74552 authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'dj-update-chemlab-0.9-update-login-library' into 'master'

Update login library to include term acceptance

See merge request gitlab-org/gitlab!71118
parents f1274f3c d07967d4
......@@ -26,7 +26,7 @@ gem 'webdrivers', '~> 4.6'
gem 'zeitwerk', '~> 2.4'
gem 'influxdb-client', '~> 1.17'
gem 'chemlab', '~> 0.8'
gem 'chemlab', '~> 0.9'
gem 'chemlab-library-www-gitlab-com', '~> 0.1'
gem 'deprecation_toolkit', '~> 1.5.1', require: false
......
......@@ -41,7 +41,7 @@ GEM
capybara-screenshot (1.0.23)
capybara (>= 1.0, < 4)
launchy
chemlab (0.8.1)
chemlab (0.9.1)
colorize (~> 0.8)
i18n (~> 1.8)
rake (>= 12, < 14)
......@@ -244,7 +244,7 @@ DEPENDENCIES
allure-rspec (~> 2.14.5)
capybara (~> 3.35.0)
capybara-screenshot (~> 1.0.23)
chemlab (~> 0.8)
chemlab (~> 0.9)
chemlab-library-www-gitlab-com (~> 0.1)
deprecation_toolkit (~> 1.5.1)
faker (~> 2.19, >= 2.19.0)
......
......@@ -4,7 +4,7 @@ $:.unshift(File.expand_path('lib', __dir__))
Gem::Specification.new do |spec|
spec.name = 'chemlab-library-gitlab'
spec.version = '0.2.0'
spec.version = '0.3.0'
spec.authors = ['GitLab Quality']
spec.email = ['quality@gitlab.com']
......@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.add_runtime_dependency 'chemlab', '~> 0.8'
spec.add_runtime_dependency 'chemlab', '~> 0.9'
end
......@@ -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
......
......@@ -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
......
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