diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 16:39:39 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 16:39:39 +0300 |
commit | 4871cb7aeed1939fb54563633ffee60e4c1eb46b (patch) | |
tree | c7940fff227333c56d2d820c91b695167f10e232 | |
parent | ebd0767fc76c820088efce236a57e36619f08b6d (diff) |
New ... Menu Feature Tests
-rw-r--r-- | features/dashboard/new_project_menu.feature | 11 | ||||
-rw-r--r-- | features/explore/new_menu.feature | 42 | ||||
-rw-r--r-- | features/steps/dashboard/new_project_top_menu.rb | 17 | ||||
-rw-r--r-- | features/steps/explore/new_menu.rb | 71 |
4 files changed, 113 insertions, 28 deletions
diff --git a/features/dashboard/new_project_menu.feature b/features/dashboard/new_project_menu.feature deleted file mode 100644 index 5456c9fd4dd..00000000000 --- a/features/dashboard/new_project_menu.feature +++ /dev/null @@ -1,11 +0,0 @@ -@dashboard -Feature: New Project top menu -Background: - Given I sign in as a user - And I own project "Shop" - And I visit dashboard page - And I click "New project" in top right menu - - @javascript - Scenario: I should see New Projects page - Then I see "New Project" page diff --git a/features/explore/new_menu.feature b/features/explore/new_menu.feature new file mode 100644 index 00000000000..9eddc8de132 --- /dev/null +++ b/features/explore/new_menu.feature @@ -0,0 +1,42 @@ +@explore +Feature: New Menu +Background: + Given I sign in as a user + And I own project "Shop" + And I visit dashboard page + + @javascript + Scenario: I should see New Projects page + When I visit dashboard page + And I click "New project" in top right menu + Then I see "New Project" page + + @javascript + Scenario: I should see New Group page + When I visit dashboard page + And I click "New group" in top right menu + Then I see "New Group" page + + @javascript + Scenario: I should see New Snippet page + When I visit dashboard page + And I click "New snippet" in top right menu + Then I see "New Snippet" page + + @javascript + Scenario: I should see New Issue page + When I visit project "Shop" page + And I click "New issue" in top right menu + Then I see "New Issue" page + + @javascript + Scenario: I should see New Merge Request page + When I visit project "Shop" page + And I click "New merge request" in top right menu + Then I see "New Merge Request" page + + @javascript + Scenario: I should see New Project Snippet page + When I visit project "Shop" page + And I click "New snippet" in top right menu + Then I see "New Snippet" page diff --git a/features/steps/dashboard/new_project_top_menu.rb b/features/steps/dashboard/new_project_top_menu.rb deleted file mode 100644 index 364be964efd..00000000000 --- a/features/steps/dashboard/new_project_top_menu.rb +++ /dev/null @@ -1,17 +0,0 @@ -class Spinach::Features::NewProjectTopMenu < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click "New project" in top right menu' do - page.within '.header-content' do - click_link "New project" - end - end - - step 'I see "New Project" page' do - expect(page).to have_content('Project path') - expect(page).to have_content('Project name') - end - -end diff --git a/features/steps/explore/new_menu.rb b/features/steps/explore/new_menu.rb new file mode 100644 index 00000000000..a480a4705e0 --- /dev/null +++ b/features/steps/explore/new_menu.rb @@ -0,0 +1,71 @@ +class Spinach::Features::NewMenu < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + 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 + 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 + end + + step 'I click "New 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" + 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 + end + + step 'I click "New merge request" 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" + end + end + + step 'I see "New Project" page' do + expect(page).to have_content('Project path') + expect(page).to have_content('Project name') + end + + step 'I see "New Group" page' do + expect(page).to have_content('Group path') + expect(page).to have_content('Group name') + end + + step 'I see "New Snippet" page' do + expect(page).to have_content('New Snippet') + expect(page).to have_content('Title') + end + + step 'I see "New Issue" page' do + expect(page).to have_content('New Issue') + expect(page).to have_content('Title') + end + + step 'I see "New Merge Request" page' do + expect(page).to have_content('New Merge Request') + expect(page).to have_content('Source branch') + expect(page).to have_content('Target branch') + end +end |