diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 17:29:39 +0200 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 17:29:39 +0200 |
commit | beb41aac383dbe525403b418841c55fbb13d7440 (patch) | |
tree | 8dd3d99edc715dc3a5a75908b563b9ca0fcb456d /features | |
parent | 4871cb7aeed1939fb54563633ffee60e4c1eb46b (diff) | |
download | gitlab-ce-beb41aac383dbe525403b418841c55fbb13d7440.tar.gz |
Added additional classes for easier identifaction during tests
Greenfield Tests for Dropdown Menu finished
Diffstat (limited to 'features')
-rw-r--r-- | features/explore/new_menu.feature | 17 | ||||
-rw-r--r-- | features/steps/explore/new_menu.rb | 42 |
2 files changed, 40 insertions, 19 deletions
diff --git a/features/explore/new_menu.feature b/features/explore/new_menu.feature index 9eddc8de132..b920a319b80 100644 --- a/features/explore/new_menu.feature +++ b/features/explore/new_menu.feature @@ -1,7 +1,8 @@ @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 diff --git a/features/steps/explore/new_menu.rb b/features/steps/explore/new_menu.rb index a480a4705e0..bcb6e1eb708 100644 --- a/features/steps/explore/new_menu.rb +++ b/features/steps/explore/new_menu.rb @@ -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 |