diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-05-17 15:25:13 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-05-22 20:39:49 -0300 |
commit | 2338785ec9fcacc43ba2098ab1485fca292c06cc (patch) | |
tree | 6a4bd9bed8d995c28bb1589ef861a92c517f6fac /spec/features/issues | |
parent | 7f31768a7f1d311d7c8cedce045f5d918370b8c9 (diff) | |
download | gitlab-ce-2338785ec9fcacc43ba2098ab1485fca292c06cc.tar.gz |
Use wait_for_requests to wait all JS requestwait-for-ajax-handling-all-js-requests
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/award_emoji_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/issues/award_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/bulk_assignment_labels_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/create_branch_merge_request_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/filtered_search/dropdown_author_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/filtered_search/filter_issues_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/issues/form_spec.rb | 7 | ||||
-rw-r--r-- | spec/features/issues/gfm_autocomplete_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/issues/issue_sidebar_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/issues/notes_on_issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/update_issues_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/user_uses_slash_commands_spec.rb | 2 |
12 files changed, 36 insertions, 43 deletions
diff --git a/spec/features/issues/award_emoji_spec.rb b/spec/features/issues/award_emoji_spec.rb index 853632614c4..81ae54c7a10 100644 --- a/spec/features/issues/award_emoji_spec.rb +++ b/spec/features/issues/award_emoji_spec.rb @@ -1,8 +1,6 @@ require 'rails_helper' describe 'Awards Emoji', feature: true do - include WaitForVueResource - let!(:project) { create(:project, :public) } let!(:user) { create(:user) } let(:issue) do @@ -22,7 +20,7 @@ describe 'Awards Emoji', feature: true do # 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) visit namespace_project_issue_path(project.namespace, project, issue) - wait_for_vue_resource + wait_for_requests end # Regression test: https://gitlab.com/gitlab-org/gitlab-ce/issues/29529 @@ -36,19 +34,19 @@ describe 'Awards Emoji', feature: true do before do visit namespace_project_issue_path(project.namespace, project, issue) - wait_for_vue_resource + wait_for_requests end it 'increments the thumbsdown emoji', js: true do find('[data-name="thumbsdown"]').click - wait_for_ajax + wait_for_requests expect(thumbsdown_emoji).to have_text("1") end context 'click the thumbsup emoji' do it 'increments the thumbsup emoji', js: true do find('[data-name="thumbsup"]').click - wait_for_ajax + wait_for_requests expect(thumbsup_emoji).to have_text("1") end @@ -60,7 +58,7 @@ describe 'Awards Emoji', feature: true do context 'click the thumbsdown emoji' do it 'increments the thumbsdown emoji', js: true do find('[data-name="thumbsdown"]').click - wait_for_ajax + wait_for_requests expect(thumbsdown_emoji).to have_text("1") end @@ -113,7 +111,7 @@ describe 'Awards Emoji', feature: true do click_button 'Comment' end - wait_for_ajax + wait_for_requests end def thumbsup_emoji @@ -143,6 +141,6 @@ describe 'Awards Emoji', feature: true do find('[data-name="smiley"]').click end - wait_for_ajax + wait_for_requests end end diff --git a/spec/features/issues/award_spec.rb b/spec/features/issues/award_spec.rb index 08e3f99e29f..fcf22dd5033 100644 --- a/spec/features/issues/award_spec.rb +++ b/spec/features/issues/award_spec.rb @@ -6,12 +6,10 @@ feature 'Issue awards', js: true, feature: true do let(:issue) { create(:issue, project: project) } describe 'logged in' do - include WaitForVueResource - before do login_as(user) visit namespace_project_issue_path(project.namespace, project, issue) - wait_for_vue_resource + wait_for_requests end it 'adds award to issue' do @@ -41,11 +39,9 @@ feature 'Issue awards', js: true, feature: true do end describe 'logged out' do - include WaitForVueResource - before do visit namespace_project_issue_path(project.namespace, project, issue) - wait_for_vue_resource + wait_for_requests end it 'does not see award menu button' do diff --git a/spec/features/issues/bulk_assignment_labels_spec.rb b/spec/features/issues/bulk_assignment_labels_spec.rb index 1de50d6d77e..0a6f645b27e 100644 --- a/spec/features/issues/bulk_assignment_labels_spec.rb +++ b/spec/features/issues/bulk_assignment_labels_spec.rb @@ -306,7 +306,7 @@ feature 'Issues > Labels bulk assignment', feature: true do page.within('.issues_bulk_update') do 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: 'feature')).to have_css('.is-indeterminate') @@ -349,7 +349,7 @@ feature 'Issues > Labels bulk assignment', feature: true do def open_milestone_dropdown(items = []) page.within('.issues_bulk_update') do click_button 'Milestone' - wait_for_ajax + wait_for_requests items.map do |item| click_link item end @@ -359,7 +359,7 @@ feature 'Issues > Labels bulk assignment', feature: true do def open_labels_dropdown(items = [], unmark = false) page.within('.issues_bulk_update') do click_button 'Labels' - wait_for_ajax + wait_for_requests items.map do |item| click_link item end @@ -392,6 +392,6 @@ feature 'Issues > Labels bulk assignment', feature: true do def update_issues click_button 'Update issues' - wait_for_ajax + wait_for_requests end end diff --git a/spec/features/issues/create_branch_merge_request_spec.rb b/spec/features/issues/create_branch_merge_request_spec.rb index 44c19275ae5..1d7d8d291b2 100644 --- a/spec/features/issues/create_branch_merge_request_spec.rb +++ b/spec/features/issues/create_branch_merge_request_spec.rb @@ -16,7 +16,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js: 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("mentioned in merge request !1") @@ -32,7 +32,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js: 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(current_path).to eq namespace_project_tree_path(project.namespace, project, '1-cherry-coloured-funk') diff --git a/spec/features/issues/filtered_search/dropdown_author_spec.rb b/spec/features/issues/filtered_search/dropdown_author_spec.rb index 0579d6c80ab..b29177bed06 100644 --- a/spec/features/issues/filtered_search/dropdown_author_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_author_spec.rb @@ -16,7 +16,7 @@ describe 'Dropdown author', js: true, feature: true do end sleep 0.5 - wait_for_ajax + wait_for_requests end def dropdown_author_size diff --git a/spec/features/issues/filtered_search/filter_issues_spec.rb b/spec/features/issues/filtered_search/filter_issues_spec.rb index a8f4e2d7e10..03ff1cffb3f 100644 --- a/spec/features/issues/filtered_search/filter_issues_spec.rb +++ b/spec/features/issues/filtered_search/filter_issues_spec.rb @@ -761,7 +761,7 @@ describe 'Filter issues', js: true, feature: true do sort_toggle.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) end @@ -778,17 +778,17 @@ describe 'Filter issues', js: true, feature: true do it 'open state' do find('.issues-state-filters a', text: 'Closed').click - wait_for_ajax + wait_for_requests find('.issues-state-filters a', text: 'Open').click - wait_for_ajax + wait_for_requests expect(page).to have_selector('.issues-list .issue', count: 4) end it 'closed state' do 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(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 it 'all state' do find('.issues-state-filters a', text: 'All').click - wait_for_ajax + wait_for_requests expect(page).to have_selector('.issues-list .issue', count: 5) end diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 5c0907e26df..65d854d0896 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -3,7 +3,6 @@ require 'rails_helper' describe 'New/edit issue', :feature, :js do include GitlabRoutingHelper include ActionView::Helpers::JavaScriptHelper - include WaitForAjax let!(:project) { create(:project) } let!(:user) { create(:user)} @@ -28,7 +27,7 @@ describe 'New/edit issue', :feature, :js do before do click_button 'Unassigned' - wait_for_ajax + wait_for_requests end it 'unselects other assignees when unassigned is selected' do @@ -69,7 +68,7 @@ describe 'New/edit issue', :feature, :js do expect(find('a', text: 'Assign to me')).to be_visible click_button 'Unassigned' - wait_for_ajax + wait_for_requests page.within '.dropdown-menu-user' do click_link user2.name @@ -155,7 +154,7 @@ describe 'New/edit issue', :feature, :js do it 'correctly updates the selected user when changing assignee' do click_button 'Unassigned' - wait_for_ajax + wait_for_requests page.within '.dropdown-menu-user' do click_link user.name diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index ad29911248f..350473437a8 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -11,7 +11,7 @@ feature 'GFM autocomplete', feature: true, js: true do login_as(user) visit namespace_project_issue_path(project.namespace, project, issue) - wait_for_ajax + wait_for_requests end it 'opens autocomplete menu when field starts with text' do @@ -40,7 +40,7 @@ feature 'GFM autocomplete', feature: true, js: true do 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') end @@ -80,7 +80,7 @@ feature 'GFM autocomplete', feature: true, js: true do 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') end @@ -93,7 +93,7 @@ feature 'GFM autocomplete', feature: true, js: true do expect(page).to have_selector('.atwho-container') - wait_for_ajax + wait_for_requests expect(find('#at-view-64')).to have_content(user.name) end @@ -106,7 +106,7 @@ feature 'GFM autocomplete', feature: true, js: true do 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') end diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 0de0f93089a..99ad8013023 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -23,7 +23,7 @@ feature 'Issue Sidebar', feature: true do find('.block.assignee .edit-link').click - wait_for_ajax + wait_for_requests end it 'shows author in assignee dropdown' do @@ -37,7 +37,7 @@ feature 'Issue Sidebar', feature: true do find('.dropdown-input-field').native.send_keys user2.name sleep 1 # Required to wait for end of input delay - wait_for_ajax + wait_for_requests expect(page).to have_content(user2.name) end @@ -48,7 +48,7 @@ feature 'Issue Sidebar', feature: true do click_button 'assign yourself' - wait_for_ajax + wait_for_requests find('.block.assignee .edit-link').click diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb index a4035324d2b..15c817cabac 100644 --- a/spec/features/issues/notes_on_issues_spec.rb +++ b/spec/features/issues/notes_on_issues_spec.rb @@ -15,7 +15,7 @@ describe 'Create notes on issues', :js, :feature do fill_in 'note[note]', with: note_text click_button 'Comment' - wait_for_ajax + wait_for_requests end it 'creates a note with reference and cross references the issue' do diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb index b250fa2ed3c..0911f1db9ba 100644 --- a/spec/features/issues/update_issues_spec.rb +++ b/spec/features/issues/update_issues_spec.rb @@ -108,11 +108,11 @@ feature 'Multiple issue updating from issues#index', feature: true do def click_update_assignee_button find('.js-update-assignee').click - wait_for_ajax + wait_for_requests end def click_update_issues_button find('.update_selected_issues').click - wait_for_ajax + wait_for_requests end end diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb index 4cd6c1171ac..d14c319707c 100644 --- a/spec/features/issues/user_uses_slash_commands_spec.rb +++ b/spec/features/issues/user_uses_slash_commands_spec.rb @@ -18,7 +18,7 @@ feature 'Issues > User uses slash commands', feature: true, js: true do end after do - wait_for_ajax + wait_for_requests end describe 'adding a due date from note' do |