Commit beb41aac authored by Tim Zallmann's avatar Tim Zallmann

Added additional classes for easier identifaction during tests

Greenfield Tests for Dropdown Menu finished
parent 4871cb7a
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- if create_group_project || create_group_subgroup - if create_group_project || create_group_subgroup
%li.dropdown-bold-header This group %li.dropdown-bold-header This group
- if create_group_project - if create_group_project
%li %li.header-new-group-project
= link_to 'New project', new_project_path(namespace_id: @group.id) = link_to 'New project', new_project_path(namespace_id: @group.id)
- if create_group_subgroup - if create_group_subgroup
%li %li
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
%li %li
= link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project) = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project)
- if create_project_snippet - if create_project_snippet
%li %li.header-new-project-snippet
= link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project) = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project)
%li.divider %li.divider
%li.dropdown-bold-header GitLab %li.dropdown-bold-header GitLab
......
@explore @explore
Feature: New Menu Feature: New Menu
Background: Background:
Given I sign in as a user Given I sign in as "John Doe"
And "John Doe" is owner of group "Owned"
And I own project "Shop" And I own project "Shop"
And I visit dashboard page And I visit dashboard page
...@@ -38,5 +39,17 @@ Background: ...@@ -38,5 +39,17 @@ Background:
@javascript @javascript
Scenario: I should see New Project Snippet page Scenario: I should see New Project Snippet page
When I visit project "Shop" page When I visit project "Shop" page
And I click "New snippet" in top right menu And I click "New project snippet" in top right menu
Then I see "New Snippet" page Then I see "New Snippet" page
@javascript
Scenario: I should see New Group Project page
When I visit group "Owned" page
And I click "New group project" in top right menu
Then I see "New Project" page
@javascript
Scenario: I should see New Subgroup page
When I visit group "Owned" page
And I click "New subgroup" in top right menu
Then I see "New Group" page
...@@ -4,42 +4,42 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps ...@@ -4,42 +4,42 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps
include SharedProject include SharedProject
step 'I click "New project" in top right menu' do step 'I click "New project" in top right menu' do
page.within '.header-content' do click_topmenuitem("New project")
find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1)
click_link "New project"
end
end end
step 'I click "New group" in top right menu' do step 'I click "New group" in top right menu' do
page.within '.header-content' do click_topmenuitem("New group")
find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1)
click_link "New group"
end
end end
step 'I click "New snippet" in top right menu' do step 'I click "New snippet" in top right menu' do
click_topmenuitem("New snippet")
end
step 'I click "New project snippet" in top right menu' do
page.within '.header-content' do page.within '.header-content' do
find('.header-new-dropdown-toggle').trigger('click') find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1) expect(page).to have_selector('.header-new.dropdown.open', count: 1)
click_link "New snippet" find('.header-new-project-snippet a').trigger('click')
end end
end end
step 'I click "New issue" in top right menu' do step 'I click "New issue" in top right menu' do
page.within '.header-content' do click_topmenuitem("New issue")
find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1)
click_link "New issue"
end
end end
step 'I click "New merge request" in top right menu' do step 'I click "New merge request" in top right menu' do
click_topmenuitem("New merge request")
end
step 'I click "New subgroup" in top right menu' do
click_topmenuitem("New subgroup")
end
step 'I click "New group project" in top right menu' do
page.within '.header-content' do page.within '.header-content' do
find('.header-new-dropdown-toggle').trigger('click') find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1) expect(page).to have_selector('.header-new.dropdown.open', count: 1)
click_link "New merge request" find('.header-new-group-project a').trigger('click')
end end
end end
...@@ -68,4 +68,12 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps ...@@ -68,4 +68,12 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps
expect(page).to have_content('Source branch') expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch') expect(page).to have_content('Target branch')
end end
def click_topmenuitem(item_name)
page.within '.header-content' do
find('.header-new-dropdown-toggle').trigger('click')
expect(page).to have_selector('.header-new.dropdown.open', count: 1)
click_link item_name
end
end
end end
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