diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/project/merge_requests.rb | 3 | ||||
-rw-r--r-- | features/steps/project/merge_requests/acceptance.rb | 9 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 263ec321a34..3985fe8f2f7 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -347,6 +347,9 @@ 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_ajax page.within(".notes .discussion") do page.should have_content "#{user_exists("John Doe").name} #{user_exists("John Doe").to_reference} started a discussion" page.should have_content sample_commit.line_code_path diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb index bdc7a616ba9..d7167352e02 100644 --- a/features/steps/project/merge_requests/acceptance.rb +++ b/features/steps/project/merge_requests/acceptance.rb @@ -1,6 +1,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps include LoginHelpers include GitlabRoutingHelper + include WaitForAjax step 'I am on the Merge Request detail page' do visit merge_request_path(@merge_request) @@ -20,10 +21,18 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps step 'I should see the Remove Source Branch button' do expect(page).to have_link('Remove source branch') + + # Wait for AJAX requests to complete so they don't blow up if they are + # only handled after `DatabaseCleaner` has already run + wait_for_ajax end step 'I should not see the Remove Source Branch button' do expect(page).not_to have_link('Remove source branch') + + # Wait for AJAX requests to complete so they don't blow up if they are + # only handled after `DatabaseCleaner` has already run + wait_for_ajax end step 'There is an open Merge Request' do diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 4ee879fe922..15625e045f5 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -97,7 +97,7 @@ module SharedProject step 'I should see project "Shop" activity feed' do project = Project.find_by(name: "Shop") - expect(page).to have_content "pushed new branch fix at #{project.name_with_namespace}" + expect(page).to have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}" end step 'I should see project settings' do @@ -251,7 +251,8 @@ module SharedProject step 'project "Shop" has CI build' do project = Project.find_by(name: "Shop") - create :ci_pipeline, project: project, sha: project.commit.sha, ref: 'master', status: 'skipped' + pipeline = create :ci_pipeline, project: project, sha: project.commit.sha, ref: 'master' + pipeline.skip end step 'I should see last commit with CI status' do |