diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 18:29:39 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 18:29:39 +0300 |
commit | beb41aac383dbe525403b418841c55fbb13d7440 (patch) | |
tree | 8dd3d99edc715dc3a5a75908b563b9ca0fcb456d /features/steps | |
parent | 4871cb7aeed1939fb54563633ffee60e4c1eb46b (diff) |
Added additional classes for easier identifaction during tests
Greenfield Tests for Dropdown Menu finished
Diffstat (limited to 'features/steps')
-rw-r--r-- | features/steps/explore/new_menu.rb | 42 |
1 files changed, 25 insertions, 17 deletions
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 |