diff options
Diffstat (limited to 'features/steps')
-rw-r--r-- | features/steps/profile/notifications.rb | 2 | ||||
-rw-r--r-- | features/steps/project/commits/branches.rb | 7 | ||||
-rw-r--r-- | features/steps/project/issues/labels.rb | 2 | ||||
-rw-r--r-- | features/steps/project/issues/milestones.rb | 3 | ||||
-rw-r--r-- | features/steps/project/merge_requests.rb | 19 | ||||
-rw-r--r-- | features/steps/shared/diff_note.rb | 9 | ||||
-rw-r--r-- | features/steps/shared/note.rb | 2 |
7 files changed, 21 insertions, 23 deletions
diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb index 7e339443b75..f8eb0f01de8 100644 --- a/features/steps/profile/notifications.rb +++ b/features/steps/profile/notifications.rb @@ -11,7 +11,7 @@ class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps end step 'I select Mention setting from dropdown' do - first(:link, "On mention").trigger('click') + first(:link, "On mention").click end step 'I should see Notification saved message' do diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb index ccaf3237815..6d019a38fe1 100644 --- a/features/steps/project/commits/branches.rb +++ b/features/steps/project/commits/branches.rb @@ -70,17 +70,16 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps step "I click branch 'improve/awesome' delete link" do page.within '.js-branch-improve\/awesome' do - find('.btn-remove').click - sleep 0.05 + accept_alert { find('.btn-remove').click } end end step "I should not see branch 'improve/awesome'" do - expect(page.all(visible: true)).not_to have_content 'improve/awesome' + expect(page).to have_css('.js-branch-improve\\/awesome', visible: :hidden) end def select_branch(branch_name) - click_button 'master' + find('.git-revision-dropdown-toggle').click page.within '#new-branch-form .dropdown-menu' do click_link branch_name diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index dac18c537ac..196e0fff63a 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -16,7 +16,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I delete all labels' do page.within '.labels' do page.all('.remove-row').each do - first('.remove-row').click + accept_confirm { first('.remove-row').click } end end end diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb index 16a2d4a6f93..33a24e8913a 100644 --- a/features/steps/project/issues/milestones.rb +++ b/features/steps/project/issues/milestones.rb @@ -3,6 +3,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps include SharedProject include SharedPaths include SharedMarkdown + include CapybaraHelpers step 'I should see milestone "v2.2"' do milestone = @project.milestones.find_by(title: "v2.2") @@ -65,7 +66,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps end step 'I click link to remove milestone' do - click_link 'Delete' + confirm_modal_if_present { click_link 'Delete' } end step 'I should see no milestones' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index dde918e3d41..3b4a8edf976 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -1,4 +1,5 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps + include Select2Helper include SharedAuthentication include SharedIssuable include SharedProject @@ -34,7 +35,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "Merged"' do - find('#state-merged').trigger('click') + find('#state-merged').click end step 'I click link "Closed"' do @@ -327,13 +328,13 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps find('.more-actions').click find('.more-actions .dropdown-menu li', match: :first) - find('.js-note-delete').click + accept_confirm { find('.js-note-delete').click } end end step 'I click on the Discussion tab' do page.within '.merge-request-tabs' do - find('.notes-tab').trigger('click') + find('.notes-tab').click end # Waits for load @@ -353,8 +354,6 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see a discussion by user "John Doe" has started on diff' do - # Trigger a refresh of notes - execute_script("$(document).trigger('visibilitychange');") wait_for_requests page.within(".notes .discussion") do page.should have_content "#{user_exists("John Doe").name} #{user_exists("John Doe").to_reference} started a discussion" @@ -417,7 +416,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "Reopen"' do - first(:css, '.reopen-mr-link').trigger('click') + all(:css, '.reopen-mr-link').last.click end step 'I should see reopened merge request "Bug NS-04"' do @@ -429,13 +428,13 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I click link "Hide inline discussion" of the third file' do page.within '.files>div:nth-child(3)' do - find('.js-toggle-diff-comments').trigger('click') + find('.js-toggle-diff-comments').click end end step 'I click link "Show inline discussion" of the third file' do page.within '.files>div:nth-child(3)' do - find('.js-toggle-diff-comments').trigger('click') + find('.js-toggle-diff-comments').click end end @@ -507,7 +506,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click Side-by-side Diff tab' do - find('a', text: 'Side-by-side').trigger('click') + find('a', text: 'Side-by-side').click # Waits for load expect(page).to have_css('.parallel') @@ -533,7 +532,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I select a new target branch' do - select "feature", from: "merge_request_target_branch" + capybara_select2('feature_conflict') click_button 'Save' end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index c872bd6f861..aa32528a7ca 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -215,7 +215,7 @@ module SharedDiffNote end step 'I click side-by-side diff button' do - find('#parallel-diff-btn').trigger('click') + find('#parallel-diff-btn').click end step 'I see side-by-side diff button' do @@ -227,12 +227,11 @@ module SharedDiffNote end def click_diff_line(code) - find(".line_holder[id='#{code}'] td:nth-of-type(1)").trigger 'mouseover' - find(".line_holder[id='#{code}'] button").trigger 'click' + find(".line_holder[id='#{code}'] button").click end def click_parallel_diff_line(code, line_type) - find(".line_holder.parallel td[id='#{code}']").find(:xpath, 'preceding-sibling::*[1][self::td]').trigger 'mouseover' - find(".line_holder.parallel button[data-line-code='#{code}']").trigger 'click' + find(".line_holder.parallel td[id='#{code}']").find(:xpath, 'preceding-sibling::*[1][self::td]').hover + find(".line_holder.parallel button[data-line-code='#{code}']").click end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 0cd7b506a95..95f0cd2156e 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -14,7 +14,7 @@ module SharedNote find('.more-actions').click find('.more-actions .dropdown-menu li', match: :first) - find(".js-note-delete").click + accept_confirm { find(".js-note-delete").click } end end |