diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-05-06 16:28:46 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-05-06 16:41:30 -0300 |
commit | cd8a8e0d167393472853212aec77cb6d1cc4f4ff (patch) | |
tree | 801a05b82dce1922de751f2ef664fa703fe2ef14 | |
parent | 50ac4e6d6faf8b4ab17cdcd1ad31e2c7b642f09a (diff) | |
download | gitlab-ce-cd8a8e0d167393472853212aec77cb6d1cc4f4ff.tar.gz |
Add wait_for_vue_resource for MR requests spinach tests
-rw-r--r-- | features/steps/project/merge_requests.rb | 9 | ||||
-rw-r--r-- | features/support/env.rb | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 6766136d2f4..5a1d55fa710 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -8,6 +8,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps include SharedDiffNote include SharedUser include WaitForAjax + include WaitForVueResource after do wait_for_ajax if javascript_test? @@ -50,6 +51,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see closed merge request "Bug NS-04"' do expect(page).to have_content "Bug NS-04" expect(page).to have_content "Closed by" + wait_for_vue_resource end step 'I should see merge request "Bug NS-04"' do @@ -358,6 +360,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see a badge of "1" next to the discussion link' do expect_discussion_badge_to_have_counter("1") + wait_for_vue_resource end step 'I should see a badge of "0" next to the discussion link' do @@ -369,6 +372,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps page.should have_content "#{current_user.name} #{current_user.to_reference} started a discussion on commit" page.should have_content sample_commit.line_code_path page.should have_content "Line is wrong" + wait_for_vue_resource end end @@ -376,6 +380,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps page.within(".notes .discussion") do page.should have_content "#{current_user.name} #{current_user.to_reference} started a discussion on commit" page.should have_content "One comment to rule them all" + wait_for_vue_resource end end @@ -401,6 +406,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see merged request' do page.within '.status-box' do expect(page).to have_content "Merged" + wait_for_vue_resource end end @@ -435,6 +441,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see a comment like "Line is wrong" in the third file' do page.within '.files>div:nth-child(3) .note-body > .note-text' do expect(page).to have_visible_content "Line is wrong" + wait_for_vue_resource end end @@ -502,6 +509,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see comments on the side-by-side diff page' do page.within '.files>div:nth-child(2) .parallel .note-body > .note-text' do expect(page).to have_visible_content "Line is correct" + wait_for_vue_resource end end @@ -562,6 +570,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should not see the diverged commits count' do page.within ".mr-source-target" do expect(page).not_to have_content /([0-9]+ commit[s]? behind)/ + wait_for_vue_resource end end diff --git a/features/support/env.rb b/features/support/env.rb index 92d13bea4b6..568eeae4479 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -10,7 +10,7 @@ if ENV['CI'] Knapsack::Adapters::SpinachAdapter.bind end -%w(select2_helper test_env repo_helpers wait_for_ajax wait_for_requests sidekiq).each do |f| +%w(select2_helper test_env repo_helpers wait_for_ajax wait_for_requests sidekiq wait_for_vue_resource).each do |f| require Rails.root.join('spec', 'support', f) end |