summaryrefslogtreecommitdiff
path: root/qa/qa/page/main/login.rb
diff options
context:
space:
mode:
authorMykhailo Formus <mikeformus@gmail.com>2018-07-12 11:59:40 +0000
committerRémy Coutable <remy@rymai.me>2018-07-12 11:59:40 +0000
commit29955c9c474de957415da21ec3a330b596807f74 (patch)
treed21b6365897a1cb79fe549c20a86aacca35d3b7a /qa/qa/page/main/login.rb
parentfc4c7956850ff40100301ea44aaf0b8b8725e114 (diff)
downloadgitlab-ce-29955c9c474de957415da21ec3a330b596807f74.tar.gz
Adding spec to test basic forking functionalities
Diffstat (limited to 'qa/qa/page/main/login.rb')
-rw-r--r--qa/qa/page/main/login.rb19
1 files changed, 17 insertions, 2 deletions
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index 26c99efc53d..6cdfbd1c125 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -25,19 +25,24 @@ module QA
element :standard_tab, "link_to 'Standard'"
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/
+ end
+
def initialize
# The login page is usually the entry point for all the scenarios so
# we need to wait for the instance to start. That said, in some cases
# we are already logged-in so we check both cases here.
wait(max: 500) do
page.has_css?('.login-page') ||
- Page::Menu::Main.act { has_personal_area? }
+ Page::Menu::Main.act { has_personal_area?(wait: 0) }
end
end
def sign_in_using_credentials
# Don't try to log-in if we're already logged-in
- return if Page::Menu::Main.act { has_personal_area? }
+ return if Page::Menu::Main.act { has_personal_area?(wait: 0) }
using_wait_time 0 do
set_initial_password_if_present
@@ -48,12 +53,22 @@ module QA
sign_in_using_gitlab_credentials
end
end
+
+ Page::Menu::Main.act { has_personal_area? }
end
def self.path
'/users/sign_in'
end
+ def switch_to_sign_in_tab
+ click_on 'Sign in'
+ end
+
+ def switch_to_register_tab
+ click_on 'Register'
+ end
+
private
def sign_in_using_ldap_credentials