Commit 0aa1d715 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'wait-for-ajax-handling-all-js-requests-ee' into 'master'

Use wait_for_requests for checking Vue resource and $.ajax requests [EE]

See merge request !1923
parents e6d8c547 1c42b35b
...@@ -4,7 +4,7 @@ import VueResource from 'vue-resource'; ...@@ -4,7 +4,7 @@ import VueResource from 'vue-resource';
Vue.use(VueResource); Vue.use(VueResource);
// Maintain a global counter for active requests // Maintain a global counter for active requests
// see: spec/support/wait_for_vue_resource.rb // see: spec/support/wait_for_requests.rb
Vue.http.interceptors.push((request, next) => { Vue.http.interceptors.push((request, next) => {
window.activeVueResources = window.activeVueResources || 0; window.activeVueResources = window.activeVueResources || 0;
window.activeVueResources += 1; window.activeVueResources += 1;
......
---
title: Use wait_for_requests for both ajax and Vue requests
merge_request:
author:
class Spinach::Features::EventFilters < Spinach::FeatureSteps class Spinach::Features::EventFilters < Spinach::FeatureSteps
include WaitForAjax include WaitForRequests
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedProject include SharedProject
...@@ -73,20 +73,20 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps ...@@ -73,20 +73,20 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
end end
When 'I click "push" event filter' do When 'I click "push" event filter' do
wait_for_ajax wait_for_requests
click_link("Push events") click_link("Push events")
wait_for_ajax wait_for_requests
end end
When 'I click "team" event filter' do When 'I click "team" event filter' do
wait_for_ajax wait_for_requests
click_link("Team") click_link("Team")
wait_for_ajax wait_for_requests
end end
When 'I click "merge" event filter' do When 'I click "merge" event filter' do
wait_for_ajax wait_for_requests
click_link("Merge events") click_link("Merge events")
wait_for_ajax wait_for_requests
end end
end end
...@@ -3,7 +3,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps ...@@ -3,7 +3,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
include SharedPaths include SharedPaths
include SharedProject include SharedProject
include SharedUser include SharedUser
include WaitForAjax include WaitForRequests
step '"John Doe" is a developer of project "Shop"' do step '"John Doe" is a developer of project "Shop"' do
project.team << [john_doe, :developer] project.team << [john_doe, :developer]
...@@ -140,7 +140,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps ...@@ -140,7 +140,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps
step 'I should be directed to the corresponding page' do step 'I should be directed to the corresponding page' do
page.should have_css('.identifier', text: 'Merge Request !1') page.should have_css('.identifier', text: 'Merge Request !1')
# Merge request page loads and issues a number of Ajax requests # Merge request page loads and issues a number of Ajax requests
wait_for_ajax wait_for_requests
end end
def should_see_todo(position, title, body, state: :pending) def should_see_todo(position, title, body, state: :pending)
......
class Spinach::Features::GroupMembers < Spinach::FeatureSteps class Spinach::Features::GroupMembers < Spinach::FeatureSteps
include WaitForAjax include WaitForRequests
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedGroup include SharedGroup
...@@ -58,7 +58,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps ...@@ -58,7 +58,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps
click_link 'Developer' click_link 'Developer'
end end
wait_for_ajax wait_for_requests
end end
end end
......
class Spinach::Features::GroupMilestones < Spinach::FeatureSteps class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
include WaitForAjax include WaitForRequests
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedGroup include SharedGroup
...@@ -91,7 +91,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps ...@@ -91,7 +91,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end end
step 'I should see the list of labels' do step 'I should see the list of labels' do
wait_for_ajax wait_for_requests
page.within('#tab-labels') do page.within('#tab-labels') do
expect(page).to have_content 'bug' expect(page).to have_content 'bug'
......
...@@ -3,7 +3,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps ...@@ -3,7 +3,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedBuilds include SharedBuilds
include RepoHelpers include RepoHelpers
include WaitForAjax include WaitForRequests
step 'I click artifacts download button' do step 'I click artifacts download button' do
click_link 'Download' click_link 'Download'
...@@ -79,7 +79,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps ...@@ -79,7 +79,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
step 'I click a link to file within build artifacts' do step 'I click a link to file within build artifacts' do
page.within('.tree-table') { find_link('ci_artifacts.txt').click } page.within('.tree-table') { find_link('ci_artifacts.txt').click }
wait_for_ajax wait_for_requests
end end
step 'I see a download link' do step 'I see a download link' do
......
...@@ -7,8 +7,7 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps ...@@ -7,8 +7,7 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
include SharedMarkdown include SharedMarkdown
include SharedDiffNote include SharedDiffNote
include SharedUser include SharedUser
include WaitForAjax include WaitForRequests
include WaitForVueResource
step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do
create(:merge_request_with_diffs, create(:merge_request_with_diffs,
...@@ -40,7 +39,7 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps ...@@ -40,7 +39,7 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
step 'I should see merged request' do step 'I should see merged request' do
page.within '.status-box' do page.within '.status-box' do
expect(page).to have_content "Merged" expect(page).to have_content "Merged"
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -76,7 +75,6 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps ...@@ -76,7 +75,6 @@ class Spinach::Features::ProjectFfMergeRequests < Spinach::FeatureSteps
step 'I press rebase button' do step 'I press rebase button' do
click_button "Rebase" click_button "Rebase"
wait_for_ajax
end end
step "I should see rebase in progress message" do step "I should see rebase in progress message" do
......
...@@ -4,8 +4,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -4,8 +4,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
include SharedNote include SharedNote
include SharedPaths include SharedPaths
include Select2Helper include Select2Helper
include WaitForVueResource include WaitForRequests
include WaitForAjax
step 'I am a member of project "Shop"' do step 'I am a member of project "Shop"' do
@project = ::Project.find_by(name: "Shop") @project = ::Project.find_by(name: "Shop")
...@@ -34,7 +33,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -34,7 +33,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
expect(page).to have_content @merge_request.source_branch expect(page).to have_content @merge_request.source_branch
expect(page).to have_content @merge_request.target_branch expect(page).to have_content @merge_request.target_branch
wait_for_vue_resource wait_for_requests
end end
step 'I fill out a "Merge Request On Forked Project" merge request' do step 'I fill out a "Merge Request On Forked Project" merge request' do
...@@ -48,7 +47,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps ...@@ -48,7 +47,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
first('.dropdown-target-project a', text: @project.path_with_namespace) first('.dropdown-target-project a', text: @project.path_with_namespace)
first('.js-source-branch').click first('.js-source-branch').click
wait_for_ajax wait_for_requests
first('.dropdown-source-branch .dropdown-content a', text: 'fix').click first('.dropdown-source-branch .dropdown-content a', text: 'fix').click
click_button "Compare branches and continue" click_button "Compare branches and continue"
......
...@@ -7,11 +7,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -7,11 +7,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
include SharedMarkdown include SharedMarkdown
include SharedDiffNote include SharedDiffNote
include SharedUser include SharedUser
include WaitForAjax include WaitForRequests
include WaitForVueResource
after do after do
wait_for_ajax if javascript_test? wait_for_requests if javascript_test?
end end
step 'I click link "New Merge Request"' do step 'I click link "New Merge Request"' do
...@@ -46,23 +45,23 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -46,23 +45,23 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
page.within '.merge-request' do page.within '.merge-request' do
expect(page).to have_content "Wiki Feature" expect(page).to have_content "Wiki Feature"
end end
wait_for_vue_resource wait_for_requests
end end
step 'I should see closed merge request "Bug NS-04"' do step 'I should see closed merge request "Bug NS-04"' do
expect(page).to have_content "Bug NS-04" expect(page).to have_content "Bug NS-04"
expect(page).to have_content "Closed by" expect(page).to have_content "Closed by"
wait_for_vue_resource wait_for_requests
end end
step 'I should see merge request "Bug NS-04"' do step 'I should see merge request "Bug NS-04"' do
expect(page).to have_content "Bug NS-04" expect(page).to have_content "Bug NS-04"
wait_for_vue_resource wait_for_requests
end end
step 'I should see merge request "Feature NS-05"' do step 'I should see merge request "Feature NS-05"' do
expect(page).to have_content "Feature NS-05" expect(page).to have_content "Feature NS-05"
wait_for_vue_resource wait_for_requests
end end
step 'I should not see "master" branch' do step 'I should not see "master" branch' do
...@@ -99,7 +98,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -99,7 +98,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I click button "Unsubscribe"' do step 'I click button "Unsubscribe"' do
click_on "Unsubscribe" click_on "Unsubscribe"
wait_for_ajax wait_for_requests
end end
step 'I click link "Close"' do step 'I click link "Close"' do
...@@ -353,7 +352,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -353,7 +352,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see a discussion by user "John Doe" has started on diff' do step 'I should see a discussion by user "John Doe" has started on diff' do
# Trigger a refresh of notes # Trigger a refresh of notes
execute_script("$(document).trigger('visibilitychange');") execute_script("$(document).trigger('visibilitychange');")
wait_for_ajax wait_for_requests
page.within(".notes .discussion") do 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 "#{user_exists("John Doe").name} #{user_exists("John Doe").to_reference} started a discussion"
page.should have_content sample_commit.line_code_path page.should have_content sample_commit.line_code_path
...@@ -363,12 +362,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -363,12 +362,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see a badge of "1" next to the discussion link' do step 'I should see a badge of "1" next to the discussion link' do
expect_discussion_badge_to_have_counter("1") expect_discussion_badge_to_have_counter("1")
wait_for_vue_resource wait_for_requests
end end
step 'I should see a badge of "0" next to the discussion link' do step 'I should see a badge of "0" next to the discussion link' do
expect_discussion_badge_to_have_counter("0") expect_discussion_badge_to_have_counter("0")
wait_for_vue_resource wait_for_requests
end end
step 'I should see a discussion has started on commit diff' do step 'I should see a discussion has started on commit diff' do
...@@ -376,7 +375,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -376,7 +375,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 "#{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 sample_commit.line_code_path
page.should have_content "Line is wrong" page.should have_content "Line is wrong"
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -384,7 +383,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -384,7 +383,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
page.within(".notes .discussion") do 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 "#{current_user.name} #{current_user.to_reference} started a discussion on commit"
page.should have_content "One comment to rule them all" page.should have_content "One comment to rule them all"
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -410,7 +409,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -410,7 +409,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see merged request' do step 'I should see merged request' do
page.within '.status-box' do page.within '.status-box' do
expect(page).to have_content "Merged" expect(page).to have_content "Merged"
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -422,7 +421,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -422,7 +421,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
page.within '.status-box' do page.within '.status-box' do
expect(page).to have_content "Open" expect(page).to have_content "Open"
end end
wait_for_vue_resource wait_for_requests
end end
step 'I click link "Hide inline discussion" of the third file' do step 'I click link "Hide inline discussion" of the third file' do
...@@ -446,7 +445,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -446,7 +445,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see a comment like "Line is wrong" in the third file' do 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 page.within '.files>div:nth-child(3) .note-body > .note-text' do
expect(page).to have_visible_content "Line is wrong" expect(page).to have_visible_content "Line is wrong"
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -470,7 +469,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -470,7 +469,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
page.within ".files>div:nth-child(2) .note-body > .note-text" do page.within ".files>div:nth-child(2) .note-body > .note-text" do
expect(page).to have_content "Line is correct" expect(page).to have_content "Line is correct"
...@@ -485,7 +484,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -485,7 +484,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
end end
step 'I should still see a comment like "Line is correct" in the second file' do step 'I should still see a comment like "Line is correct" in the second file' do
...@@ -534,7 +533,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -534,7 +533,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see comments on the side-by-side diff page' do 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 page.within '.files>div:nth-child(2) .parallel .note-body > .note-text' do
expect(page).to have_visible_content "Line is correct" expect(page).to have_visible_content "Line is correct"
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -558,7 +557,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -558,7 +557,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see new target branch changes' do step 'I should see new target branch changes' do
expect(page).to have_content 'Request to merge fix into feature' expect(page).to have_content 'Request to merge fix into feature'
expect(page).to have_content 'changed target branch from merge-test to feature' expect(page).to have_content 'changed target branch from merge-test to feature'
wait_for_ajax wait_for_requests
end end
step 'project settings contain list of approvers' do step 'project settings contain list of approvers' do
...@@ -626,7 +625,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -626,7 +625,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I click link "Approve"' do step 'I click link "Approve"' do
page.within '.mr-state-widget' do page.within '.mr-state-widget' do
wait_for_ajax wait_for_requests
click_button 'Approve' click_button 'Approve'
end end
end end
...@@ -648,7 +647,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -648,7 +647,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect(page).not_to have_button("Approve") expect(page).not_to have_button("Approve")
end end
wait_for_vue_resource wait_for_requests
end end
step 'I should see approved merge request "Bug NS-04"' do step 'I should see approved merge request "Bug NS-04"' do
...@@ -656,7 +655,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -656,7 +655,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect(page).to have_button('Merge', disabled: false) expect(page).to have_button('Merge', disabled: false)
end end
wait_for_vue_resource wait_for_requests
end end
step 'I should see message that merge request can be merged' do step 'I should see message that merge request can be merged' do
...@@ -674,7 +673,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -674,7 +673,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
step 'I should see message that MR require an approval' do step 'I should see message that MR require an approval' do
page.within '.mr-state-widget' do page.within '.mr-state-widget' do
expect(page).to have_content("Requires 1 more approval") expect(page).to have_content("Requires 1 more approval")
wait_for_vue_resource wait_for_requests
end end
end end
...@@ -718,16 +717,16 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -718,16 +717,16 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
expect(page).to have_content /([0-9]+ commits behind)/ expect(page).to have_content /([0-9]+ commits behind)/
end end
wait_for_vue_resource wait_for_requests
end end
step 'I should not see the diverged commits count' do step 'I should not see the diverged commits count' do
page.within ".mr-source-target" do page.within ".mr-source-target" do
expect(page).not_to have_content /([0-9]+ commit[s]? behind)/ expect(page).not_to have_content /([0-9]+ commit[s]? behind)/
wait_for_vue_resource wait_for_requests
end end
wait_for_vue_resource wait_for_requests
end end
def merge_request def merge_request
...@@ -744,7 +743,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -744,7 +743,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
page.within(".notes_holder", visible: true) do page.within(".notes_holder", visible: true) do
expect(page).to have_content message expect(page).to have_content message
......
class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
include LoginHelpers include LoginHelpers
include GitlabRoutingHelper include GitlabRoutingHelper
include WaitForVueResource include WaitForRequests
step 'I am on the Merge Request detail page' do step 'I am on the Merge Request detail page' do
visit merge_request_path(@merge_request) visit merge_request_path(@merge_request)
...@@ -24,7 +24,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps ...@@ -24,7 +24,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
# Wait for View Resource requests to complete so they don't blow up if they are # Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run # only handled after `DatabaseCleaner` has already run
wait_for_vue_resource wait_for_requests
end end
step 'I should not see the Remove Source Branch button' do step 'I should not see the Remove Source Branch button' do
...@@ -32,7 +32,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps ...@@ -32,7 +32,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
# Wait for View Resource requests to complete so they don't blow up if they are # Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run # only handled after `DatabaseCleaner` has already run
wait_for_vue_resource wait_for_requests
end end
step 'There is an open Merge Request' do step 'There is an open Merge Request' do
......
class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
include LoginHelpers include LoginHelpers
include GitlabRoutingHelper include GitlabRoutingHelper
include WaitForVueResource include WaitForRequests
step 'I click on the revert button' do step 'I click on the revert button' do
find("a[href='#modal-revert-commit']").click find("a[href='#modal-revert-commit']").click
...@@ -16,7 +16,7 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps ...@@ -16,7 +16,7 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
step 'I should see the revert merge request notice' do step 'I should see the revert merge request notice' do
page.should have_content('The merge request has been successfully reverted.') page.should have_content('The merge request has been successfully reverted.')
wait_for_vue_resource wait_for_requests
end end
step 'I should not see the revert button' do step 'I should not see the revert button' do
......
...@@ -3,7 +3,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -3,7 +3,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedPaths include SharedPaths
include Select2Helper include Select2Helper
include WaitForAjax include WaitForRequests
step 'change project settings' do step 'change project settings' do
fill_in 'project_name_edit', with: 'NewName' fill_in 'project_name_edit', with: 'NewName'
...@@ -110,7 +110,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -110,7 +110,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end end
step 'I should see project "Shop" README' do step 'I should see project "Shop" README' do
wait_for_ajax wait_for_requests
page.within('.readme-holder') do page.within('.readme-holder') do
expect(page).to have_content 'testme' expect(page).to have_content 'testme'
end end
......
...@@ -2,7 +2,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps ...@@ -2,7 +2,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps
include SharedAuthentication include SharedAuthentication
include SharedProject include SharedProject
include SharedPaths include SharedPaths
include WaitForAjax include WaitForRequests
step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do
project = Project.find_by(name: "Shop") project = Project.find_by(name: "Shop")
...@@ -35,7 +35,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps ...@@ -35,7 +35,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps
end end
step 'I should see the labels "bug", "enhancement" and "feature"' do step 'I should see the labels "bug", "enhancement" and "feature"' do
wait_for_ajax wait_for_requests
page.within('#tab-issues') do page.within('#tab-issues') do
expect(page).to have_content 'bug' expect(page).to have_content 'bug'
......
...@@ -3,7 +3,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps ...@@ -3,7 +3,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedNote include SharedNote
include SharedPaths include SharedPaths
include WaitForAjax include WaitForRequests
step 'project "Shop" have "Snippet one" snippet' do step 'project "Shop" have "Snippet one" snippet' do
create(:project_snippet, create(:project_snippet,
...@@ -59,7 +59,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps ...@@ -59,7 +59,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
find('.ace_editor').native.send_keys 'Content of snippet three' find('.ace_editor').native.send_keys 'Content of snippet three'
end end
click_button "Create snippet" click_button "Create snippet"
wait_for_ajax wait_for_requests
end end
step 'I should see snippet "Snippet three"' do step 'I should see snippet "Snippet three"' do
...@@ -81,7 +81,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps ...@@ -81,7 +81,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
fill_in "note_note", with: "Good snippet!" fill_in "note_note", with: "Good snippet!"
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
end end
step 'I should see comment "Good snippet!"' do step 'I should see comment "Good snippet!"' do
......
...@@ -4,7 +4,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -4,7 +4,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
include SharedProject include SharedProject
include SharedPaths include SharedPaths
include RepoHelpers include RepoHelpers
include WaitForAjax include WaitForRequests
step "I don't have write access" do step "I don't have write access" do
@project = create(:project, :repository, name: "Other Project", path: "other-project") @project = create(:project, :repository, name: "Other Project", path: "other-project")
...@@ -37,12 +37,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -37,12 +37,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end end
step 'I should see its content' do step 'I should see its content' do
wait_for_ajax wait_for_requests
expect(page).to have_content old_gitignore_content expect(page).to have_content old_gitignore_content
end end
step 'I should see its new content' do step 'I should see its new content' do
wait_for_ajax wait_for_requests
expect(page).to have_content new_gitignore_content expect(page).to have_content new_gitignore_content
end end
......
...@@ -5,7 +5,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -5,7 +5,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
include SharedAuthentication include SharedAuthentication
include SharedPaths include SharedPaths
include SharedMarkdown include SharedMarkdown
include WaitForAjax include WaitForRequests
step 'I own project "Delta"' do step 'I own project "Delta"' do
@project = ::Project.find_by(name: "Delta") @project = ::Project.find_by(name: "Delta")
...@@ -35,7 +35,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -35,7 +35,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I should see correct document rendered' do step 'I should see correct document rendered' do
expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
wait_for_ajax wait_for_requests
expect(page).to have_content "All API requests require authentication" expect(page).to have_content "All API requests require authentication"
end end
...@@ -65,7 +65,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -65,7 +65,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I should see correct maintenance file rendered' do step 'I should see correct maintenance file rendered' do
expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md")
wait_for_ajax wait_for_requests
expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
end end
...@@ -97,7 +97,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -97,7 +97,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I see correct file rendered' do step 'I see correct file rendered' do
expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
wait_for_ajax wait_for_requests
expect(page).to have_content "Contents" expect(page).to have_content "Contents"
expect(page).to have_link "Users" expect(page).to have_link "Users"
expect(page).to have_link "Rake tasks" expect(page).to have_link "Rake tasks"
...@@ -120,7 +120,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -120,7 +120,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
When 'I visit markdown branch' do When 'I visit markdown branch' do
visit namespace_project_tree_path(@project.namespace, @project, "markdown") visit namespace_project_tree_path(@project.namespace, @project, "markdown")
wait_for_ajax wait_for_requests
end end
When 'I visit markdown branch "README.md" blob' do When 'I visit markdown branch "README.md" blob' do
...@@ -143,7 +143,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -143,7 +143,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I see correct file rendered in markdown branch' do step 'I see correct file rendered in markdown branch' do
expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
wait_for_ajax wait_for_requests
expect(page).to have_content "Contents" expect(page).to have_content "Contents"
expect(page).to have_link "Users" expect(page).to have_link "Users"
expect(page).to have_link "Rake tasks" expect(page).to have_link "Rake tasks"
...@@ -151,7 +151,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -151,7 +151,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I should see correct document rendered for markdown branch' do step 'I should see correct document rendered for markdown branch' do
expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md")
wait_for_ajax wait_for_requests
expect(page).to have_content "All API requests require authentication" expect(page).to have_content "All API requests require authentication"
end end
...@@ -169,7 +169,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -169,7 +169,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
# Expected link contents # Expected link contents
step 'The link with text "empty" should have url "tree/markdown"' do step 'The link with text "empty" should have url "tree/markdown"' do
wait_for_ajax wait_for_requests
find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown")
end end
...@@ -205,7 +205,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -205,7 +205,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
end end
step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
wait_for_ajax wait_for_requests
find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id'
end end
...@@ -300,12 +300,12 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps ...@@ -300,12 +300,12 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps
step 'I should see the correct markdown' do step 'I should see the correct markdown' do
expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md")
wait_for_ajax wait_for_requests
expect(page).to have_content "List users" expect(page).to have_content "List users"
end end
step 'Header "Application details" should have correct id and link' do step 'Header "Application details" should have correct id and link' do
wait_for_ajax wait_for_requests
header_should_have_correct_id_and_link(2, 'Application details', 'application-details') header_should_have_correct_id_and_link(2, 'Application details', 'application-details')
end end
......
module SharedActiveTab module SharedActiveTab
include Spinach::DSL include Spinach::DSL
include WaitForAjax include WaitForRequests
after do after do
wait_for_ajax if javascript_test? wait_for_requests if javascript_test?
end end
def ensure_active_main_tab(content) def ensure_active_main_tab(content)
......
module SharedDiffNote module SharedDiffNote
include Spinach::DSL include Spinach::DSL
include RepoHelpers include RepoHelpers
include WaitForAjax include WaitForRequests
after do after do
wait_for_ajax if javascript_test? wait_for_requests if javascript_test?
end end
step 'I cancel the diff comment' do step 'I cancel the diff comment' do
......
module SharedIssuable module SharedIssuable
include Spinach::DSL include Spinach::DSL
include WaitForVueResource include WaitForRequests
def edit_issuable def edit_issuable
find('.issuable-edit', visible: true).click find('.issuable-edit', visible: true).click
...@@ -58,7 +58,7 @@ module SharedIssuable ...@@ -58,7 +58,7 @@ module SharedIssuable
step 'I visit merge request page "Enterprise fix"' do step 'I visit merge request page "Enterprise fix"' do
mr = MergeRequest.find_by(title: 'Enterprise fix') mr = MergeRequest.find_by(title: 'Enterprise fix')
visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
wait_for_vue_resource wait_for_requests
end end
step 'I visit issue page "Community issue"' do step 'I visit issue page "Community issue"' do
...@@ -93,7 +93,7 @@ module SharedIssuable ...@@ -93,7 +93,7 @@ module SharedIssuable
from_project_name: 'Community', from_project_name: 'Community',
user_name: 'Mary Jane' user_name: 'Mary Jane'
) )
wait_for_vue_resource wait_for_requests
end end
step 'I should see a note linking to "Enterprise issue" issue' do step 'I should see a note linking to "Enterprise issue" issue' do
......
module SharedNote module SharedNote
include Spinach::DSL include Spinach::DSL
include WaitForAjax include WaitForRequests
after do after do
wait_for_ajax if javascript_test? wait_for_requests if javascript_test?
end end
step 'I delete a comment' do step 'I delete a comment' do
...@@ -25,7 +25,7 @@ module SharedNote ...@@ -25,7 +25,7 @@ module SharedNote
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
end end
step 'I preview a comment text like "Bug fixed :smile:"' do step 'I preview a comment text like "Bug fixed :smile:"' do
...@@ -40,7 +40,7 @@ module SharedNote ...@@ -40,7 +40,7 @@ module SharedNote
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
end end
step 'I write a comment like ":+1: Nice"' do step 'I write a comment like ":+1: Nice"' do
...@@ -127,7 +127,7 @@ module SharedNote ...@@ -127,7 +127,7 @@ module SharedNote
click_button "Comment" click_button "Comment"
end end
wait_for_ajax wait_for_requests
end end
step 'The comment with the header should not have an ID' do step 'The comment with the header should not have an ID' do
......
...@@ -2,7 +2,7 @@ module SharedPaths ...@@ -2,7 +2,7 @@ module SharedPaths
include Spinach::DSL include Spinach::DSL
include RepoHelpers include RepoHelpers
include DashboardHelper include DashboardHelper
include WaitForVueResource include WaitForRequests
step 'I visit new project page' do step 'I visit new project page' do
visit new_project_path visit new_project_path
...@@ -402,28 +402,28 @@ module SharedPaths ...@@ -402,28 +402,28 @@ module SharedPaths
step 'I visit merge request page "Bug NS-04"' do step 'I visit merge request page "Bug NS-04"' do
visit merge_request_path("Bug NS-04") visit merge_request_path("Bug NS-04")
wait_for_vue_resource wait_for_requests
end end
step 'I visit merge request page "Bug NS-05"' do step 'I visit merge request page "Bug NS-05"' do
visit merge_request_path("Bug NS-05") visit merge_request_path("Bug NS-05")
wait_for_vue_resource wait_for_requests
end end
step 'I visit merge request page "Bug NS-07"' do step 'I visit merge request page "Bug NS-07"' do
visit merge_request_path("Bug NS-07") visit merge_request_path("Bug NS-07")
wait_for_vue_resource wait_for_requests
end end
step 'I visit merge request page "Bug NS-08"' do step 'I visit merge request page "Bug NS-08"' do
visit merge_request_path("Bug NS-08") visit merge_request_path("Bug NS-08")
wait_for_vue_resource wait_for_requests
end end
step 'I visit merge request page "Bug CO-01"' do step 'I visit merge request page "Bug CO-01"' do
mr = MergeRequest.find_by(title: "Bug CO-01") mr = MergeRequest.find_by(title: "Bug CO-01")
visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
wait_for_vue_resource wait_for_requests
end end
step 'I visit project "Shop" merge requests page' do step 'I visit project "Shop" merge requests page' do
......
...@@ -3,7 +3,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps ...@@ -3,7 +3,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
include SharedPaths include SharedPaths
include SharedProject include SharedProject
include SharedSnippet include SharedSnippet
include WaitForAjax include WaitForRequests
step 'I click link "Personal snippet one"' do step 'I click link "Personal snippet one"' do
click_link "Personal snippet one" click_link "Personal snippet one"
...@@ -30,7 +30,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps ...@@ -30,7 +30,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps
find('.ace_editor').native.send_keys 'Content of snippet three' find('.ace_editor').native.send_keys 'Content of snippet three'
end end
click_button "Create snippet" click_button "Create snippet"
wait_for_ajax wait_for_requests
end end
step 'I submit new internal snippet' do step 'I submit new internal snippet' do
......
...@@ -10,7 +10,7 @@ if ENV['CI'] ...@@ -10,7 +10,7 @@ if ENV['CI']
Knapsack::Adapters::SpinachAdapter.bind Knapsack::Adapters::SpinachAdapter.bind
end end
%w(select2_helper test_env repo_helpers wait_for_ajax wait_for_requests sidekiq wait_for_vue_resource).each do |f| %w(select2_helper test_env repo_helpers wait_for_requests sidekiq).each do |f|
require Rails.root.join('spec', 'support', f) require Rails.root.join('spec', 'support', f)
end end
...@@ -41,7 +41,7 @@ end ...@@ -41,7 +41,7 @@ end
Spinach.hooks.after_scenario do |scenario_data, step_definitions| Spinach.hooks.after_scenario do |scenario_data, step_definitions|
if scenario_data.tags.include?('javascript') if scenario_data.tags.include?('javascript')
include WaitForRequests include WaitForRequests
wait_for_requests_complete block_and_wait_for_requests_complete
end end
end end
......
require 'spec_helper' require 'spec_helper'
describe "Admin::Emails", feature: true, js: true do describe "Admin::Emails", feature: true, js: true do
include WaitForAjax
let!(:current_user) { login_as :admin } let!(:current_user) { login_as :admin }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project, namespace: group) } let!(:project) { create(:project, namespace: group) }
...@@ -15,7 +13,7 @@ describe "Admin::Emails", feature: true, js: true do ...@@ -15,7 +13,7 @@ describe "Admin::Emails", feature: true, js: true do
describe 'Recipient group select' do describe 'Recipient group select' do
it "includes groups and projects" do it "includes groups and projects" do
find('.ajax-admin-email-select').click find('.ajax-admin-email-select').click
wait_for_ajax wait_for_requests
expect(page).to have_selector('.ajax-admin-email-dropdown li', count: 3) expect(page).to have_selector('.ajax-admin-email-dropdown li', count: 3)
group_names = page.all('.ajax-admin-email-dropdown li .group-name') group_names = page.all('.ajax-admin-email-dropdown li .group-name')
......
...@@ -34,11 +34,11 @@ RSpec.describe 'admin issues labels' do ...@@ -34,11 +34,11 @@ RSpec.describe 'admin issues labels' do
page.within '.labels' do page.within '.labels' do
page.all('.btn-remove').each do |remove| page.all('.btn-remove').each do |remove|
remove.click remove.click
wait_for_ajax wait_for_requests
end end
end end
wait_for_ajax wait_for_requests
expect(page).to have_content("There are no labels yet") expect(page).to have_content("There are no labels yet")
expect(page).not_to have_content('bug') expect(page).not_to have_content('bug')
......
...@@ -339,7 +339,7 @@ describe "Admin::Users", feature: true do ...@@ -339,7 +339,7 @@ describe "Admin::Users", feature: true do
page.within(first('.group_member')) do page.within(first('.group_member')) do
find('.btn-remove').click find('.btn-remove').click
end end
wait_for_ajax wait_for_requests
expect(page).not_to have_selector('.group_member') expect(page).not_to have_selector('.group_member')
end end
......
...@@ -46,7 +46,7 @@ describe 'Auto deploy' do ...@@ -46,7 +46,7 @@ describe 'Auto deploy' do
within '.gitlab-ci-yml-selector' do within '.gitlab-ci-yml-selector' do
click_on 'OpenShift' click_on 'OpenShift'
end end
wait_for_ajax wait_for_requests
click_button 'Commit changes' click_button 'Commit changes'
expect(page).to have_content('New Merge Request From auto-deploy into master') expect(page).to have_content('New Merge Request From auto-deploy into master')
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards add issue modal', :feature, :js do describe 'Issue Boards add issue modal', :feature, :js do
include WaitForVueResource
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -19,13 +17,13 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -19,13 +17,13 @@ describe 'Issue Boards add issue modal', :feature, :js do
login_as(user) login_as(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
end end
it 'resets filtered search state' do it 'resets filtered search state' do
visit namespace_project_board_path(project.namespace, project, board, search: 'testing') visit namespace_project_board_path(project.namespace, project, board, search: 'testing')
wait_for_vue_resource wait_for_requests
click_button('Add issues') click_button('Add issues')
...@@ -82,7 +80,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -82,7 +80,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
before do before do
click_button('Add issues') click_button('Add issues')
wait_for_vue_resource wait_for_requests
end end
it 'loads issues' do it 'loads issues' do
...@@ -115,7 +113,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -115,7 +113,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
click_button('Add issues') click_button('Add issues')
wait_for_vue_resource wait_for_requests
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
expect(find('.add-issues-footer')).not_to have_button(planning.title) expect(find('.add-issues-footer')).not_to have_button(planning.title)
...@@ -130,7 +128,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -130,7 +128,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
find('.form-control').native.send_keys(issue.title) find('.form-control').native.send_keys(issue.title)
find('.form-control').native.send_keys(:enter) find('.form-control').native.send_keys(:enter)
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
end end
...@@ -141,7 +139,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -141,7 +139,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
find('.form-control').native.send_keys('testing search') find('.form-control').native.send_keys('testing search')
find('.form-control').native.send_keys(:enter) find('.form-control').native.send_keys(:enter)
wait_for_vue_resource wait_for_requests
expect(page).not_to have_selector('.card') expect(page).not_to have_selector('.card')
expect(page).not_to have_content("You haven't added any issues to your project yet") expect(page).not_to have_content("You haven't added any issues to your project yet")
......
require 'rails_helper' require 'rails_helper'
describe 'Board with milestone', :feature, :js do describe 'Board with milestone', :feature, :js do
include WaitForAjax
include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
...@@ -25,7 +22,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -25,7 +22,7 @@ describe 'Board with milestone', :feature, :js do
create_board_with_milestone create_board_with_milestone
expect(find('.tokens-container')).to have_content(milestone.title) expect(find('.tokens-container')).to have_content(milestone.title)
wait_for_vue_resource wait_for_requests
find('.card', match: :first) find('.card', match: :first)
...@@ -45,7 +42,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -45,7 +42,7 @@ describe 'Board with milestone', :feature, :js do
page.within '#js-multiple-boards-switcher' do page.within '#js-multiple-boards-switcher' do
find('.dropdown-menu-toggle').click find('.dropdown-menu-toggle').click
wait_for_vue_resource wait_for_requests
click_link board.name click_link board.name
end end
...@@ -107,7 +104,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -107,7 +104,7 @@ describe 'Board with milestone', :feature, :js do
end end
it 'removes issues milestone when removing from the board' do it 'removes issues milestone when removing from the board' do
wait_for_vue_resource wait_for_requests
first('.card .card-number').click first('.card .card-number').click
...@@ -134,7 +131,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -134,7 +131,7 @@ describe 'Board with milestone', :feature, :js do
end end
it 'creates new issue with boards milestone' do it 'creates new issue with boards milestone' do
wait_for_vue_resource wait_for_requests
page.within(first('.board')) do page.within(first('.board')) do
find('.btn-default').click find('.btn-default').click
...@@ -143,7 +140,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -143,7 +140,7 @@ describe 'Board with milestone', :feature, :js do
click_button('Submit issue') click_button('Submit issue')
wait_for_vue_resource wait_for_requests
click_link('testing new issue with milestone') click_link('testing new issue with milestone')
end end
...@@ -152,7 +149,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -152,7 +149,7 @@ describe 'Board with milestone', :feature, :js do
end end
it 'updates issue with milestone from add issues modal' do it 'updates issue with milestone from add issues modal' do
wait_for_vue_resource wait_for_requests
click_button 'Add issues' click_button 'Add issues'
......
This diff is collapsed.
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards', :feature, :js do describe 'Issue Boards', :feature, :js do
include WaitForVueResource
include DragTo include DragTo
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
...@@ -24,7 +23,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -24,7 +23,7 @@ describe 'Issue Boards', :feature, :js do
before do before do
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.board', count: 2) expect(page).to have_selector('.board', count: 2)
end end
...@@ -38,7 +37,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -38,7 +37,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves un-ordered issue to top of list' do it 'moves un-ordered issue to top of list' do
drag(from_index: 3, to_index: 0) drag(from_index: 3, to_index: 0)
wait_for_vue_resource wait_for_requests
page.within(first('.board')) do page.within(first('.board')) do
expect(first('.card')).to have_content(issue4.title) expect(first('.card')).to have_content(issue4.title)
...@@ -49,7 +48,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -49,7 +48,7 @@ describe 'Issue Boards', :feature, :js do
context 'ordering in list' do context 'ordering in list' do
before do before do
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.board', count: 2) expect(page).to have_selector('.board', count: 2)
end end
...@@ -57,7 +56,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -57,7 +56,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves from middle to top' do it 'moves from middle to top' do
drag(from_index: 1, to_index: 0) drag(from_index: 1, to_index: 0)
wait_for_vue_resource wait_for_requests
expect(first('.card')).to have_content(issue2.title) expect(first('.card')).to have_content(issue2.title)
end end
...@@ -65,7 +64,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -65,7 +64,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves from middle to bottom' do it 'moves from middle to bottom' do
drag(from_index: 1, to_index: 2) drag(from_index: 1, to_index: 2)
wait_for_vue_resource wait_for_requests
expect(all('.card').last).to have_content(issue2.title) expect(all('.card').last).to have_content(issue2.title)
end end
...@@ -73,7 +72,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -73,7 +72,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves from top to bottom' do it 'moves from top to bottom' do
drag(from_index: 0, to_index: 2) drag(from_index: 0, to_index: 2)
wait_for_vue_resource wait_for_requests
expect(all('.card').last).to have_content(issue3.title) expect(all('.card').last).to have_content(issue3.title)
end end
...@@ -81,7 +80,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -81,7 +80,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves from bottom to top' do it 'moves from bottom to top' do
drag(from_index: 2, to_index: 0) drag(from_index: 2, to_index: 0)
wait_for_vue_resource wait_for_requests
expect(first('.card')).to have_content(issue1.title) expect(first('.card')).to have_content(issue1.title)
end end
...@@ -89,7 +88,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -89,7 +88,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves from top to middle' do it 'moves from top to middle' do
drag(from_index: 0, to_index: 1) drag(from_index: 0, to_index: 1)
wait_for_vue_resource wait_for_requests
expect(first('.card')).to have_content(issue2.title) expect(first('.card')).to have_content(issue2.title)
end end
...@@ -97,7 +96,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -97,7 +96,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves from bottom to middle' do it 'moves from bottom to middle' do
drag(from_index: 2, to_index: 1) drag(from_index: 2, to_index: 1)
wait_for_vue_resource wait_for_requests
expect(all('.card').last).to have_content(issue2.title) expect(all('.card').last).to have_content(issue2.title)
end end
...@@ -112,7 +111,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -112,7 +111,7 @@ describe 'Issue Boards', :feature, :js do
before do before do
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
end end
...@@ -120,7 +119,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -120,7 +119,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves to top of another list' do it 'moves to top of another list' do
drag(list_from_index: 0, list_to_index: 1) drag(list_from_index: 0, list_to_index: 1)
wait_for_vue_resource wait_for_requests
expect(first('.board')).to have_selector('.card', count: 2) expect(first('.board')).to have_selector('.card', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 4) expect(all('.board')[1]).to have_selector('.card', count: 4)
...@@ -133,7 +132,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -133,7 +132,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves to bottom of another list' do it 'moves to bottom of another list' do
drag(list_from_index: 0, list_to_index: 1, to_index: 2) drag(list_from_index: 0, list_to_index: 1, to_index: 2)
wait_for_vue_resource wait_for_requests
expect(first('.board')).to have_selector('.card', count: 2) expect(first('.board')).to have_selector('.card', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 4) expect(all('.board')[1]).to have_selector('.card', count: 4)
...@@ -146,7 +145,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -146,7 +145,7 @@ describe 'Issue Boards', :feature, :js do
it 'moves to index of another list' do it 'moves to index of another list' do
drag(list_from_index: 0, list_to_index: 1, to_index: 1) drag(list_from_index: 0, list_to_index: 1, to_index: 1)
wait_for_vue_resource wait_for_requests
expect(first('.board')).to have_selector('.card', count: 2) expect(first('.board')).to have_selector('.card', count: 2)
expect(all('.board')[1]).to have_selector('.card', count: 4) expect(all('.board')[1]).to have_selector('.card', count: 4)
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards shortcut', feature: true, js: true do describe 'Issue Boards shortcut', feature: true, js: true do
include WaitForVueResource
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
before do before do
...@@ -17,6 +15,6 @@ describe 'Issue Boards shortcut', feature: true, js: true do ...@@ -17,6 +15,6 @@ describe 'Issue Boards shortcut', feature: true, js: true do
find('body').native.send_keys('gb') find('body').native.send_keys('gb')
expect(page).to have_selector('.boards-list') expect(page).to have_selector('.boards-list')
wait_for_vue_resource wait_for_requests
end end
end end
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards add issue modal filtering', :feature, :js do describe 'Issue Boards add issue modal filtering', :feature, :js do
include WaitForVueResource
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let(:planning) { create(:label, project: project, name: 'Planning') } let(:planning) { create(:label, project: project, name: 'Planning') }
...@@ -24,7 +22,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -24,7 +22,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
find('.form-control').native.send_keys('testing empty state') find('.form-control').native.send_keys('testing empty state')
find('.form-control').native.send_keys(:enter) find('.form-control').native.send_keys(:enter)
wait_for_vue_resource wait_for_requests
expect(page).to have_content('There are no issues to show.') expect(page).to have_content('There are no issues to show.')
end end
...@@ -38,7 +36,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -38,7 +36,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.card', count: 0) expect(page).to have_selector('.card', count: 0)
...@@ -48,7 +46,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -48,7 +46,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
click_button('Add issues') click_button('Add issues')
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
end end
...@@ -62,13 +60,13 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -62,13 +60,13 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.card', count: 0) expect(page).to have_selector('.card', count: 0)
find('.clear-search').click find('.clear-search').click
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
end end
...@@ -89,7 +87,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -89,7 +87,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: user2.username) expect(page).to have_selector('.js-visual-token', text: user2.username)
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -112,7 +110,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -112,7 +110,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: 'none') expect(page).to have_selector('.js-visual-token', text: 'none')
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -125,7 +123,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -125,7 +123,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: user2.username) expect(page).to have_selector('.js-visual-token', text: user2.username)
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -147,7 +145,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -147,7 +145,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: 'upcoming') expect(page).to have_selector('.js-visual-token', text: 'upcoming')
expect(page).to have_selector('.card', count: 0) expect(page).to have_selector('.card', count: 0)
...@@ -160,7 +158,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -160,7 +158,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: milestone.name) expect(page).to have_selector('.js-visual-token', text: milestone.name)
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -182,7 +180,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -182,7 +180,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: 'none') expect(page).to have_selector('.js-visual-token', text: 'none')
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -195,7 +193,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -195,7 +193,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
submit_filter submit_filter
page.within('.add-issues-modal') do page.within('.add-issues-modal') do
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.js-visual-token', text: label.title) expect(page).to have_selector('.js-visual-token', text: label.title)
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -205,7 +203,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -205,7 +203,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
def visit_board def visit_board
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
click_button('Add issues') click_button('Add issues')
end end
......
require 'rails_helper' require 'rails_helper'
describe 'Multiple Issue Boards', feature: true, js: true do describe 'Multiple Issue Boards', feature: true, js: true do
include WaitForAjax
include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let!(:planning) { create(:label, project: project, name: 'Planning') } let!(:planning) { create(:label, project: project, name: 'Planning') }
...@@ -17,7 +14,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -17,7 +14,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
login_as(user) login_as(user)
visit namespace_project_boards_path(project.namespace, project) visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource wait_for_requests
end end
it 'shows current board name' do it 'shows current board name' do
...@@ -42,7 +39,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -42,7 +39,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_link board2.name click_link board2.name
end end
wait_for_vue_resource wait_for_requests
page.within('.boards-switcher') do page.within('.boards-switcher') do
expect(page).to have_content(board2.name) expect(page).to have_content(board2.name)
...@@ -60,7 +57,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -60,7 +57,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button 'Save' click_button 'Save'
end end
wait_for_vue_resource wait_for_requests
page.within('.dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_content('Testing') expect(page).to have_content('Testing')
...@@ -78,7 +75,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -78,7 +75,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button 'Save' click_button 'Save'
end end
wait_for_vue_resource wait_for_requests
page.within('.dropdown-menu') do page.within('.dropdown-menu') do
expect(page).to have_content('Testing') expect(page).to have_content('Testing')
...@@ -88,7 +85,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -88,7 +85,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
it 'deletes board' do it 'deletes board' do
click_button board.name click_button board.name
wait_for_vue_resource wait_for_requests
page.within('.dropdown-menu') do page.within('.dropdown-menu') do
click_link 'Delete board' click_link 'Delete board'
...@@ -115,7 +112,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -115,7 +112,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_link board2.name click_link board2.name
end end
wait_for_vue_resource wait_for_requests
page.within('.boards-switcher') do page.within('.boards-switcher') do
expect(page).to have_content(board2.name) expect(page).to have_content(board2.name)
...@@ -123,13 +120,13 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -123,13 +120,13 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_button 'Add list' click_button 'Add list'
wait_for_ajax wait_for_requests
page.within '.dropdown-menu-issues-board-new' do page.within '.dropdown-menu-issues-board-new' do
click_link planning.title click_link planning.title
end end
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.board', count: 2) expect(page).to have_selector('.board', count: 2)
...@@ -139,7 +136,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -139,7 +136,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
click_link board.name click_link board.name
end end
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.board', count: 1) expect(page).to have_selector('.board', count: 1)
end end
...@@ -148,7 +145,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -148,7 +145,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
context 'unauthorized user' do context 'unauthorized user' do
before do before do
visit namespace_project_boards_path(project.namespace, project) visit namespace_project_boards_path(project.namespace, project)
wait_for_vue_resource wait_for_requests
end end
it 'does not show action links' do it 'does not show action links' do
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards new issue', feature: true, js: true do describe 'Issue Boards new issue', feature: true, js: true do
include WaitForVueResource
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
let!(:list) { create(:list, board: board, position: 0) } let!(:list) { create(:list, board: board, position: 0) }
...@@ -15,7 +13,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -15,7 +13,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
login_as(user) login_as(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.board', count: 2) expect(page).to have_selector('.board', count: 2)
end end
...@@ -60,7 +58,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -60,7 +58,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
click_button 'Submit issue' click_button 'Submit issue'
end end
wait_for_vue_resource wait_for_requests
page.within(first('.board .board-issue-count')) do page.within(first('.board .board-issue-count')) do
expect(page).to have_content('1') expect(page).to have_content('1')
...@@ -77,7 +75,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -77,7 +75,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
click_button 'Submit issue' click_button 'Submit issue'
end end
wait_for_vue_resource wait_for_requests
expect(page).to have_selector('.issue-boards-sidebar') expect(page).to have_selector('.issue-boards-sidebar')
end end
...@@ -86,7 +84,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -86,7 +84,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
context 'unauthorized user' do context 'unauthorized user' do
before do before do
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
end end
it 'does not display new issue button' do it 'does not display new issue button' do
......
require 'rails_helper' require 'rails_helper'
describe 'Issue Boards', feature: true, js: true do describe 'Issue Boards', feature: true, js: true do
include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
...@@ -26,7 +24,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -26,7 +24,7 @@ describe 'Issue Boards', feature: true, js: true do
login_as(user) login_as(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
end end
after do after do
...@@ -75,7 +73,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -75,7 +73,7 @@ describe 'Issue Boards', feature: true, js: true do
click_button 'Remove from board' click_button 'Remove from board'
end end
wait_for_vue_resource wait_for_requests
page.within(first('.board')) do page.within(first('.board')) do
expect(page).to have_selector('.card', count: 1) expect(page).to have_selector('.card', count: 1)
...@@ -89,12 +87,12 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -89,12 +87,12 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.assignee') do page.within('.assignee') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
page.within('.dropdown-menu-user') do page.within('.dropdown-menu-user') do
click_link user.name click_link user.name
wait_for_vue_resource wait_for_requests
end end
expect(page).to have_content(user.name) expect(page).to have_content(user.name)
...@@ -109,7 +107,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -109,7 +107,7 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.assignee') do page.within('.assignee') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
page.within('.dropdown-menu-user') do page.within('.dropdown-menu-user') do
click_link user.name click_link user.name
...@@ -130,14 +128,14 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -130,14 +128,14 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.assignee') do page.within('.assignee') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
page.within('.dropdown-menu-user') do page.within('.dropdown-menu-user') do
click_link 'Unassigned' click_link 'Unassigned'
end end
find('.dropdown-menu-toggle').click find('.dropdown-menu-toggle').click
wait_for_vue_resource wait_for_requests
expect(page).to have_content('No assignee') expect(page).to have_content('No assignee')
end end
...@@ -153,7 +151,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -153,7 +151,7 @@ describe 'Issue Boards', feature: true, js: true do
click_button 'assign yourself' click_button 'assign yourself'
wait_for_vue_resource wait_for_requests
expect(page).to have_content(user.name) expect(page).to have_content(user.name)
end end
...@@ -167,12 +165,12 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -167,12 +165,12 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.assignee') do page.within('.assignee') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
page.within('.dropdown-menu-user') do page.within('.dropdown-menu-user') do
click_link user.name click_link user.name
wait_for_vue_resource wait_for_requests
end end
expect(page).to have_content(user.name) expect(page).to have_content(user.name)
...@@ -197,11 +195,11 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -197,11 +195,11 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.milestone') do page.within('.milestone') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
click_link milestone.title click_link milestone.title
wait_for_vue_resource wait_for_requests
page.within('.value') do page.within('.value') do
expect(page).to have_content(milestone.title) expect(page).to have_content(milestone.title)
...@@ -215,11 +213,11 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -215,11 +213,11 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.milestone') do page.within('.milestone') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
click_link "No Milestone" click_link "No Milestone"
wait_for_vue_resource wait_for_requests
page.within('.value') do page.within('.value') do
expect(page).not_to have_content(milestone.title) expect(page).not_to have_content(milestone.title)
...@@ -237,7 +235,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -237,7 +235,7 @@ describe 'Issue Boards', feature: true, js: true do
click_button Date.today.day click_button Date.today.day
wait_for_vue_resource wait_for_requests
expect(page).to have_content(Date.today.to_s(:medium)) expect(page).to have_content(Date.today.to_s(:medium))
end end
...@@ -251,11 +249,11 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -251,11 +249,11 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
click_link bug.title click_link bug.title
wait_for_vue_resource wait_for_requests
find('.dropdown-menu-close-icon').click find('.dropdown-menu-close-icon').click
...@@ -275,12 +273,12 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -275,12 +273,12 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
click_link bug.title click_link bug.title
click_link regression.title click_link regression.title
wait_for_vue_resource wait_for_requests
find('.dropdown-menu-close-icon').click find('.dropdown-menu-close-icon').click
...@@ -302,11 +300,11 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -302,11 +300,11 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_link 'Edit'
wait_for_ajax wait_for_requests
click_link stretch.title click_link stretch.title
wait_for_vue_resource wait_for_requests
find('.dropdown-menu-close-icon').click find('.dropdown-menu-close-icon').click
...@@ -327,7 +325,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -327,7 +325,7 @@ describe 'Issue Boards', feature: true, js: true do
page.within('.subscription') do page.within('.subscription') do
click_button 'Subscribe' click_button 'Subscribe'
wait_for_ajax wait_for_requests
expect(page).to have_content("Unsubscribe") expect(page).to have_content("Unsubscribe")
end end
end end
......
require 'rails_helper' require 'rails_helper'
describe 'Sub-group project issue boards', :feature, :js do describe 'Sub-group project issue boards', :feature, :js do
include WaitForVueResource
let(:group) { create(:group) } let(:group) { create(:group) }
let(:nested_group_1) { create(:group, parent: group) } let(:nested_group_1) { create(:group, parent: group) }
let(:project) { create(:empty_project, group: nested_group_1) } let(:project) { create(:empty_project, group: nested_group_1) }
...@@ -18,7 +16,7 @@ describe 'Sub-group project issue boards', :feature, :js do ...@@ -18,7 +16,7 @@ describe 'Sub-group project issue boards', :feature, :js do
login_as(user) login_as(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource wait_for_requests
end end
it 'creates new label from sidebar' do it 'creates new label from sidebar' do
...@@ -35,7 +33,7 @@ describe 'Sub-group project issue boards', :feature, :js do ...@@ -35,7 +33,7 @@ describe 'Sub-group project issue boards', :feature, :js do
click_button 'Create' click_button 'Create'
wait_for_ajax wait_for_requests
end end
page.within '.labels' do page.within '.labels' do
......
...@@ -74,7 +74,7 @@ feature 'Contributions Calendar', :feature, :js do ...@@ -74,7 +74,7 @@ feature 'Contributions Calendar', :feature, :js do
describe 'calendar day selection' do describe 'calendar day selection' do
before do before do
visit user.username visit user.username
wait_for_ajax wait_for_requests
end end
it 'displays calendar' do it 'displays calendar' do
...@@ -86,7 +86,7 @@ feature 'Contributions Calendar', :feature, :js do ...@@ -86,7 +86,7 @@ feature 'Contributions Calendar', :feature, :js do
before do before do
cells[0].click cells[0].click
wait_for_ajax wait_for_requests
@first_day_activities = selected_day_activities @first_day_activities = selected_day_activities
end end
...@@ -97,7 +97,7 @@ feature 'Contributions Calendar', :feature, :js do ...@@ -97,7 +97,7 @@ feature 'Contributions Calendar', :feature, :js do
describe 'select another calendar day' do describe 'select another calendar day' do
before do before do
cells[1].click cells[1].click
wait_for_ajax wait_for_requests
end end
it 'displays different calendar day activities' do it 'displays different calendar day activities' do
...@@ -108,7 +108,7 @@ feature 'Contributions Calendar', :feature, :js do ...@@ -108,7 +108,7 @@ feature 'Contributions Calendar', :feature, :js do
describe 'deselect calendar day' do describe 'deselect calendar day' do
before do before do
cells[0].click cells[0].click
wait_for_ajax wait_for_requests
end end
it 'hides calendar day activities' do it 'hides calendar day activities' do
...@@ -122,7 +122,7 @@ feature 'Contributions Calendar', :feature, :js do ...@@ -122,7 +122,7 @@ feature 'Contributions Calendar', :feature, :js do
shared_context 'visit user page' do shared_context 'visit user page' do
before do before do
visit user.username visit user.username
wait_for_ajax wait_for_requests
end end
end end
......
...@@ -479,7 +479,7 @@ describe 'Copy as GFM', feature: true, js: true do ...@@ -479,7 +479,7 @@ describe 'Copy as GFM', feature: true, js: true do
context 'from a blob' do context 'from a blob' do
before do before do
visit namespace_project_blob_path(project.namespace, project, File.join('master', 'files/ruby/popen.rb')) visit namespace_project_blob_path(project.namespace, project, File.join('master', 'files/ruby/popen.rb'))
wait_for_ajax wait_for_requests
end end
context 'selecting one word of text' do context 'selecting one word of text' do
...@@ -521,7 +521,7 @@ describe 'Copy as GFM', feature: true, js: true do ...@@ -521,7 +521,7 @@ describe 'Copy as GFM', feature: true, js: true do
context 'from a GFM code block' do context 'from a GFM code block' do
before do before do
visit namespace_project_blob_path(project.namespace, project, File.join('markdown', 'doc/api/users.md')) visit namespace_project_blob_path(project.namespace, project, File.join('markdown', 'doc/api/users.md'))
wait_for_ajax wait_for_requests
end end
context 'selecting one word of text' do context 'selecting one word of text' do
......
...@@ -17,7 +17,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -17,7 +17,7 @@ feature 'Cycle Analytics', feature: true, js: true do
login_as(user) login_as(user)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_ajax wait_for_requests
end end
it 'shows introductory message' do it 'shows introductory message' do
...@@ -73,7 +73,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -73,7 +73,7 @@ feature 'Cycle Analytics', feature: true, js: true do
project.team << [user, :master] project.team << [user, :master]
login_as(user) login_as(user)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_ajax wait_for_requests
end end
it 'shows the content in Spanish' do it 'shows the content in Spanish' do
...@@ -96,7 +96,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -96,7 +96,7 @@ feature 'Cycle Analytics', feature: true, js: true do
login_as(guest) login_as(guest)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_ajax wait_for_requests
end end
it 'needs permissions to see restricted stages' do it 'needs permissions to see restricted stages' do
...@@ -140,6 +140,6 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -140,6 +140,6 @@ feature 'Cycle Analytics', feature: true, js: true do
def click_stage(stage_name) def click_stage(stage_name)
find('.stage-nav li', text: stage_name).click find('.stage-nav li', text: stage_name).click
wait_for_ajax wait_for_requests
end end
end end
...@@ -15,7 +15,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do ...@@ -15,7 +15,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do
login_as user login_as user
visit user_path(user) visit user_path(user)
wait_for_ajax() wait_for_requests()
page.find('.js-timeago').hover page.find('.js-timeago').hover
end end
...@@ -32,7 +32,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do ...@@ -32,7 +32,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do
login_as user login_as user
visit user_snippets_path(user) visit user_snippets_path(user)
wait_for_ajax() wait_for_requests()
page.find('.js-timeago.snippet-created-ago').hover page.find('.js-timeago.snippet-created-ago').hover
end end
......
...@@ -23,7 +23,7 @@ describe 'Dashboard Groups page', js: true, feature: true do ...@@ -23,7 +23,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
it 'filters groups' do it 'filters groups' do
fill_in 'filter_groups', with: group.name fill_in 'filter_groups', with: group.name
wait_for_ajax wait_for_requests
expect(page).to have_content(group.full_name) expect(page).to have_content(group.full_name)
expect(page).not_to have_content(nested_group.full_name) expect(page).not_to have_content(nested_group.full_name)
...@@ -32,10 +32,10 @@ describe 'Dashboard Groups page', js: true, feature: true do ...@@ -32,10 +32,10 @@ describe 'Dashboard Groups page', js: true, feature: true do
it 'resets search when user cleans the input' do it 'resets search when user cleans the input' do
fill_in 'filter_groups', with: group.name fill_in 'filter_groups', with: group.name
wait_for_ajax wait_for_requests
fill_in 'filter_groups', with: "" fill_in 'filter_groups', with: ""
wait_for_ajax wait_for_requests
expect(page).to have_content(group.full_name) expect(page).to have_content(group.full_name)
expect(page).to have_content(nested_group.full_name) expect(page).to have_content(nested_group.full_name)
......
require 'spec_helper' require 'spec_helper'
describe 'Dashboard > milestone filter', :feature, :js do describe 'Dashboard > milestone filter', :feature, :js do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) } let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:milestone) { create(:milestone, title: "v1.0", project: project) } let(:milestone) { create(:milestone, title: "v1.0", project: project) }
...@@ -28,14 +26,14 @@ describe 'Dashboard > milestone filter', :feature, :js do ...@@ -28,14 +26,14 @@ describe 'Dashboard > milestone filter', :feature, :js do
before do before do
find(milestone_select).click find(milestone_select).click
wait_for_ajax wait_for_requests
page.within('.dropdown-content') do page.within('.dropdown-content') do
click_link 'v1.0' click_link 'v1.0'
end end
find(milestone_select).click find(milestone_select).click
wait_for_ajax wait_for_requests
end end
it 'shows issues with Milestone v1.0' do it 'shows issues with Milestone v1.0' do
...@@ -48,9 +46,9 @@ describe 'Dashboard > milestone filter', :feature, :js do ...@@ -48,9 +46,9 @@ describe 'Dashboard > milestone filter', :feature, :js do
# open & close dropdown # open & close dropdown
find('.dropdown-menu-close').click find('.dropdown-menu-close').click
expect(find('.milestone-filter')).not_to have_selector('.dropdown.open') expect(find('.milestone-filter')).not_to have_selector('.dropdown.open')
find(milestone_select).click find(milestone_select).click
expect(find('.dropdown-content')).to have_selector('a.is-active', count: 1) expect(find('.dropdown-content')).to have_selector('a.is-active', count: 1)
......
...@@ -11,7 +11,7 @@ feature 'Project member activity', feature: true, js: true do ...@@ -11,7 +11,7 @@ feature 'Project member activity', feature: true, js: true do
def visit_activities_and_wait_with_event(event_type) def visit_activities_and_wait_with_event(event_type)
Event.create(project: project, author_id: user.id, action: event_type) Event.create(project: project, author_id: user.id, action: event_type)
visit activity_namespace_project_path(project.namespace, project) visit activity_namespace_project_path(project.namespace, project)
wait_for_ajax wait_for_requests
end end
subject { page.find(".event-title").text } subject { page.find(".event-title").text }
......
...@@ -7,7 +7,7 @@ feature 'Group elastic search', js: true, feature: true do ...@@ -7,7 +7,7 @@ feature 'Group elastic search', js: true, feature: true do
def choose_group(group) def choose_group(group)
find('.js-search-group-dropdown').trigger('click') find('.js-search-group-dropdown').trigger('click')
wait_for_ajax wait_for_requests
page.within '.search-holder' do page.within '.search-holder' do
click_link group.name click_link group.name
......
...@@ -36,7 +36,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -36,7 +36,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: "#{large_diff[:id]}_0_1") visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: "#{large_diff[:id]}_0_1")
execute_script('window.location.reload()') execute_script('window.location.reload()')
wait_for_ajax wait_for_requests
expect(large_diff).to have_selector('.code') expect(large_diff).to have_selector('.code')
expect(large_diff).not_to have_selector('.nothing-here-block') expect(large_diff).not_to have_selector('.nothing-here-block')
...@@ -50,7 +50,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -50,7 +50,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: large_diff[:id]) visit namespace_project_commit_path(project.namespace, project, project.commit(branch), anchor: large_diff[:id])
execute_script('window.location.reload()') execute_script('window.location.reload()')
wait_for_ajax wait_for_requests
expect(large_diff).to have_selector('.code') expect(large_diff).to have_selector('.code')
expect(large_diff).not_to have_selector('.nothing-here-block') expect(large_diff).not_to have_selector('.nothing-here-block')
...@@ -94,7 +94,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -94,7 +94,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
context 'expanding a diff for a renamed file' do context 'expanding a diff for a renamed file' do
before do before do
large_diff_renamed.find('.click-to-expand').click large_diff_renamed.find('.click-to-expand').click
wait_for_ajax wait_for_requests
end end
it 'shows the old content' do it 'shows the old content' do
...@@ -116,7 +116,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -116,7 +116,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
find('.js-file-title', match: :first) find('.js-file-title', match: :first)
# Click `large_diff.md` title # Click `large_diff.md` title
all('.diff-toggle-caret')[1].click all('.diff-toggle-caret')[1].click
wait_for_ajax wait_for_requests
end end
it 'makes a request to get the content' do it 'makes a request to get the content' do
...@@ -139,7 +139,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -139,7 +139,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
large_diff.find('.add-diff-note').click large_diff.find('.add-diff-note').click
large_diff.find('.note-textarea').send_keys comment_text large_diff.find('.note-textarea').send_keys comment_text
large_diff.find_button('Comment').click large_diff.find_button('Comment').click
wait_for_ajax wait_for_requests
end end
it 'adds the comment' do it 'adds the comment' do
...@@ -160,7 +160,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -160,7 +160,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
find('.js-file-title', match: :first) find('.js-file-title', match: :first)
# Click `large_diff.md` title # Click `large_diff.md` title
all('.diff-toggle-caret')[1].click all('.diff-toggle-caret')[1].click
wait_for_ajax wait_for_requests
end end
it 'shows the diff content' do it 'shows the diff content' do
...@@ -216,7 +216,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -216,7 +216,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
expect(page).to have_no_content('No longer a symlink') expect(page).to have_no_content('No longer a symlink')
find('.click-to-expand').click find('.click-to-expand').click
wait_for_ajax wait_for_requests
expect(page).to have_content('No longer a symlink') expect(page).to have_content('No longer a symlink')
end end
...@@ -273,7 +273,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -273,7 +273,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
expect(page).to have_content('too_large_image.jpg') expect(page).to have_content('too_large_image.jpg')
find('.note-textarea') find('.note-textarea')
wait_for_ajax wait_for_requests
execute_script('window.ajaxUris = []; $(document).ajaxSend(function(event, xhr, settings) { ajaxUris.push(settings.url) });') execute_script('window.ajaxUris = []; $(document).ajaxSend(function(event, xhr, settings) { ajaxUris.push(settings.url) });')
end end
......
...@@ -23,7 +23,7 @@ describe 'Explore Groups page', :js, :feature do ...@@ -23,7 +23,7 @@ describe 'Explore Groups page', :js, :feature do
it 'filters groups' do it 'filters groups' do
fill_in 'filter_groups', with: group.name fill_in 'filter_groups', with: group.name
wait_for_ajax wait_for_requests
expect(page).to have_content(group.full_name) expect(page).to have_content(group.full_name)
expect(page).not_to have_content(public_group.full_name) expect(page).not_to have_content(public_group.full_name)
...@@ -32,10 +32,10 @@ describe 'Explore Groups page', :js, :feature do ...@@ -32,10 +32,10 @@ describe 'Explore Groups page', :js, :feature do
it 'resets search when user cleans the input' do it 'resets search when user cleans the input' do
fill_in 'filter_groups', with: group.name fill_in 'filter_groups', with: group.name
wait_for_ajax wait_for_requests
fill_in 'filter_groups', with: "" fill_in 'filter_groups', with: ""
wait_for_ajax wait_for_requests
expect(page).to have_content(group.full_name) expect(page).to have_content(group.full_name)
expect(page).to have_content(public_group.full_name) expect(page).to have_content(public_group.full_name)
......
...@@ -49,7 +49,7 @@ describe "GitLab Flavored Markdown", feature: true do ...@@ -49,7 +49,7 @@ describe "GitLab Flavored Markdown", feature: true do
end end
describe "for issues", feature: true, js: true do describe "for issues", feature: true, js: true do
include WaitForVueResource include WaitForRequests
before do before do
@other_issue = create(:issue, @other_issue = create(:issue,
......
...@@ -33,7 +33,7 @@ feature 'Group issues page', feature: true do ...@@ -33,7 +33,7 @@ feature 'Group issues page', feature: true do
it 'filters by only group users' do it 'filters by only group users' do
click_button('Assignee') click_button('Assignee')
wait_for_ajax wait_for_requests
expect(find('.dropdown-menu-assignee')).to have_link(user.name) expect(find('.dropdown-menu-assignee')).to have_link(user.name)
expect(find('.dropdown-menu-assignee')).not_to have_link(user2.name) expect(find('.dropdown-menu-assignee')).not_to have_link(user2.name)
......
require 'spec_helper' require 'spec_helper'
feature 'Groups > Members > Master/Owner can override LDAP access levels', feature: true do feature 'Groups > Members > Master/Owner can override LDAP access levels', feature: true do
include WaitForAjax include WaitForRequests
let(:johndoe) { create(:user, name: 'John Doe') } let(:johndoe) { create(:user, name: 'John Doe') }
let(:maryjane) { create(:user, name: 'Mary Jane') } let(:maryjane) { create(:user, name: 'Mary Jane') }
...@@ -56,7 +56,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels', featu ...@@ -56,7 +56,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels', featu
click_link 'Revert to LDAP group sync settings' click_link 'Revert to LDAP group sync settings'
end end
wait_for_ajax wait_for_requests
expect(page).to have_button 'Guest', disabled: true expect(page).to have_button 'Guest', disabled: true
expect(page).to have_button 'Edit permissions' expect(page).to have_button 'Edit permissions'
......
require 'rails_helper' require 'rails_helper'
describe 'Awards Emoji', feature: true do describe 'Awards Emoji', feature: true do
include WaitForVueResource include WaitForRequests
let!(:project) { create(:project, :public) } let!(:project) { create(:project, :public) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
...@@ -22,7 +22,7 @@ describe 'Awards Emoji', feature: true do ...@@ -22,7 +22,7 @@ describe 'Awards Emoji', feature: true do
# The `heart_tip` emoji is not valid anymore so we need to skip validation # The `heart_tip` emoji is not valid anymore so we need to skip validation
issue.award_emoji.build(user: user, name: 'heart_tip').save!(validate: false) issue.award_emoji.build(user: user, name: 'heart_tip').save!(validate: false)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_vue_resource wait_for_requests
end end
# Regression test: https://gitlab.com/gitlab-org/gitlab-ce/issues/29529 # Regression test: https://gitlab.com/gitlab-org/gitlab-ce/issues/29529
...@@ -36,19 +36,19 @@ describe 'Awards Emoji', feature: true do ...@@ -36,19 +36,19 @@ describe 'Awards Emoji', feature: true do
before do before do
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_vue_resource wait_for_requests
end end
it 'increments the thumbsdown emoji', js: true do it 'increments the thumbsdown emoji', js: true do
find('[data-name="thumbsdown"]').click find('[data-name="thumbsdown"]').click
wait_for_ajax wait_for_requests
expect(thumbsdown_emoji).to have_text("1") expect(thumbsdown_emoji).to have_text("1")
end end
context 'click the thumbsup emoji' do context 'click the thumbsup emoji' do
it 'increments the thumbsup emoji', js: true do it 'increments the thumbsup emoji', js: true do
find('[data-name="thumbsup"]').click find('[data-name="thumbsup"]').click
wait_for_ajax wait_for_requests
expect(thumbsup_emoji).to have_text("1") expect(thumbsup_emoji).to have_text("1")
end end
...@@ -60,7 +60,7 @@ describe 'Awards Emoji', feature: true do ...@@ -60,7 +60,7 @@ describe 'Awards Emoji', feature: true do
context 'click the thumbsdown emoji' do context 'click the thumbsdown emoji' do
it 'increments the thumbsdown emoji', js: true do it 'increments the thumbsdown emoji', js: true do
find('[data-name="thumbsdown"]').click find('[data-name="thumbsdown"]').click
wait_for_ajax wait_for_requests
expect(thumbsdown_emoji).to have_text("1") expect(thumbsdown_emoji).to have_text("1")
end end
...@@ -113,7 +113,7 @@ describe 'Awards Emoji', feature: true do ...@@ -113,7 +113,7 @@ describe 'Awards Emoji', feature: true do
click_button 'Comment' click_button 'Comment'
end end
wait_for_ajax wait_for_requests
end end
def thumbsup_emoji def thumbsup_emoji
...@@ -143,6 +143,6 @@ describe 'Awards Emoji', feature: true do ...@@ -143,6 +143,6 @@ describe 'Awards Emoji', feature: true do
find('[data-name="smiley"]').click find('[data-name="smiley"]').click
end end
wait_for_ajax wait_for_requests
end end
end end
...@@ -6,12 +6,10 @@ feature 'Issue awards', js: true, feature: true do ...@@ -6,12 +6,10 @@ feature 'Issue awards', js: true, feature: true do
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
describe 'logged in' do describe 'logged in' do
include WaitForVueResource
before do before do
login_as(user) login_as(user)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_vue_resource wait_for_requests
end end
it 'adds award to issue' do it 'adds award to issue' do
...@@ -41,11 +39,9 @@ feature 'Issue awards', js: true, feature: true do ...@@ -41,11 +39,9 @@ feature 'Issue awards', js: true, feature: true do
end end
describe 'logged out' do describe 'logged out' do
include WaitForVueResource
before do before do
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_vue_resource wait_for_requests
end end
it 'does not see award menu button' do it 'does not see award menu button' do
......
...@@ -306,7 +306,7 @@ feature 'Issues > Labels bulk assignment', feature: true do ...@@ -306,7 +306,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
page.within('.issues_bulk_update') do page.within('.issues_bulk_update') do
click_button 'Labels' click_button 'Labels'
wait_for_ajax wait_for_requests
expect(find('.dropdown-menu-labels li', text: 'bug')).to have_css('.is-active') expect(find('.dropdown-menu-labels li', text: 'bug')).to have_css('.is-active')
expect(find('.dropdown-menu-labels li', text: 'feature')).to have_css('.is-indeterminate') expect(find('.dropdown-menu-labels li', text: 'feature')).to have_css('.is-indeterminate')
...@@ -349,7 +349,7 @@ feature 'Issues > Labels bulk assignment', feature: true do ...@@ -349,7 +349,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
def open_milestone_dropdown(items = []) def open_milestone_dropdown(items = [])
page.within('.issues_bulk_update') do page.within('.issues_bulk_update') do
click_button 'Milestone' click_button 'Milestone'
wait_for_ajax wait_for_requests
items.map do |item| items.map do |item|
click_link item click_link item
end end
...@@ -359,7 +359,7 @@ feature 'Issues > Labels bulk assignment', feature: true do ...@@ -359,7 +359,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
def open_labels_dropdown(items = [], unmark = false) def open_labels_dropdown(items = [], unmark = false)
page.within('.issues_bulk_update') do page.within('.issues_bulk_update') do
click_button 'Labels' click_button 'Labels'
wait_for_ajax wait_for_requests
items.map do |item| items.map do |item|
click_link item click_link item
end end
...@@ -392,6 +392,6 @@ feature 'Issues > Labels bulk assignment', feature: true do ...@@ -392,6 +392,6 @@ feature 'Issues > Labels bulk assignment', feature: true do
def update_issues def update_issues
click_button 'Update issues' click_button 'Update issues'
wait_for_ajax wait_for_requests
end end
end end
...@@ -16,7 +16,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js: ...@@ -16,7 +16,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
select_dropdown_option('create-mr') select_dropdown_option('create-mr')
wait_for_ajax wait_for_requests
expect(page).to have_content("created branch 1-cherry-coloured-funk") expect(page).to have_content("created branch 1-cherry-coloured-funk")
expect(page).to have_content("mentioned in merge request !1") expect(page).to have_content("mentioned in merge request !1")
...@@ -32,7 +32,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js: ...@@ -32,7 +32,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
select_dropdown_option('create-branch') select_dropdown_option('create-branch')
wait_for_ajax wait_for_requests
expect(page).to have_selector('.dropdown-toggle-text ', text: '1-cherry-coloured-funk') expect(page).to have_selector('.dropdown-toggle-text ', text: '1-cherry-coloured-funk')
expect(current_path).to eq namespace_project_tree_path(project.namespace, project, '1-cherry-coloured-funk') expect(current_path).to eq namespace_project_tree_path(project.namespace, project, '1-cherry-coloured-funk')
......
...@@ -16,7 +16,7 @@ describe 'Dropdown author', js: true, feature: true do ...@@ -16,7 +16,7 @@ describe 'Dropdown author', js: true, feature: true do
end end
sleep 0.5 sleep 0.5
wait_for_ajax wait_for_requests
end end
def dropdown_author_size def dropdown_author_size
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Dropdown weight', js: true, feature: true do describe 'Dropdown weight', js: true, feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user) } let!(:user) { create(:user) }
...@@ -13,7 +12,7 @@ describe 'Dropdown weight', js: true, feature: true do ...@@ -13,7 +12,7 @@ describe 'Dropdown weight', js: true, feature: true do
input.split("").each do |i| input.split("").each do |i|
filtered_search.send_keys(i) filtered_search.send_keys(i)
sleep 3 sleep 3
wait_for_ajax wait_for_requests
end end
end end
......
...@@ -761,7 +761,7 @@ describe 'Filter issues', js: true, feature: true do ...@@ -761,7 +761,7 @@ describe 'Filter issues', js: true, feature: true do
sort_toggle.click sort_toggle.click
find('.filtered-search-wrapper .dropdown-menu li a', text: 'Oldest updated').click find('.filtered-search-wrapper .dropdown-menu li a', text: 'Oldest updated').click
wait_for_ajax wait_for_requests
expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(old_issue.title) expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(old_issue.title)
end end
...@@ -778,17 +778,17 @@ describe 'Filter issues', js: true, feature: true do ...@@ -778,17 +778,17 @@ describe 'Filter issues', js: true, feature: true do
it 'open state' do it 'open state' do
find('.issues-state-filters a', text: 'Closed').click find('.issues-state-filters a', text: 'Closed').click
wait_for_ajax wait_for_requests
find('.issues-state-filters a', text: 'Open').click find('.issues-state-filters a', text: 'Open').click
wait_for_ajax wait_for_requests
expect(page).to have_selector('.issues-list .issue', count: 4) expect(page).to have_selector('.issues-list .issue', count: 4)
end end
it 'closed state' do it 'closed state' do
find('.issues-state-filters a', text: 'Closed').click find('.issues-state-filters a', text: 'Closed').click
wait_for_ajax wait_for_requests
expect(page).to have_selector('.issues-list .issue', count: 1) expect(page).to have_selector('.issues-list .issue', count: 1)
expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(closed_issue.title) expect(find('.issues-list .issue:first-of-type .issue-title-text a')).to have_content(closed_issue.title)
...@@ -796,7 +796,7 @@ describe 'Filter issues', js: true, feature: true do ...@@ -796,7 +796,7 @@ describe 'Filter issues', js: true, feature: true do
it 'all state' do it 'all state' do
find('.issues-state-filters a', text: 'All').click find('.issues-state-filters a', text: 'All').click
wait_for_ajax wait_for_requests
expect(page).to have_selector('.issues-list .issue', count: 5) expect(page).to have_selector('.issues-list .issue', count: 5)
end end
......
...@@ -2,7 +2,6 @@ require 'rails_helper' ...@@ -2,7 +2,6 @@ require 'rails_helper'
describe 'Filter issues weight', js: true, feature: true do describe 'Filter issues weight', js: true, feature: true do
include FilteredSearchHelpers include FilteredSearchHelpers
include WaitForAjax
let!(:project) { create(:empty_project) } let!(:project) { create(:empty_project) }
let!(:user) { create(:user, name: 'administrator', username: 'root') } let!(:user) { create(:user, name: 'administrator', username: 'root') }
......
...@@ -3,7 +3,6 @@ require 'rails_helper' ...@@ -3,7 +3,6 @@ require 'rails_helper'
describe 'New/edit issue', :feature, :js do describe 'New/edit issue', :feature, :js do
include GitlabRoutingHelper include GitlabRoutingHelper
include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::JavaScriptHelper
include WaitForAjax
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:user) { create(:user)} let!(:user) { create(:user)}
...@@ -28,7 +27,7 @@ describe 'New/edit issue', :feature, :js do ...@@ -28,7 +27,7 @@ describe 'New/edit issue', :feature, :js do
before do before do
click_button 'Unassigned' click_button 'Unassigned'
wait_for_ajax wait_for_requests
end end
it 'unselects other assignees when unassigned is selected' do it 'unselects other assignees when unassigned is selected' do
...@@ -69,7 +68,7 @@ describe 'New/edit issue', :feature, :js do ...@@ -69,7 +68,7 @@ describe 'New/edit issue', :feature, :js do
expect(find('a', text: 'Assign to me')).to be_visible expect(find('a', text: 'Assign to me')).to be_visible
click_button 'Unassigned' click_button 'Unassigned'
wait_for_ajax wait_for_requests
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
click_link user2.name click_link user2.name
...@@ -168,7 +167,7 @@ describe 'New/edit issue', :feature, :js do ...@@ -168,7 +167,7 @@ describe 'New/edit issue', :feature, :js do
it 'correctly updates the selected user when changing assignee' do it 'correctly updates the selected user when changing assignee' do
click_button 'Unassigned' click_button 'Unassigned'
wait_for_ajax wait_for_requests
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
click_link user.name click_link user.name
......
...@@ -11,7 +11,7 @@ feature 'GFM autocomplete', feature: true, js: true do ...@@ -11,7 +11,7 @@ feature 'GFM autocomplete', feature: true, js: true do
login_as(user) login_as(user)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_ajax wait_for_requests
end end
it 'opens autocomplete menu when field starts with text' do it 'opens autocomplete menu when field starts with text' do
...@@ -40,7 +40,7 @@ feature 'GFM autocomplete', feature: true, js: true do ...@@ -40,7 +40,7 @@ feature 'GFM autocomplete', feature: true, js: true do
expect(page).to have_selector('.atwho-container') expect(page).to have_selector('.atwho-container')
wait_for_ajax wait_for_requests
expect(find('#at-view-58')).not_to have_selector('.cur:first-of-type') expect(find('#at-view-58')).not_to have_selector('.cur:first-of-type')
end end
...@@ -80,7 +80,7 @@ feature 'GFM autocomplete', feature: true, js: true do ...@@ -80,7 +80,7 @@ feature 'GFM autocomplete', feature: true, js: true do
expect(page).to have_selector('.atwho-container') expect(page).to have_selector('.atwho-container')
wait_for_ajax wait_for_requests
expect(find('#at-view-64')).to have_selector('.cur:first-of-type') expect(find('#at-view-64')).to have_selector('.cur:first-of-type')
end end
...@@ -93,7 +93,7 @@ feature 'GFM autocomplete', feature: true, js: true do ...@@ -93,7 +93,7 @@ feature 'GFM autocomplete', feature: true, js: true do
expect(page).to have_selector('.atwho-container') expect(page).to have_selector('.atwho-container')
wait_for_ajax wait_for_requests
expect(find('#at-view-64')).to have_content(user.name) expect(find('#at-view-64')).to have_content(user.name)
end end
...@@ -106,7 +106,7 @@ feature 'GFM autocomplete', feature: true, js: true do ...@@ -106,7 +106,7 @@ feature 'GFM autocomplete', feature: true, js: true do
expect(page).to have_selector('.atwho-container') expect(page).to have_selector('.atwho-container')
wait_for_ajax wait_for_requests
expect(find('#at-view-58')).to have_selector('.cur:first-of-type') expect(find('#at-view-58')).to have_selector('.cur:first-of-type')
end end
......
...@@ -23,7 +23,7 @@ feature 'Issue Sidebar', feature: true do ...@@ -23,7 +23,7 @@ feature 'Issue Sidebar', feature: true do
find('.block.assignee .edit-link').click find('.block.assignee .edit-link').click
wait_for_ajax wait_for_requests
end end
it 'shows author in assignee dropdown' do it 'shows author in assignee dropdown' do
...@@ -37,7 +37,7 @@ feature 'Issue Sidebar', feature: true do ...@@ -37,7 +37,7 @@ feature 'Issue Sidebar', feature: true do
find('.dropdown-input-field').native.send_keys user2.name find('.dropdown-input-field').native.send_keys user2.name
sleep 1 # Required to wait for end of input delay sleep 1 # Required to wait for end of input delay
wait_for_ajax wait_for_requests
expect(page).to have_content(user2.name) expect(page).to have_content(user2.name)
end end
...@@ -48,7 +48,7 @@ feature 'Issue Sidebar', feature: true do ...@@ -48,7 +48,7 @@ feature 'Issue Sidebar', feature: true do
click_button 'assign yourself' click_button 'assign yourself'
wait_for_ajax wait_for_requests
find('.block.assignee .edit-link').click find('.block.assignee .edit-link').click
......
...@@ -15,7 +15,7 @@ describe 'Create notes on issues', :js, :feature do ...@@ -15,7 +15,7 @@ describe 'Create notes on issues', :js, :feature do
fill_in 'note[note]', with: note_text fill_in 'note[note]', with: note_text
click_button 'Comment' click_button 'Comment'
wait_for_ajax wait_for_requests
end end
it 'creates a note with reference and cross references the issue' do it 'creates a note with reference and cross references the issue' do
......
...@@ -108,11 +108,11 @@ feature 'Multiple issue updating from issues#index', feature: true do ...@@ -108,11 +108,11 @@ feature 'Multiple issue updating from issues#index', feature: true do
def click_update_assignee_button def click_update_assignee_button
find('.js-update-assignee').click find('.js-update-assignee').click
wait_for_ajax wait_for_requests
end end
def click_update_issues_button def click_update_issues_button
find('.update_selected_issues').click find('.update_selected_issues').click
wait_for_ajax wait_for_requests
end end
end end
...@@ -18,7 +18,7 @@ feature 'Issues > User uses slash commands', feature: true, js: true do ...@@ -18,7 +18,7 @@ feature 'Issues > User uses slash commands', feature: true, js: true do
end end
after do after do
wait_for_ajax wait_for_requests
end end
describe 'adding a due date from note' do describe 'adding a due date from note' do
......
...@@ -388,7 +388,7 @@ describe 'Issues', feature: true do ...@@ -388,7 +388,7 @@ describe 'Issues', feature: true do
previous_token = find('input#issue_email').value previous_token = find('input#issue_email').value
find('.incoming-email-token-reset').trigger('click') find('.incoming-email-token-reset').trigger('click')
wait_for_ajax wait_for_requests
expect(page).to have_no_field('issue_email', with: previous_token) expect(page).to have_no_field('issue_email', with: previous_token)
new_token = project1.new_issue_address(@user.reload) new_token = project1.new_issue_address(@user.reload)
...@@ -434,7 +434,7 @@ describe 'Issues', feature: true do ...@@ -434,7 +434,7 @@ describe 'Issues', feature: true do
expect(page).to have_content 'No assignee' expect(page).to have_content 'No assignee'
end end
# wait_for_ajax does not work with vue-resource at the moment # wait_for_requests does not work with vue-resource at the moment
sleep 1 sleep 1
expect(issue.reload.assignees).to be_empty expect(issue.reload.assignees).to be_empty
...@@ -697,7 +697,7 @@ describe 'Issues', feature: true do ...@@ -697,7 +697,7 @@ describe 'Issues', feature: true do
click_button date.day click_button date.day
end end
wait_for_ajax wait_for_requests
expect(find('.value').text).to have_content date.strftime('%b %-d, %Y') expect(find('.value').text).to have_content date.strftime('%b %-d, %Y')
end end
...@@ -713,7 +713,7 @@ describe 'Issues', feature: true do ...@@ -713,7 +713,7 @@ describe 'Issues', feature: true do
click_button date.day click_button date.day
end end
wait_for_ajax wait_for_requests
expect(page).to have_no_content 'No due date' expect(page).to have_no_content 'No due date'
...@@ -725,7 +725,7 @@ describe 'Issues', feature: true do ...@@ -725,7 +725,7 @@ describe 'Issues', feature: true do
end end
describe 'title issue#show', js: true do describe 'title issue#show', js: true do
include WaitForVueResource include WaitForRequests
it 'updates the title', js: true do it 'updates the title', js: true do
issue = create(:issue, author: @user, assignees: [@user], project: project, title: 'new title') issue = create(:issue, author: @user, assignees: [@user], project: project, title: 'new title')
...@@ -736,7 +736,7 @@ describe 'Issues', feature: true do ...@@ -736,7 +736,7 @@ describe 'Issues', feature: true do
issue.update(title: "updated title") issue.update(title: "updated title")
wait_for_vue_resource wait_for_requests
expect(page).to have_text("updated title") expect(page).to have_text("updated title")
end end
end end
......
require 'rails_helper' require 'rails_helper'
feature 'Merge request approvals', js: true, feature: true do feature 'Merge request approvals', js: true, feature: true do
include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, approvals_before_merge: 1) } let(:project) { create(:project, approvals_before_merge: 1) }
...@@ -74,7 +72,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -74,7 +72,7 @@ feature 'Merge request approvals', js: true, feature: true do
visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' }) visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' })
find('#s2id_merge_request_approver_group_ids .select2-input').click find('#s2id_merge_request_approver_group_ids .select2-input').click
wait_for_vue_resource wait_for_requests
expect(find('.select2-results')).to have_content(group.name) expect(find('.select2-results')).to have_content(group.name)
...@@ -103,7 +101,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -103,7 +101,7 @@ feature 'Merge request approvals', js: true, feature: true do
click_on("Submit merge request") click_on("Submit merge request")
wait_for_vue_resource wait_for_requests
expect(page).not_to have_selector(".approvals-required-text a[title='#{other_user.name}']") expect(page).not_to have_selector(".approvals-required-text a[title='#{other_user.name}']")
expect(page).to have_selector(".approvals-required-text a[title='#{approver.name}']") expect(page).to have_selector(".approvals-required-text a[title='#{approver.name}']")
...@@ -129,14 +127,14 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -129,14 +127,14 @@ feature 'Merge request approvals', js: true, feature: true do
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request) visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
find('#s2id_merge_request_approver_group_ids .select2-input').click find('#s2id_merge_request_approver_group_ids .select2-input').click
wait_for_vue_resource wait_for_requests
expect(find('.select2-results')).to have_content(group.name) expect(find('.select2-results')).to have_content(group.name)
find('.select2-results').click find('.select2-results').click
click_on("Save changes") click_on("Save changes")
wait_for_vue_resource wait_for_requests
find('.approvals-components') find('.approvals-components')
expect(page).to have_content("Requires 1 more approval") expect(page).to have_content("Requires 1 more approval")
end end
...@@ -236,7 +234,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -236,7 +234,7 @@ feature 'Merge request approvals', js: true, feature: true do
it 'I am able to approve' do it 'I am able to approve' do
approve_merge_request approve_merge_request
wait_for_vue_resource wait_for_requests
expect(page).to have_content('Approved by') expect(page).to have_content('Approved by')
expect(page).to have_css('.approver-avatar') expect(page).to have_css('.approver-avatar')
end end
...@@ -260,7 +258,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -260,7 +258,7 @@ feature 'Merge request approvals', js: true, feature: true do
# before approval status is loaded # before approval status is loaded
expect(page).to have_button('Merge when pipeline succeeds', disabled: true) expect(page).to have_button('Merge when pipeline succeeds', disabled: true)
wait_for_vue_resource wait_for_requests
# after approval status is loaded # after approval status is loaded
expect(page).to have_button('Merge when pipeline succeeds', disabled: true) expect(page).to have_button('Merge when pipeline succeeds', disabled: true)
...@@ -286,7 +284,7 @@ feature 'Merge request approvals', js: true, feature: true do ...@@ -286,7 +284,7 @@ feature 'Merge request approvals', js: true, feature: true do
# before approval status is loaded # before approval status is loaded
expect(page).to have_button("Rebase", disabled: true) expect(page).to have_button("Rebase", disabled: true)
wait_for_vue_resource wait_for_requests
# after approval status is loaded # after approval status is loaded
expect(page).to have_button("Rebase", disabled: true) expect(page).to have_button("Rebase", disabled: true)
...@@ -321,12 +319,12 @@ def approve_merge_request ...@@ -321,12 +319,12 @@ def approve_merge_request
page.within '.mr-state-widget' do page.within '.mr-state-widget' do
find('.approve-btn').click find('.approve-btn').click
end end
wait_for_vue_resource wait_for_requests
end end
def unapprove_merge_request def unapprove_merge_request
page.within '.mr-state-widget' do page.within '.mr-state-widget' do
find('.unapprove-btn-wrap').click find('.unapprove-btn-wrap').click
end end
wait_for_vue_resource wait_for_requests
end end
require 'spec_helper' require 'spec_helper'
feature 'Merge Request closing issues message', feature: true, js: true do feature 'Merge Request closing issues message', feature: true, js: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:issue_1) { create(:issue, project: project)} let(:issue_1) { create(:issue, project: project)}
...@@ -25,7 +23,7 @@ feature 'Merge Request closing issues message', feature: true, js: true do ...@@ -25,7 +23,7 @@ feature 'Merge Request closing issues message', feature: true, js: true do
login_as user login_as user
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit namespace_project_merge_request_path(project.namespace, project, merge_request)
wait_for_ajax wait_for_requests
end end
context 'not closing or mentioning any issue' do context 'not closing or mentioning any issue' do
...@@ -93,7 +91,7 @@ feature 'Merge Request closing issues message', feature: true, js: true do ...@@ -93,7 +91,7 @@ feature 'Merge Request closing issues message', feature: true, js: true do
let(:merge_request_description) { "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}" } let(:merge_request_description) { "Description\n\nclosing #{issue_1.to_reference}, #{issue_2.to_reference}" }
it 'displays closing issue message exactly one time' do it 'displays closing issue message exactly one time' do
wait_for_ajax wait_for_requests
expect(page).to have_content("Closes issues #{issue_1.to_reference} and #{issue_2.to_reference}", count: 1) expect(page).to have_content("Closes issues #{issue_1.to_reference} and #{issue_2.to_reference}", count: 1)
end end
end end
......
...@@ -23,13 +23,13 @@ feature 'Merge request conflict resolution', js: true, feature: true do ...@@ -23,13 +23,13 @@ feature 'Merge request conflict resolution', js: true, feature: true do
end end
click_button 'Commit conflict resolution' click_button 'Commit conflict resolution'
wait_for_ajax wait_for_requests
expect(page).to have_content('All merge conflicts were resolved') expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff merge_request.reload_diff
click_on 'Changes' click_on 'Changes'
wait_for_ajax wait_for_requests
within find('.diff-file', text: 'files/ruby/popen.rb') do within find('.diff-file', text: 'files/ruby/popen.rb') do
expect(page).to have_selector('.line_content.new', text: "vars = { 'PWD' => path }") expect(page).to have_selector('.line_content.new', text: "vars = { 'PWD' => path }")
...@@ -53,23 +53,23 @@ feature 'Merge request conflict resolution', js: true, feature: true do ...@@ -53,23 +53,23 @@ feature 'Merge request conflict resolution', js: true, feature: true do
within find('.files-wrapper .diff-file', text: 'files/ruby/popen.rb') do within find('.files-wrapper .diff-file', text: 'files/ruby/popen.rb') do
click_button 'Edit inline' click_button 'Edit inline'
wait_for_ajax wait_for_requests
execute_script('ace.edit($(".files-wrapper .diff-file pre")[0]).setValue("One morning");') execute_script('ace.edit($(".files-wrapper .diff-file pre")[0]).setValue("One morning");')
end end
within find('.files-wrapper .diff-file', text: 'files/ruby/regex.rb') do within find('.files-wrapper .diff-file', text: 'files/ruby/regex.rb') do
click_button 'Edit inline' click_button 'Edit inline'
wait_for_ajax wait_for_requests
execute_script('ace.edit($(".files-wrapper .diff-file pre")[1]).setValue("Gregor Samsa woke from troubled dreams");') execute_script('ace.edit($(".files-wrapper .diff-file pre")[1]).setValue("Gregor Samsa woke from troubled dreams");')
end end
click_button 'Commit conflict resolution' click_button 'Commit conflict resolution'
wait_for_ajax wait_for_requests
expect(page).to have_content('All merge conflicts were resolved') expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff merge_request.reload_diff
click_on 'Changes' click_on 'Changes'
wait_for_ajax wait_for_requests
expect(page).to have_content('One morning') expect(page).to have_content('One morning')
expect(page).to have_content('Gregor Samsa woke from troubled dreams') expect(page).to have_content('Gregor Samsa woke from troubled dreams')
...@@ -126,21 +126,21 @@ feature 'Merge request conflict resolution', js: true, feature: true do ...@@ -126,21 +126,21 @@ feature 'Merge request conflict resolution', js: true, feature: true do
it 'conflicts are resolved in Edit inline mode' do it 'conflicts are resolved in Edit inline mode' do
within find('.files-wrapper .diff-file', text: 'files/markdown/ruby-style-guide.md') do within find('.files-wrapper .diff-file', text: 'files/markdown/ruby-style-guide.md') do
wait_for_ajax wait_for_requests
execute_script('ace.edit($(".files-wrapper .diff-file pre")[0]).setValue("Gregor Samsa woke from troubled dreams");') execute_script('ace.edit($(".files-wrapper .diff-file pre")[0]).setValue("Gregor Samsa woke from troubled dreams");')
end end
click_button 'Commit conflict resolution' click_button 'Commit conflict resolution'
wait_for_ajax wait_for_requests
expect(page).to have_content('All merge conflicts were resolved') expect(page).to have_content('All merge conflicts were resolved')
merge_request.reload_diff merge_request.reload_diff
click_on 'Changes' click_on 'Changes'
wait_for_ajax wait_for_requests
click_link 'Expand all' click_link 'Expand all'
wait_for_ajax wait_for_requests
expect(page).to have_content('Gregor Samsa woke from troubled dreams') expect(page).to have_content('Gregor Samsa woke from troubled dreams')
end end
...@@ -171,7 +171,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do ...@@ -171,7 +171,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do
it 'shows an error if the conflicts page is visited directly' do it 'shows an error if the conflicts page is visited directly' do
visit current_url + '/conflicts' visit current_url + '/conflicts'
wait_for_ajax wait_for_requests
expect(find('#conflicts')).to have_content('Please try to resolve them locally.') expect(find('#conflicts')).to have_content('Please try to resolve them locally.')
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Create New Merge Request', feature: true, js: true do feature 'Create New Merge Request', feature: true, js: true do
include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
...@@ -175,7 +173,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -175,7 +173,7 @@ feature 'Create New Merge Request', feature: true, js: true do
page.within('.merge-request') do page.within('.merge-request') do
click_link 'Pipelines' click_link 'Pipelines'
wait_for_vue_resource wait_for_requests
expect(page).to have_content "##{pipeline.id}" expect(page).to have_content "##{pipeline.id}"
end end
......
...@@ -32,7 +32,7 @@ describe 'Deleted source branch', feature: true, js: true do ...@@ -32,7 +32,7 @@ describe 'Deleted source branch', feature: true, js: true do
end end
click_on 'Changes' click_on 'Changes'
wait_for_ajax wait_for_requests
expect(page).to have_selector('.diffs.tab-pane .nothing-here-block') expect(page).to have_selector('.diffs.tab-pane .nothing-here-block')
expect(page).to have_content('Source branch does not exist.') expect(page).to have_content('Source branch does not exist.')
......
...@@ -60,7 +60,7 @@ feature 'Diff note avatars', feature: true, js: true do ...@@ -60,7 +60,7 @@ feature 'Diff note avatars', feature: true, js: true do
click_button 'Comment' click_button 'Comment'
wait_for_ajax wait_for_requests
end end
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit namespace_project_merge_request_path(project.namespace, project, merge_request)
...@@ -76,7 +76,7 @@ feature 'Diff note avatars', feature: true, js: true do ...@@ -76,7 +76,7 @@ feature 'Diff note avatars', feature: true, js: true do
before do before do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: view) visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: view)
wait_for_ajax wait_for_requests
end end
it 'shows note avatar' do it 'shows note avatar' do
...@@ -114,7 +114,7 @@ feature 'Diff note avatars', feature: true, js: true do ...@@ -114,7 +114,7 @@ feature 'Diff note avatars', feature: true, js: true do
find('.js-note-delete').click find('.js-note-delete').click
end end
wait_for_ajax wait_for_requests
page.within find("[id='#{position.line_code(project.repository)}']") do page.within find("[id='#{position.line_code(project.repository)}']") do
expect(page).not_to have_selector('img.js-diff-comment-avatar') expect(page).not_to have_selector('img.js-diff-comment-avatar')
...@@ -129,7 +129,7 @@ feature 'Diff note avatars', feature: true, js: true do ...@@ -129,7 +129,7 @@ feature 'Diff note avatars', feature: true, js: true do
click_button 'Comment' click_button 'Comment'
wait_for_ajax wait_for_requests
end end
page.within find("[id='#{position.line_code(project.repository)}']") do page.within find("[id='#{position.line_code(project.repository)}']") do
...@@ -148,7 +148,7 @@ feature 'Diff note avatars', feature: true, js: true do ...@@ -148,7 +148,7 @@ feature 'Diff note avatars', feature: true, js: true do
find('.js-comment-button').trigger 'click' find('.js-comment-button').trigger 'click'
wait_for_ajax wait_for_requests
end end
end end
...@@ -166,7 +166,7 @@ feature 'Diff note avatars', feature: true, js: true do ...@@ -166,7 +166,7 @@ feature 'Diff note avatars', feature: true, js: true do
visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: view) visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, view: view)
wait_for_ajax wait_for_requests
end end
it 'shows extra comment count' do it 'shows extra comment count' do
......
...@@ -289,7 +289,7 @@ describe 'Filter merge requests', feature: true do ...@@ -289,7 +289,7 @@ describe 'Filter merge requests', feature: true do
page.within '.dropdown-menu-sort' do page.within '.dropdown-menu-sort' do
click_link 'Oldest created' click_link 'Oldest created'
end end
wait_for_ajax wait_for_requests
page.within '.mr-list' do page.within '.mr-list' do
expect(page).to have_content('Frontend') expect(page).to have_content('Frontend')
......
...@@ -37,9 +37,9 @@ feature 'Merge immediately', :feature, :js do ...@@ -37,9 +37,9 @@ feature 'Merge immediately', :feature, :js do
Sidekiq::Testing.fake! do Sidekiq::Testing.fake! do
click_link 'Merge immediately' click_link 'Merge immediately'
expect(find('.accept-merge-request.btn-info')).to have_content('Merge in progress') wait_for_requests
wait_for_vue_resource expect(find('.accept-merge-request.btn-info')).to have_content('Merge in progress')
end end
end end
end end
......
...@@ -56,7 +56,7 @@ feature 'Mini Pipeline Graph', :js, :feature do ...@@ -56,7 +56,7 @@ feature 'Mini Pipeline Graph', :js, :feature do
before do before do
toggle.click toggle.click
wait_for_ajax wait_for_requests
end end
it 'should open when toggle is clicked' do it 'should open when toggle is clicked' do
......
require 'spec_helper' require 'spec_helper'
feature 'Only allow merge requests to be merged if the pipeline succeeds', feature: true, js: true do feature 'Only allow merge requests to be merged if the pipeline succeeds', feature: true, js: true do
include WaitForVueResource
let(:merge_request) { create(:merge_request_with_diffs) } let(:merge_request) { create(:merge_request_with_diffs) }
let(:project) { merge_request.target_project } let(:project) { merge_request.target_project }
...@@ -16,7 +14,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -16,7 +14,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'allows MR to be merged' do it 'allows MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge' expect(page).to have_button 'Merge'
end end
...@@ -44,7 +42,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -44,7 +42,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'does not allow to merge immediately' do it 'does not allow to merge immediately' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge when pipeline succeeds' expect(page).to have_button 'Merge when pipeline succeeds'
expect(page).not_to have_button 'Select merge moment' expect(page).not_to have_button 'Select merge moment'
...@@ -57,7 +55,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -57,7 +55,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'does not allow MR to be merged' do it 'does not allow MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_css('button[disabled="disabled"]', text: 'Merge') expect(page).to have_css('button[disabled="disabled"]', text: 'Merge')
expect(page).to have_content('Please retry the job or push a new commit to fix the failure.') expect(page).to have_content('Please retry the job or push a new commit to fix the failure.')
...@@ -70,7 +68,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -70,7 +68,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'does not allow MR to be merged' do it 'does not allow MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).not_to have_button 'Merge' expect(page).not_to have_button 'Merge'
expect(page).to have_content('Please retry the job or push a new commit to fix the failure.') expect(page).to have_content('Please retry the job or push a new commit to fix the failure.')
...@@ -83,7 +81,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -83,7 +81,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'allows MR to be merged' do it 'allows MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge' expect(page).to have_button 'Merge'
end end
...@@ -95,7 +93,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -95,7 +93,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'allows MR to be merged' do it 'allows MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge' expect(page).to have_button 'Merge'
end end
...@@ -113,7 +111,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -113,7 +111,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'allows MR to be merged immediately' do it 'allows MR to be merged immediately' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge when pipeline succeeds' expect(page).to have_button 'Merge when pipeline succeeds'
...@@ -128,7 +126,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -128,7 +126,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'allows MR to be merged' do it 'allows MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge' expect(page).to have_button 'Merge'
end end
...@@ -140,7 +138,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu ...@@ -140,7 +138,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu
it 'allows MR to be merged' do it 'allows MR to be merged' do
visit_merge_request(merge_request) visit_merge_request(merge_request)
wait_for_vue_resource wait_for_requests
expect(page).to have_button 'Merge' expect(page).to have_button 'Merge'
end end
......
...@@ -26,7 +26,7 @@ feature 'Pipelines for Merge Requests', feature: true, js: true do ...@@ -26,7 +26,7 @@ feature 'Pipelines for Merge Requests', feature: true, js: true do
page.within('.merge-request-tabs') do page.within('.merge-request-tabs') do
click_link('Pipelines') click_link('Pipelines')
end end
wait_for_ajax wait_for_requests
expect(page).to have_selector('.pipeline-actions') expect(page).to have_selector('.pipeline-actions')
end end
......
require 'spec_helper' require 'spec_helper'
feature 'Squashing merge requests', js: true, feature: true do feature 'Squashing merge requests', js: true, feature: true do
include WaitForAjax
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:source_branch) { 'csv' } let(:source_branch) { 'csv' }
...@@ -67,7 +65,7 @@ feature 'Squashing merge requests', js: true, feature: true do ...@@ -67,7 +65,7 @@ feature 'Squashing merge requests', js: true, feature: true do
visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch })
check 'merge_request[squash]' check 'merge_request[squash]'
click_on 'Submit merge request' click_on 'Submit merge request'
wait_for_ajax wait_for_requests
end end
it 'shows the squash checkbox as checked' do it 'shows the squash checkbox as checked' do
...@@ -96,7 +94,7 @@ feature 'Squashing merge requests', js: true, feature: true do ...@@ -96,7 +94,7 @@ feature 'Squashing merge requests', js: true, feature: true do
before do before do
visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: source_branch })
click_on 'Submit merge request' click_on 'Submit merge request'
wait_for_ajax wait_for_requests
end end
it 'shows the squash checkbox as unchecked' do it 'shows the squash checkbox as unchecked' do
......
...@@ -107,7 +107,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t ...@@ -107,7 +107,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
def change_assignee(text) def change_assignee(text)
find('#check_all_issues').click find('#check_all_issues').click
find('.js-update-assignee').click find('.js-update-assignee').click
wait_for_ajax wait_for_requests
page.within '.dropdown-menu-user' do page.within '.dropdown-menu-user' do
click_link text click_link text
...@@ -125,6 +125,6 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t ...@@ -125,6 +125,6 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t
def click_update_merge_requests_button def click_update_merge_requests_button
find('.update_selected_issues').click find('.update_selected_issues').click
wait_for_ajax wait_for_requests
end end
end end
...@@ -73,7 +73,7 @@ feature 'Merge requests > User posts diff notes', :js do ...@@ -73,7 +73,7 @@ feature 'Merge requests > User posts diff notes', :js do
context 'with an unfolded line' do context 'with an unfolded line' do
before(:each) do before(:each) do
find('.js-unfold', match: :first).click find('.js-unfold', match: :first).click
wait_for_ajax wait_for_requests
end end
# The first `.js-unfold` unfolds upwards, therefore the first # The first `.js-unfold` unfolds upwards, therefore the first
...@@ -122,7 +122,7 @@ feature 'Merge requests > User posts diff notes', :js do ...@@ -122,7 +122,7 @@ feature 'Merge requests > User posts diff notes', :js do
context 'with an unfolded line' do context 'with an unfolded line' do
before(:each) do before(:each) do
find('.js-unfold', match: :first).click find('.js-unfold', match: :first).click
wait_for_ajax wait_for_requests
end end
# The first `.js-unfold` unfolds upwards, therefore the first # The first `.js-unfold` unfolds upwards, therefore the first
...@@ -213,7 +213,7 @@ feature 'Merge requests > User posts diff notes', :js do ...@@ -213,7 +213,7 @@ feature 'Merge requests > User posts diff notes', :js do
write_comment_on_line(line_holder, diff_side) write_comment_on_line(line_holder, diff_side)
click_button 'Comment' click_button 'Comment'
wait_for_ajax wait_for_requests
assert_comment_persistence(line_holder, asset_form_reset: asset_form_reset) assert_comment_persistence(line_holder, asset_form_reset: asset_form_reset)
end end
......
...@@ -98,7 +98,7 @@ describe 'Merge requests > User posts notes', :js do ...@@ -98,7 +98,7 @@ describe 'Merge requests > User posts notes', :js do
find('.btn-save').click find('.btn-save').click
end end
wait_for_ajax wait_for_requests
find('.note').hover find('.note').hover
find('.js-note-edit').click find('.js-note-edit').click
...@@ -139,7 +139,7 @@ describe 'Merge requests > User posts notes', :js do ...@@ -139,7 +139,7 @@ describe 'Merge requests > User posts notes', :js do
find('.js-note-attachment-delete').click find('.js-note-attachment-delete').click
is_expected.not_to have_css('.note-attachment') is_expected.not_to have_css('.note-attachment')
is_expected.not_to have_css('.current-note-edit-form') is_expected.not_to have_css('.current-note-edit-form')
wait_for_ajax wait_for_requests
end end
end end
end end
......
...@@ -21,7 +21,7 @@ feature 'Merge Requests > User uses slash commands', feature: true, js: true do ...@@ -21,7 +21,7 @@ feature 'Merge Requests > User uses slash commands', feature: true, js: true do
end end
after do after do
wait_for_ajax wait_for_requests
end end
describe 'toggling the WIP prefix in the title from note' do describe 'toggling the WIP prefix in the title from note' do
...@@ -160,7 +160,7 @@ feature 'Merge Requests > User uses slash commands', feature: true, js: true do ...@@ -160,7 +160,7 @@ feature 'Merge Requests > User uses slash commands', feature: true, js: true do
it 'changes target branch from a note' do it 'changes target branch from a note' do
write_note("message start \n/target_branch merge-test\n message end.") write_note("message start \n/target_branch merge-test\n message end.")
wait_for_ajax wait_for_requests
expect(page).not_to have_content('/target_branch') expect(page).not_to have_content('/target_branch')
expect(page).to have_content('message start') expect(page).to have_content('message start')
expect(page).to have_content('message end.') expect(page).to have_content('message end.')
......
...@@ -75,7 +75,7 @@ feature 'Merge Request versions', js: true, feature: true do ...@@ -75,7 +75,7 @@ feature 'Merge Request versions', js: true, feature: true do
find(".js-comment-button").click find(".js-comment-button").click
end end
wait_for_ajax wait_for_requests
expect(page).to have_content("Typo, please fix") expect(page).to have_content("Typo, please fix")
end end
...@@ -126,7 +126,7 @@ feature 'Merge Request versions', js: true, feature: true do ...@@ -126,7 +126,7 @@ feature 'Merge Request versions', js: true, feature: true do
outdated_diff_note = create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: position) outdated_diff_note = create(:diff_note_on_merge_request, project: project, noteable: merge_request, position: position)
visit current_url visit current_url
wait_for_ajax wait_for_requests
expect(page).to have_css(".diffs .notes[data-discussion-id='#{outdated_diff_note.discussion_id}']") expect(page).to have_css(".diffs .notes[data-discussion-id='#{outdated_diff_note.discussion_id}']")
end end
...@@ -144,7 +144,7 @@ feature 'Merge Request versions', js: true, feature: true do ...@@ -144,7 +144,7 @@ feature 'Merge Request versions', js: true, feature: true do
find(".js-comment-button").click find(".js-comment-button").click
end end
wait_for_ajax wait_for_requests
expect(page).to have_content("Typo, please fix") expect(page).to have_content("Typo, please fix")
end end
......
...@@ -18,7 +18,7 @@ feature 'Widget Deployments Header', feature: true, js: true do ...@@ -18,7 +18,7 @@ feature 'Widget Deployments Header', feature: true, js: true do
end end
scenario 'displays that the environment is deployed' do scenario 'displays that the environment is deployed' do
wait_for_ajax wait_for_requests
expect(page).to have_content("Deployed to #{environment.name}") expect(page).to have_content("Deployed to #{environment.name}")
expect(find('.js-deploy-time')['data-title']).to eq(deployment.created_at.to_time.in_time_zone.to_s(:medium)) expect(find('.js-deploy-time')['data-title']).to eq(deployment.created_at.to_time.in_time_zone.to_s(:medium))
...@@ -34,7 +34,7 @@ feature 'Widget Deployments Header', feature: true, js: true do ...@@ -34,7 +34,7 @@ feature 'Widget Deployments Header', feature: true, js: true do
end end
background do background do
wait_for_ajax wait_for_requests
end end
scenario 'does show stop button' do scenario 'does show stop button' do
......
...@@ -27,7 +27,7 @@ describe 'Merge request', :feature, :js do ...@@ -27,7 +27,7 @@ describe 'Merge request', :feature, :js do
it 'shows widget status after creating new merge request' do it 'shows widget status after creating new merge request' do
click_button 'Submit merge request' click_button 'Submit merge request'
wait_for_ajax wait_for_requests
expect(page).to have_selector('.accept-merge-request') expect(page).to have_selector('.accept-merge-request')
expect(find('.accept-merge-request')['disabled']).not_to be(true) expect(find('.accept-merge-request')['disabled']).not_to be(true)
...@@ -48,7 +48,7 @@ describe 'Merge request', :feature, :js do ...@@ -48,7 +48,7 @@ describe 'Merge request', :feature, :js do
end end
it 'shows environments link' do it 'shows environments link' do
wait_for_ajax wait_for_requests
page.within('.mr-widget-heading') do page.within('.mr-widget-heading') do
expect(page).to have_content("Deployed to #{environment.name}") expect(page).to have_content("Deployed to #{environment.name}")
...@@ -58,7 +58,7 @@ describe 'Merge request', :feature, :js do ...@@ -58,7 +58,7 @@ describe 'Merge request', :feature, :js do
it 'shows green accept merge request button' do it 'shows green accept merge request button' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
expect(page).to have_selector('.accept-merge-request') expect(page).to have_selector('.accept-merge-request')
expect(find('.accept-merge-request')['disabled']).not_to be(true) expect(find('.accept-merge-request')['disabled']).not_to be(true)
end end
...@@ -76,7 +76,7 @@ describe 'Merge request', :feature, :js do ...@@ -76,7 +76,7 @@ describe 'Merge request', :feature, :js do
it 'has danger button while waiting for external CI status' do it 'has danger button while waiting for external CI status' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
expect(page).to have_selector('.accept-merge-request.btn-danger') expect(page).to have_selector('.accept-merge-request.btn-danger')
end end
end end
...@@ -98,7 +98,7 @@ describe 'Merge request', :feature, :js do ...@@ -98,7 +98,7 @@ describe 'Merge request', :feature, :js do
it 'has danger button when not succeeded' do it 'has danger button when not succeeded' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
expect(page).to have_selector('.accept-merge-request.btn-danger') expect(page).to have_selector('.accept-merge-request.btn-danger')
end end
end end
...@@ -145,7 +145,7 @@ describe 'Merge request', :feature, :js do ...@@ -145,7 +145,7 @@ describe 'Merge request', :feature, :js do
it 'has info button when MWBS button' do it 'has info button when MWBS button' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
expect(page).to have_selector('.accept-merge-request.btn-info') expect(page).to have_selector('.accept-merge-request.btn-info')
end end
end end
...@@ -163,7 +163,7 @@ describe 'Merge request', :feature, :js do ...@@ -163,7 +163,7 @@ describe 'Merge request', :feature, :js do
it 'shows information about the merge error' do it 'shows information about the merge error' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-widget-body') do
expect(page).to have_content('Something went wrong') expect(page).to have_content('Something went wrong')
...@@ -184,7 +184,7 @@ describe 'Merge request', :feature, :js do ...@@ -184,7 +184,7 @@ describe 'Merge request', :feature, :js do
it 'shows information about the merge error' do it 'shows information about the merge error' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-widget-body') do
expect(page).to have_content('Something went wrong') expect(page).to have_content('Something went wrong')
...@@ -207,7 +207,7 @@ describe 'Merge request', :feature, :js do ...@@ -207,7 +207,7 @@ describe 'Merge request', :feature, :js do
it 'shows information about the merge error' do it 'shows information about the merge error' do
# Wait for the `ci_status` and `merge_check` requests # Wait for the `ci_status` and `merge_check` requests
wait_for_ajax wait_for_requests
page.within('.mr-widget-body') do page.within('.mr-widget-body') do
expect(page).to have_content('Fast-forward merge is not possible') expect(page).to have_content('Fast-forward merge is not possible')
......
...@@ -78,7 +78,7 @@ describe 'Milestone draggable', feature: true, js: true do ...@@ -78,7 +78,7 @@ describe 'Milestone draggable', feature: true, js: true do
scroll_into_view('.milestone-content') scroll_into_view('.milestone-content')
drag_to(selector: '.issues-sortable-list', list_to_index: 1) drag_to(selector: '.issues-sortable-list', list_to_index: 1)
wait_for_ajax wait_for_requests
end end
def create_and_drag_merge_request(params = {}) def create_and_drag_merge_request(params = {})
...@@ -87,12 +87,12 @@ describe 'Milestone draggable', feature: true, js: true do ...@@ -87,12 +87,12 @@ describe 'Milestone draggable', feature: true, js: true do
visit namespace_project_milestone_path(project.namespace, project, milestone) visit namespace_project_milestone_path(project.namespace, project, milestone)
page.find("a[href='#tab-merge-requests']").click page.find("a[href='#tab-merge-requests']").click
wait_for_ajax wait_for_requests
scroll_into_view('.milestone-content') scroll_into_view('.milestone-content')
drag_to(selector: '.merge_requests-sortable-list', list_to_index: 1) drag_to(selector: '.merge_requests-sortable-list', list_to_index: 1)
wait_for_ajax wait_for_requests
end end
def scroll_into_view(selector) def scroll_into_view(selector)
......
...@@ -13,7 +13,7 @@ feature 'Artifact file', :js, feature: true do ...@@ -13,7 +13,7 @@ feature 'Artifact file', :js, feature: true do
before do before do
visit_file('other_artifacts_0.1.2/doc_sample.txt') visit_file('other_artifacts_0.1.2/doc_sample.txt')
wait_for_ajax wait_for_requests
end end
it 'displays an error' do it 'displays an error' do
...@@ -37,7 +37,7 @@ feature 'Artifact file', :js, feature: true do ...@@ -37,7 +37,7 @@ feature 'Artifact file', :js, feature: true do
before do before do
visit_file('rails_sample.jpg') visit_file('rails_sample.jpg')
wait_for_ajax wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
......
...@@ -6,12 +6,14 @@ feature 'File blob', :js, feature: true do ...@@ -6,12 +6,14 @@ feature 'File blob', :js, feature: true do
def visit_blob(path, fragment = nil) def visit_blob(path, fragment = nil)
visit namespace_project_blob_path(project.namespace, project, File.join('master', path), anchor: fragment) visit namespace_project_blob_path(project.namespace, project, File.join('master', path), anchor: fragment)
wait_for_ajax wait_for_requests
end end
context 'Ruby file' do context 'Ruby file' do
before do before do
visit_blob('files/ruby/popen.rb') visit_blob('files/ruby/popen.rb')
wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
...@@ -35,6 +37,8 @@ feature 'File blob', :js, feature: true do ...@@ -35,6 +37,8 @@ feature 'File blob', :js, feature: true do
context 'visiting directly' do context 'visiting directly' do
before do before do
visit_blob('files/markdown/ruby-style-guide.md') visit_blob('files/markdown/ruby-style-guide.md')
wait_for_requests
end end
it 'displays the blob using the rich viewer' do it 'displays the blob using the rich viewer' do
...@@ -61,7 +65,7 @@ feature 'File blob', :js, feature: true do ...@@ -61,7 +65,7 @@ feature 'File blob', :js, feature: true do
before do before do
find('.js-blob-viewer-switch-btn[data-viewer=simple]').click find('.js-blob-viewer-switch-btn[data-viewer=simple]').click
wait_for_ajax wait_for_requests
end end
it 'displays the blob using the simple viewer' do it 'displays the blob using the simple viewer' do
...@@ -82,7 +86,7 @@ feature 'File blob', :js, feature: true do ...@@ -82,7 +86,7 @@ feature 'File blob', :js, feature: true do
before do before do
find('.js-blob-viewer-switch-btn[data-viewer=rich]').click find('.js-blob-viewer-switch-btn[data-viewer=rich]').click
wait_for_ajax wait_for_requests
end end
it 'displays the blob using the rich viewer' do it 'displays the blob using the rich viewer' do
...@@ -102,6 +106,8 @@ feature 'File blob', :js, feature: true do ...@@ -102,6 +106,8 @@ feature 'File blob', :js, feature: true do
context 'visiting with a line number anchor' do context 'visiting with a line number anchor' do
before do before do
visit_blob('files/markdown/ruby-style-guide.md', 'L1') visit_blob('files/markdown/ruby-style-guide.md', 'L1')
wait_for_requests
end end
it 'displays the blob using the simple viewer' do it 'displays the blob using the simple viewer' do
...@@ -144,6 +150,8 @@ feature 'File blob', :js, feature: true do ...@@ -144,6 +150,8 @@ feature 'File blob', :js, feature: true do
project.update_attribute(:lfs_enabled, true) project.update_attribute(:lfs_enabled, true)
visit_blob('files/lfs/file.md') visit_blob('files/lfs/file.md')
wait_for_requests
end end
it 'displays an error' do it 'displays an error' do
...@@ -170,7 +178,7 @@ feature 'File blob', :js, feature: true do ...@@ -170,7 +178,7 @@ feature 'File blob', :js, feature: true do
before do before do
find('.js-blob-viewer-switcher .js-blob-viewer-switch-btn[data-viewer=simple]').click find('.js-blob-viewer-switcher .js-blob-viewer-switch-btn[data-viewer=simple]').click
wait_for_ajax wait_for_requests
end end
it 'displays an error' do it 'displays an error' do
...@@ -192,6 +200,8 @@ feature 'File blob', :js, feature: true do ...@@ -192,6 +200,8 @@ feature 'File blob', :js, feature: true do
context 'when LFS is disabled on the project' do context 'when LFS is disabled on the project' do
before do before do
visit_blob('files/lfs/file.md') visit_blob('files/lfs/file.md')
wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
...@@ -227,6 +237,8 @@ feature 'File blob', :js, feature: true do ...@@ -227,6 +237,8 @@ feature 'File blob', :js, feature: true do
).execute ).execute
visit_blob('files/test.pdf') visit_blob('files/test.pdf')
wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
...@@ -253,6 +265,8 @@ feature 'File blob', :js, feature: true do ...@@ -253,6 +265,8 @@ feature 'File blob', :js, feature: true do
project.update_attribute(:lfs_enabled, true) project.update_attribute(:lfs_enabled, true)
visit_blob('files/lfs/lfs_object.iso') visit_blob('files/lfs/lfs_object.iso')
wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
...@@ -275,6 +289,8 @@ feature 'File blob', :js, feature: true do ...@@ -275,6 +289,8 @@ feature 'File blob', :js, feature: true do
context 'when LFS is disabled on the project' do context 'when LFS is disabled on the project' do
before do before do
visit_blob('files/lfs/lfs_object.iso') visit_blob('files/lfs/lfs_object.iso')
wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
...@@ -298,6 +314,8 @@ feature 'File blob', :js, feature: true do ...@@ -298,6 +314,8 @@ feature 'File blob', :js, feature: true do
context 'ZIP file' do context 'ZIP file' do
before do before do
visit_blob('Gemfile.zip') visit_blob('Gemfile.zip')
wait_for_requests
end end
it 'displays the blob' do it 'displays the blob' do
...@@ -332,6 +350,8 @@ feature 'File blob', :js, feature: true do ...@@ -332,6 +350,8 @@ feature 'File blob', :js, feature: true do
).execute ).execute
visit_blob('files/empty.md') visit_blob('files/empty.md')
wait_for_requests
end end
it 'displays an error' do it 'displays an error' do
......
...@@ -18,7 +18,7 @@ feature 'Editing file blob', feature: true, js: true do ...@@ -18,7 +18,7 @@ feature 'Editing file blob', feature: true, js: true do
end end
def edit_and_commit def edit_and_commit
wait_for_ajax wait_for_requests
find('.js-edit-blob').click find('.js-edit-blob').click
execute_script('ace.edit("editor").setValue("class NextFeature\nend\n")') execute_script('ace.edit("editor").setValue("class NextFeature\nend\n")')
click_button 'Commit changes' click_button 'Commit changes'
......
...@@ -15,7 +15,7 @@ feature 'New blob creation', feature: true, js: true do ...@@ -15,7 +15,7 @@ feature 'New blob creation', feature: true, js: true do
end end
def edit_file def edit_file
wait_for_ajax wait_for_requests
fill_in 'file_name', with: 'feature.rb' fill_in 'file_name', with: 'feature.rb'
execute_script("ace.edit('editor').setValue('#{content}')") execute_script("ace.edit('editor').setValue('#{content}')")
end end
......
...@@ -72,11 +72,11 @@ describe 'Cherry-pick Commits' do ...@@ -72,11 +72,11 @@ describe 'Cherry-pick Commits' do
click_button 'master' click_button 'master'
end end
wait_for_ajax wait_for_requests
page.within('#modal-cherry-pick-commit .dropdown-menu') do page.within('#modal-cherry-pick-commit .dropdown-menu') do
find('.dropdown-input input').set('feature') find('.dropdown-input input').set('feature')
wait_for_ajax wait_for_requests
click_link "feature" click_link "feature"
end end
......
...@@ -32,7 +32,7 @@ feature 'Mini Pipeline Graph in Commit View', :js, :feature do ...@@ -32,7 +32,7 @@ feature 'Mini Pipeline Graph in Commit View', :js, :feature do
it 'should show the builds list when stage is clicked' do it 'should show the builds list when stage is clicked' do
first('.mini-pipeline-graph-dropdown-toggle').click first('.mini-pipeline-graph-dropdown-toggle').click
wait_for_ajax wait_for_requests
page.within '.js-builds-dropdown-list' do page.within '.js-builds-dropdown-list' do
expect(page).to have_selector('.ci-status-icon-running') expect(page).to have_selector('.ci-status-icon-running')
......
...@@ -53,7 +53,7 @@ describe "Compare", js: true do ...@@ -53,7 +53,7 @@ describe "Compare", js: true do
dropdown = find(".js-compare-#{dropdown_type}-dropdown") dropdown = find(".js-compare-#{dropdown_type}-dropdown")
dropdown.find(".compare-dropdown-toggle").click dropdown.find(".compare-dropdown-toggle").click
dropdown.fill_in("Filter by Git revision", with: selection) dropdown.fill_in("Filter by Git revision", with: selection)
wait_for_ajax wait_for_requests
dropdown.find_all("a[data-ref=\"#{selection}\"]", visible: true).last.click dropdown.find_all("a[data-ref=\"#{selection}\"]", visible: true).last.click
end end
end end
...@@ -21,7 +21,7 @@ feature 'Project edit', feature: true, js: true do ...@@ -21,7 +21,7 @@ feature 'Project edit', feature: true, js: true do
find('#project_request_access_enabled').set(true) find('#project_request_access_enabled').set(true)
click_button 'Save changes' click_button 'Save changes'
wait_for_ajax wait_for_requests
expect(find('#project_request_access_enabled')).to be_checked expect(find('#project_request_access_enabled')).to be_checked
end end
......
...@@ -21,17 +21,17 @@ describe 'Edit Project Settings', feature: true do ...@@ -21,17 +21,17 @@ describe 'Edit Project Settings', feature: true do
select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' click_button 'Save changes'
wait_for_ajax wait_for_requests
expect(page).not_to have_selector(".shortcuts-#{shortcut_name}") expect(page).not_to have_selector(".shortcuts-#{shortcut_name}")
select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' click_button 'Save changes'
wait_for_ajax wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' click_button 'Save changes'
wait_for_ajax wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
sleep 0.1 sleep 0.1
...@@ -169,7 +169,7 @@ describe 'Edit Project Settings', feature: true do ...@@ -169,7 +169,7 @@ describe 'Edit Project Settings', feature: true do
select "Disabled", from: "project_project_feature_attributes_wiki_access_level" select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes" click_button "Save changes"
wait_for_ajax wait_for_requests
visit namespace_project_path(project.namespace, project) visit namespace_project_path(project.namespace, project)
...@@ -182,7 +182,7 @@ describe 'Edit Project Settings', feature: true do ...@@ -182,7 +182,7 @@ describe 'Edit Project Settings', feature: true do
select "Disabled", from: "project_project_feature_attributes_wiki_access_level" select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes" click_button "Save changes"
wait_for_ajax wait_for_requests
visit activity_namespace_project_path(project.namespace, project) visit activity_namespace_project_path(project.namespace, project)
...@@ -223,7 +223,7 @@ describe 'Edit Project Settings', feature: true do ...@@ -223,7 +223,7 @@ describe 'Edit Project Settings', feature: true do
def save_changes_and_check_activity_tab def save_changes_and_check_activity_tab
click_button "Save changes" click_button "Save changes"
wait_for_ajax wait_for_requests
visit activity_namespace_project_path(project.namespace, project) visit activity_namespace_project_path(project.namespace, project)
......
...@@ -24,7 +24,7 @@ feature 'user browses project', feature: true, js: true do ...@@ -24,7 +24,7 @@ feature 'user browses project', feature: true, js: true do
click_link 'files' click_link 'files'
click_link 'lfs' click_link 'lfs'
click_link 'lfs_object.iso' click_link 'lfs_object.iso'
wait_for_ajax wait_for_requests
expect(page).not_to have_content 'Download (1.5 MB)' expect(page).not_to have_content 'Download (1.5 MB)'
expect(page).to have_content 'version https://git-lfs.github.com/spec/v1' expect(page).to have_content 'version https://git-lfs.github.com/spec/v1'
......
...@@ -19,14 +19,14 @@ feature 'User wants to add a Dockerfile file', feature: true do ...@@ -19,14 +19,14 @@ feature 'User wants to add a Dockerfile file', feature: true do
scenario 'user can pick a Dockerfile file from the dropdown', js: true do scenario 'user can pick a Dockerfile file from the dropdown', js: true do
find('.js-dockerfile-selector').click find('.js-dockerfile-selector').click
wait_for_ajax wait_for_requests
within '.dockerfile-selector' do within '.dockerfile-selector' do
find('.dropdown-input-field').set('HTTPd') find('.dropdown-input-field').set('HTTPd')
find('.dropdown-content li', text: 'HTTPd').click find('.dropdown-content li', text: 'HTTPd').click
end end
wait_for_ajax wait_for_requests
expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'HTTPd') expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'HTTPd')
expect(page).to have_content('COPY ./ /usr/local/apache2/htdocs/') expect(page).to have_content('COPY ./ /usr/local/apache2/htdocs/')
......
...@@ -10,7 +10,7 @@ feature 'Find file keyboard shortcuts', feature: true, js: true do ...@@ -10,7 +10,7 @@ feature 'Find file keyboard shortcuts', feature: true, js: true do
visit namespace_project_find_file_path(project.namespace, project, project.repository.root_ref) visit namespace_project_find_file_path(project.namespace, project, project.repository.root_ref)
wait_for_ajax wait_for_requests
end end
it 'opens file when pressing enter key' do it 'opens file when pressing enter key' do
......
...@@ -15,12 +15,12 @@ feature 'User wants to add a .gitignore file', feature: true do ...@@ -15,12 +15,12 @@ feature 'User wants to add a .gitignore file', feature: true do
scenario 'user can pick a .gitignore file from the dropdown', js: true do scenario 'user can pick a .gitignore file from the dropdown', js: true do
find('.js-gitignore-selector').click find('.js-gitignore-selector').click
wait_for_ajax wait_for_requests
within '.gitignore-selector' do within '.gitignore-selector' do
find('.dropdown-input-field').set('rails') find('.dropdown-input-field').set('rails')
find('.dropdown-content li', text: 'Rails').click find('.dropdown-content li', text: 'Rails').click
end end
wait_for_ajax wait_for_requests
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Rails') expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Rails')
expect(page).to have_content('/.bundle') expect(page).to have_content('/.bundle')
......
...@@ -15,12 +15,12 @@ feature 'User wants to add a .gitlab-ci.yml file', feature: true do ...@@ -15,12 +15,12 @@ feature 'User wants to add a .gitlab-ci.yml file', feature: true do
scenario 'user can pick a template from the dropdown', js: true do scenario 'user can pick a template from the dropdown', js: true do
find('.js-gitlab-ci-yml-selector').click find('.js-gitlab-ci-yml-selector').click
wait_for_ajax wait_for_requests
within '.gitlab-ci-yml-selector' do within '.gitlab-ci-yml-selector' do
find('.dropdown-input-field').set('Jekyll') find('.dropdown-input-field').set('Jekyll')
find('.dropdown-content li', text: 'Jekyll').click find('.dropdown-content li', text: 'Jekyll').click
end end
wait_for_ajax wait_for_requests
expect(page).to have_css('.gitlab-ci-yml-selector .dropdown-toggle-text', text: 'Jekyll') expect(page).to have_css('.gitlab-ci-yml-selector .dropdown-toggle-text', text: 'Jekyll')
expect(page).to have_content('This file is a template, and might need editing before it works on your project') expect(page).to have_content('This file is a template, and might need editing before it works on your project')
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment