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 @@
- if create_group_project || create_group_subgroup
%li.dropdown-bold-header This group
- if create_group_project
%li
%li.header-new-group-project
= link_to 'New project', new_project_path(namespace_id: @group.id)
- if create_group_subgroup
%li
......@@ -31,7 +31,7 @@
%li
= link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project)
- if create_project_snippet
%li
%li.header-new-project-snippet
= link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project)
%li.divider
%li.dropdown-bold-header GitLab
......
@explore
Feature: New Menu
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 visit dashboard page
......@@ -38,5 +39,17 @@ Background:
@javascript
Scenario: I should see New Project Snippet 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
@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
include SharedProject
step 'I click "New project" in top right menu' do
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 "New project"
end
click_topmenuitem("New project")
end
step 'I click "New group" in top right menu' do
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 "New group"
end
click_topmenuitem("New group")
end
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
find('.header-new-dropdown-toggle').trigger('click')
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
step 'I click "New issue" in top right menu' do
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 "New issue"
end
click_topmenuitem("New issue")
end
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
find('.header-new-dropdown-toggle').trigger('click')
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
......@@ -68,4 +68,12 @@ class Spinach::Features::NewMenu < Spinach::FeatureSteps
expect(page).to have_content('Source branch')
expect(page).to have_content('Target branch')
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
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