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
diff options
context:
space:
mode:
authorDan Davison <ddavison@gitlab.com>2018-09-18 23:15:02 +0300
committerRobert Speicher <robert@gitlab.com>2018-09-18 23:15:02 +0300
commitc59fd889dce71dec0605ce3a456e0b9a36925437 (patch)
tree8621d2de4816c6de5badfa36cc3750eed777bcbe /qa
parentd83c1559ad0fdb5d7c0aa42c885ff5a4ee6a0ded (diff)
[QA] consolidate selector patterns (1_manage/login)
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/main/login.rb52
1 files changed, 26 insertions, 26 deletions
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index 4e9506a7dc8..e9e49964e63 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -3,31 +3,31 @@ module QA
module Main
class Login < Page::Base
view 'app/views/devise/passwords/edit.html.haml' do
- element :password_field, 'password_field :password'
- element :password_confirmation, 'password_field :password_confirmation'
- element :change_password_button, 'submit "Change your password"'
+ element :password_field
+ element :password_confirmation
+ element :change_password_button
end
view 'app/views/devise/sessions/_new_base.html.haml' do
- element :login_field, 'text_field :login'
- element :password_field, 'password_field :password'
- element :sign_in_button, 'submit "Sign in"'
+ element :login_field
+ element :password_field
+ element :sign_in_button
end
view 'app/views/devise/sessions/_new_ldap.html.haml' do
- element :username_field, 'text_field_tag :username'
- element :password_field, 'password_field_tag :password'
- element :sign_in_button, 'submit_tag "Sign in"'
+ element :username_field
+ element :password_field
+ element :sign_in_button
end
view 'app/views/devise/shared/_tabs_ldap.html.haml' do
- element :ldap_tab, "link_to server['label']"
- element :standard_tab, "link_to 'Standard'"
+ element :ldap_tab
+ element :standard_tab
end
view 'app/views/devise/shared/_tabs_normal.html.haml' do
- element :sign_in_tab, /nav-link.*login-pane.*Sign in/
- element :register_tab, /nav-link.*register-pane.*Register/
+ element :sign_in_tab
+ element :register_tab
end
def initialize
@@ -87,19 +87,19 @@ module QA
end
def switch_to_sign_in_tab
- click_on 'Sign in'
+ click_element :sign_in_tab
end
def switch_to_register_tab
- click_on 'Register'
+ click_element :register_tab
end
def switch_to_ldap_tab
- click_on 'LDAP'
+ click_element :ldap_tab
end
def switch_to_standard_tab
- click_on 'Standard'
+ click_element :standard_tab
end
private
@@ -107,26 +107,26 @@ module QA
def sign_in_using_ldap_credentials
switch_to_ldap_tab
- fill_in :username, with: Runtime::User.ldap_username
- fill_in :password, with: Runtime::User.ldap_password
- click_button 'Sign in'
+ fill_element :username_field, Runtime::User.ldap_username
+ fill_element :password_field, Runtime::User.ldap_password
+ click_element :sign_in_button
end
def sign_in_using_gitlab_credentials(user)
switch_to_sign_in_tab unless sign_in_tab?
switch_to_standard_tab if ldap_tab?
- fill_in :user_login, with: user.username
- fill_in :user_password, with: user.password
- click_button 'Sign in'
+ fill_element :login_field, user.username
+ fill_element :password_field, user.password
+ click_element :sign_in_button
end
def set_initial_password_if_present
return unless page.has_content?('Change your password')
- fill_in :user_password, with: Runtime::User.password
- fill_in :user_password_confirmation, with: Runtime::User.password
- click_button 'Change your password'
+ fill_element :password_field, Runtime::User.password
+ fill_element :password_confirmation, Runtime::User.password
+ click_element :change_password_button
end
end
end