Commit 7e42bb0d authored by Mark Lapierre's avatar Mark Lapierre

Update test after UI change

Fixes the create snippet test by updating the menu page object to
reflect the changes to the main navbar
parent 257289f3
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets]) - if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
%li.header-more.dropdown %li.header-more.dropdown
%a{ href: "#", data: { toggle: "dropdown" } } %a{ href: "#", data: { toggle: "dropdown", qa_selector: 'more_dropdown' } }
= _('More') = _('More')
= sprite_icon('angle-down', css_class: 'caret-down') = sprite_icon('angle-down', css_class: 'caret-down')
.dropdown-menu .dropdown-menu
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
- if dashboard_nav_link?(:snippets) - if dashboard_nav_link?(:snippets)
= nav_link(controller: 'dashboard/snippets') do = nav_link(controller: 'dashboard/snippets') do
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets qa-snippets-link' do = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', data: { qa_selector: 'snippets_link' } do
= _('Snippets') = _('Snippets')
= render_if_exists 'layouts/nav/sidebar/analytics_more_link' = render_if_exists 'layouts/nav/sidebar/analytics_more_link'
......
...@@ -20,6 +20,7 @@ module QA ...@@ -20,6 +20,7 @@ module QA
element :admin_area_link element :admin_area_link
element :projects_dropdown, required: true element :projects_dropdown, required: true
element :groups_dropdown, required: true element :groups_dropdown, required: true
element :more_dropdown, required: true
element :snippets_link element :snippets_link
end end
...@@ -52,6 +53,13 @@ module QA ...@@ -52,6 +53,13 @@ module QA
end end
end end
def go_to_snippets
within_top_menu do
click_element :more_dropdown
click_element :snippets_link
end
end
def click_admin_area def click_admin_area
within_top_menu { click_element :admin_area_link } within_top_menu { click_element :admin_area_link }
end end
...@@ -80,10 +88,6 @@ module QA ...@@ -80,10 +88,6 @@ module QA
end end
end end
def click_snippets_link
click_element :snippets_link
end
def search_for(term) def search_for(term)
fill_element :search_term_field, "#{term}\n" fill_element :search_term_field, "#{term}\n"
end end
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Runtime::Browser.visit(:gitlab, Page::Main::Login) Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials) Page::Main::Login.perform(&:sign_in_using_credentials)
Page::Main::Menu.perform(&:click_snippets_link) Page::Main::Menu.perform(&:go_to_snippets)
Resource::Snippet.fabricate_via_browser_ui! do |snippet| Resource::Snippet.fabricate_via_browser_ui! do |snippet|
snippet.title = 'Snippet title' snippet.title = 'Snippet title'
......
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