diff options
author | Rémy Coutable <remy@rymai.me> | 2017-11-08 19:10:47 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-11-10 16:06:29 +0100 |
commit | 49d17e78ceb0656c40cb565a5f605b25d4286d42 (patch) | |
tree | 01f74e1fd15ac08f2430f923422d921f21a17a31 /qa/qa/page | |
parent | 65faebb95556809c5858347f1c24422505056827 (diff) | |
download | gitlab-ce-49d17e78ceb0656c40cb565a5f605b25d4286d42.tar.gz |
Change Page::Main::Entry to only visit an entrypoint and introduce Page::Main::Login to handle actual log-in
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'qa/qa/page')
-rw-r--r-- | qa/qa/page/main/entry.rb | 21 | ||||
-rw-r--r-- | qa/qa/page/main/login.rb | 19 |
2 files changed, 26 insertions, 14 deletions
diff --git a/qa/qa/page/main/entry.rb b/qa/qa/page/main/entry.rb index fa1cad62741..ac939732b1d 100644 --- a/qa/qa/page/main/entry.rb +++ b/qa/qa/page/main/entry.rb @@ -2,9 +2,14 @@ module QA module Page module Main class Entry < Page::Base - def initialize - visit(Runtime::Scenario.gitlab_address) + def visit_login_page + visit("#{Runtime::Scenario.gitlab_address}/users/sign_in") + wait_for_instance_to_be_ready + end + + private + def wait_for_instance_to_be_ready # This resolves cold boot / background tasks problems # start = Time.now @@ -14,18 +19,6 @@ module QA refresh end end - - def sign_in_using_credentials - if 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' - end - - fill_in :user_login, with: Runtime::User.name - fill_in :user_password, with: Runtime::User.password - click_button 'Sign in' - end end end end diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb new file mode 100644 index 00000000000..8b0111a78a2 --- /dev/null +++ b/qa/qa/page/main/login.rb @@ -0,0 +1,19 @@ +module QA + module Page + module Main + class Login < Page::Base + def sign_in_using_credentials + if 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' + end + + fill_in :user_login, with: Runtime::User.name + fill_in :user_password, with: Runtime::User.password + click_button 'Sign in' + end + end + end + end +end |