diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-09 13:51:07 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-01-09 13:51:07 +0100 |
commit | 8c22c65425a56525b80a6a998e40ce07946ff96f (patch) | |
tree | 7ce20aed925048635166c7d3fc29a4089c52a0bc /qa/qa | |
parent | dee047aaca8e668a195194163e2b8841bf5dc647 (diff) | |
download | gitlab-ce-8c22c65425a56525b80a6a998e40ce07946ff96f.tar.gz |
Add QA page views / elements couling with the menu
Diffstat (limited to 'qa/qa')
-rw-r--r-- | qa/qa/page/base.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/main/oauth.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/menu/main.rb | 31 |
3 files changed, 32 insertions, 7 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index c60e9bfd40a..d1641565bad 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -40,6 +40,10 @@ module QA page.within(selector) { yield } if block_given? end + def click_element(name) + find("qa-#{name.tr('_', '-')}").click + end + def self.path raise NotImplementedError end diff --git a/qa/qa/page/main/oauth.rb b/qa/qa/page/main/oauth.rb index e746cff0a80..6f548148363 100644 --- a/qa/qa/page/main/oauth.rb +++ b/qa/qa/page/main/oauth.rb @@ -2,6 +2,10 @@ module QA module Page module Main class OAuth < Page::Base + view 'app/views/doorkeeper/authorizations/new.html.haml' do + element :authorization_button, 'submit_tag "Authorize"' + end + def needs_authorization? page.current_url.include?('/oauth') end diff --git a/qa/qa/page/menu/main.rb b/qa/qa/page/menu/main.rb index b94c2c6c23d..36172151969 100644 --- a/qa/qa/page/menu/main.rb +++ b/qa/qa/page/menu/main.rb @@ -2,19 +2,36 @@ module QA module Page module Menu class Main < Page::Base + view 'app/views/layouts/header/_default.html.haml' do + element :navbar + element :user_avatar + element :user_menu, '.dropdown-menu-nav' + element :user_sign_out_link, 'link_to "Sign out"' + end + + view 'app/views/layouts/nav/_dashboard.html.haml' do + element :admin_area_link + element :projects_dropdown + element :groups_link + end + + view 'app/views/dashboard/_projects_head.html.haml' do + element :your_projects_link + end + def go_to_groups - within_top_menu { click_link 'Groups' } + within_top_menu { click_element :groups_link } end def go_to_projects within_top_menu do - click_link 'Projects' - click_link 'Your projects' + click_element :projects_dropdown + click_element :your_projects_link end end def go_to_admin_area - within_top_menu { find('.admin-icon').click } + within_top_menu { click_element :admin_area_link } end def sign_out @@ -24,20 +41,20 @@ module QA end def has_personal_area? - page.has_selector?('.header-user-dropdown-toggle') + page.has_selector?('.qa-user-avatar') end private def within_top_menu - page.within('.navbar') do + page.within('.qa-navbar') do yield end end def within_user_menu within_top_menu do - find('.header-user-dropdown-toggle').click + click_element :user_avatar page.within('.dropdown-menu-nav') do yield |