diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-09 14:52:37 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-09 14:52:37 -0500 |
commit | f08a8ae18f74ad086695d62ff78ada2796e65829 (patch) | |
tree | f65d9be5c66eb0d1ad8ceb1c13eb5c0da6bc2496 /features | |
parent | 66bbf30ed8bb006d9a968693fef266c86ec2325f (diff) | |
parent | abc61f260074663e5711d3814d9b7d301d07a259 (diff) | |
download | gitlab-ce-f08a8ae18f74ad086695d62ff78ada2796e65829.tar.gz |
Merge commit 'abc61f260074663e5711d3814d9b7d301d07a259' into 9-3-stable
Diffstat (limited to 'features')
45 files changed, 237 insertions, 341 deletions
diff --git a/features/dashboard/starred_projects.feature b/features/dashboard/starred_projects.feature deleted file mode 100644 index 9dfd2fbab9c..00000000000 --- a/features/dashboard/starred_projects.feature +++ /dev/null @@ -1,12 +0,0 @@ -@dashboard -Feature: Dashboard Starred Projects - Background: - Given I sign in as a user - And public project "Community" - And I starred project "Community" - And I own project "Shop" - And I visit dashboard starred projects page - - Scenario: I should see projects list - Then I should see project "Community" - And I should not see project "Shop" diff --git a/features/profile/active_tab.feature b/features/profile/active_tab.feature index 788b7895d72..21d7d6c3800 100644 --- a/features/profile/active_tab.feature +++ b/features/profile/active_tab.feature @@ -23,7 +23,7 @@ Feature: Profile Active Tab Then the active main tab should be Preferences And no other main tabs should be active - Scenario: On Profile Audit Log - Given I visit Audit Log page - Then the active main tab should be Audit Log + Scenario: On Profile Authentication log + Given I visit Authentication log page + Then the active main tab should be Authentication log And no other main tabs should be active diff --git a/features/profile/profile.feature b/features/profile/profile.feature index 70f47c97173..3263d3e212b 100644 --- a/features/profile/profile.feature +++ b/features/profile/profile.feature @@ -63,7 +63,7 @@ Feature: Profile Given I logout And I sign in via the UI And I have activity - When I visit Audit Log page + When I visit Authentication log page Then I should see my activity Scenario: I visit my user page diff --git a/features/project/hooks.feature b/features/project/hooks.feature deleted file mode 100644 index 627738004c4..00000000000 --- a/features/project/hooks.feature +++ /dev/null @@ -1,37 +0,0 @@ -Feature: Project Hooks - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I should see hook list - Given project has hook - When I visit project hooks page - Then I should see project hook - - Scenario: I add new hook - Given I visit project hooks page - When I submit new hook - Then I should see newly created hook - - Scenario: I add new hook with SSL verification enabled - Given I visit project hooks page - When I submit new hook with SSL verification enabled - Then I should see newly created hook with SSL verification enabled - - Scenario: I test hook - Given project has hook - And I visit project hooks page - When I click test hook button - Then hook should be triggered - - Scenario: I test a hook on empty project - Given I own empty project with hook - And I visit project hooks page - When I click test hook button - Then I should see hook error message - - Scenario: I test a hook on down URL - Given project has hook - And I visit project hooks page - When I click test hook button with invalid URL - Then I should see hook service down error message diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index 1b00d8a32a0..4f905674d8c 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -12,11 +12,13 @@ Feature: Project Issues Given I should see "Release 0.4" in issues And I should not see "Release 0.3" in issues + @javascript Scenario: I should see closed issues Given I click link "Closed" Then I should see "Release 0.3" in issues And I should not see "Release 0.4" in issues + @javascript Scenario: I should see all issues Given I click link "All" Then I should see "Release 0.3" in issues diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature index a8c528d3d6f..0ebeded7fc5 100644 --- a/features/project/merge_requests.feature +++ b/features/project/merge_requests.feature @@ -38,11 +38,13 @@ Feature: Project Merge Requests When I visit merge request page "Bug NS-08" Then I should see the diverged commits count + @javascript Scenario: I should see rejected merge requests Given I click link "Closed" Then I should see "Feature NS-03" in merge requests And I should not see "Bug NS-04" in merge requests + @javascript Scenario: I should see all merge requests Given I click link "All" Then I should see "Feature NS-03" in merge requests diff --git a/features/project/merge_requests/accept.feature b/features/project/merge_requests/accept.feature index c45ed9ea68b..772a2407a64 100644 --- a/features/project/merge_requests/accept.feature +++ b/features/project/merge_requests/accept.feature @@ -7,6 +7,7 @@ Feature: Project Merge Requests Acceptance @javascript Scenario: Accepting the Merge Request and removing the source branch Given I am on the Merge Request detail page + When I check the "Remove source branch" option And I click on Accept Merge Request Then I should see merge request merged And I should not see the Remove Source Branch button @@ -14,6 +15,7 @@ Feature: Project Merge Requests Acceptance @javascript Scenario: Accepting the Merge Request when URL has an anchor Given I am on the Merge Request detail with note anchor page + When I check the "Remove source branch" option And I click on Accept Merge Request Then I should see merge request merged And I should not see the Remove Source Branch button diff --git a/features/project/project.feature b/features/project/project.feature index aa22401c88e..23817ef3ac9 100644 --- a/features/project/project.feature +++ b/features/project/project.feature @@ -18,6 +18,7 @@ Feature: Project Then I should see the default project avatar And I should not see the "Remove avatar" button + @javascript Scenario: I should have readme on page And I visit project "Shop" page Then I should see project "Shop" README diff --git a/features/project/service.feature b/features/project/service.feature index cce5f58adec..54f07ebca92 100644 --- a/features/project/service.feature +++ b/features/project/service.feature @@ -11,77 +11,77 @@ Feature: Project Services When I visit project "Shop" services page And I click hipchat service link And I fill hipchat settings - Then I should see hipchat service settings saved + Then I should see the Hipchat success message Scenario: Activate hipchat service with custom server When I visit project "Shop" services page And I click hipchat service link And I fill hipchat settings with custom server - Then I should see hipchat service settings with custom server saved + Then I should see the Hipchat success message Scenario: Activate pivotaltracker service When I visit project "Shop" services page And I click pivotaltracker service link And I fill pivotaltracker settings - Then I should see pivotaltracker service settings saved + Then I should see the Pivotaltracker success message Scenario: Activate Flowdock service When I visit project "Shop" services page And I click Flowdock service link And I fill Flowdock settings - Then I should see Flowdock service settings saved + Then I should see the Flowdock success message Scenario: Activate Assembla service When I visit project "Shop" services page And I click Assembla service link And I fill Assembla settings - Then I should see Assembla service settings saved + Then I should see the Assembla success message Scenario: Activate Slack notifications service When I visit project "Shop" services page And I click Slack notifications service link And I fill Slack notifications settings - Then I should see Slack Notifications service settings saved + Then I should see the Slack notifications success message Scenario: Activate Pushover service When I visit project "Shop" services page And I click Pushover service link And I fill Pushover settings - Then I should see Pushover service settings saved + Then I should see the Pushover success message Scenario: Activate email on push service When I visit project "Shop" services page And I click email on push service link And I fill email on push settings - Then I should see email on push service settings saved + Then I should see the Emails on push success message Scenario: Activate JIRA service When I visit project "Shop" services page And I click jira service link And I fill jira settings - Then I should see jira service settings saved + Then I should see the JIRA success message Scenario: Activate Irker (IRC Gateway) service When I visit project "Shop" services page And I click Irker service link And I fill Irker settings - Then I should see Irker service settings saved + Then I should see the Irker success message Scenario: Activate Atlassian Bamboo CI service When I visit project "Shop" services page And I click Atlassian Bamboo CI service link And I fill Atlassian Bamboo CI settings - Then I should see Atlassian Bamboo CI service settings saved + Then I should see the Bamboo success message And I should see empty field Change Password Scenario: Activate jetBrains TeamCity CI service When I visit project "Shop" services page And I click jetBrains TeamCity CI service link And I fill jetBrains TeamCity CI settings - Then I should see jetBrains TeamCity CI service settings saved + Then I should see the JetBrains success message Scenario: Activate Asana service When I visit project "Shop" services page And I click Asana service link And I fill Asana settings - Then I should see Asana service settings saved + Then I should see the Asana success message diff --git a/features/project/source/markdown_render.feature b/features/project/source/markdown_render.feature index fd583618dcf..fe4466ad241 100644 --- a/features/project/source/markdown_render.feature +++ b/features/project/source/markdown_render.feature @@ -19,12 +19,14 @@ Feature: Project Source Markdown Render And I click on Gitlab API in README Then I should see correct document rendered + @javascript Scenario: I view README in markdown branch Then I should see files from repository in markdown And I should see rendered README which contains correct links And I click on Rake tasks in README Then I should see correct directory rendered + @javascript Scenario: I view README in markdown branch to see reference links to directory Then I should see files from repository in markdown And I should see rendered README which contains correct links @@ -74,6 +76,7 @@ Feature: Project Source Markdown Render And I click on Gitlab API in README Then I should see correct document rendered for markdown branch + @javascript Scenario: I browse directory from markdown branch When I visit markdown branch Then I should see files from repository in markdown branch diff --git a/features/search.feature b/features/search.feature index 818ef436db6..f894b6b84a1 100644 --- a/features/search.feature +++ b/features/search.feature @@ -9,6 +9,7 @@ Feature: Search Given I search for "Sho" Then I should see "Shop" project link + @javascript Scenario: I should see issues I am looking for And project has issues When I search for "Foo" @@ -16,6 +17,7 @@ Feature: Search Then I should see "Foo" link in the search results And I should not see "Bar" link in the search results + @javascript Scenario: I should see merge requests I am looking for And project has merge requests When I search for "Foo" @@ -23,6 +25,7 @@ Feature: Search Then I should see "Foo" link in the search results And I should not see "Bar" link in the search results + @javascript Scenario: I should see milestones I am looking for And project has milestones When I search for "Foo" @@ -78,6 +81,7 @@ Feature: Search And I search for "Sho" Then I should see "Shop" project link + @javascript Scenario: I logout and should see issues I am looking for Given project "Shop" is public And I logout directly diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index bf09d7b7114..71c69a4fdea 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -22,7 +22,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps end step 'I click "Create merge request" link' do - click_link "Create merge request" + find_link("Create merge request", visible: false).trigger('click') end step 'I see prefilled new Merge Request page' do diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb index ca3cd0ecc4e..a745254cc31 100644 --- a/features/steps/dashboard/event_filters.rb +++ b/features/steps/dashboard/event_filters.rb @@ -1,5 +1,5 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps - include WaitForAjax + include WaitForRequests include SharedAuthentication include SharedPaths include SharedProject @@ -73,20 +73,20 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps end When 'I click "push" event filter' do - wait_for_ajax + wait_for_requests click_link("Push events") - wait_for_ajax + wait_for_requests end When 'I click "team" event filter' do - wait_for_ajax + wait_for_requests click_link("Team") - wait_for_ajax + wait_for_requests end When 'I click "merge" event filter' do - wait_for_ajax + wait_for_requests click_link("Merge events") - wait_for_ajax + wait_for_requests end end diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 4fb16d3bb57..530fd6f7bdb 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -4,7 +4,13 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps include SharedProject step 'I click "New project" link' do - page.within('.content') do + page.within '#content-body' do + click_link "New project" + end + end + + step 'I click "New project" in top right menu' do + page.within '.header-content' do click_link "New project" end end diff --git a/features/steps/dashboard/todos.rb b/features/steps/dashboard/todos.rb index b56558ba0d2..4a33babe3bd 100644 --- a/features/steps/dashboard/todos.rb +++ b/features/steps/dashboard/todos.rb @@ -3,7 +3,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps include SharedPaths include SharedProject include SharedUser - include WaitForAjax + include WaitForRequests step '"John Doe" is a developer of project "Shop"' do project.team << [john_doe, :developer] @@ -55,7 +55,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps merge_request_reference = merge_request.to_reference(full: true) issue_reference = issue.to_reference(full: true) - click_link 'Mark all as done' + find('.js-todos-mark-all').trigger('click') page.within('.todos-count') { expect(page).to have_content '0' } expect(page).to have_content 'To do 0' @@ -69,7 +69,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps end step 'I should see the todo marked as done' do - click_link 'Done 1' + find('.todos-done a').trigger('click') expect(page).to have_link project.name_with_namespace should_see_todo(1, "John Doe assigned you merge request #{merge_request.to_reference(full: true)}", merge_request.title, state: :done_irreversible) @@ -79,7 +79,7 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps merge_request_reference = merge_request.to_reference(full: true) issue_reference = issue.to_reference(full: true) - click_link 'Done 4' + find('.todos-done a').trigger('click') expect(page).to have_link project.name_with_namespace should_see_todo(1, "John Doe assigned you merge request #{merge_request_reference}", merge_request.title, state: :done_irreversible) @@ -138,9 +138,9 @@ class Spinach::Features::DashboardTodos < Spinach::FeatureSteps end 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 - wait_for_ajax + wait_for_requests end def should_see_todo(position, title, body, state: :pending) diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb index 7dc33ab5683..1a55f40abb9 100644 --- a/features/steps/explore/projects.rb +++ b/features/steps/explore/projects.rb @@ -49,7 +49,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps step 'I should see an http link to the repository' do project = Project.find_by(name: 'Community') - expect(page).to have_field('project_clone', with: project.http_url_to_repo(@user)) + expect(page).to have_field('project_clone', with: project.http_url_to_repo) end step 'I should see an ssh link to the repository' do @@ -101,7 +101,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps create(:merge_request, title: "Bug fix for public project", source_project: public_project, - target_project: public_project, + target_project: public_project ) end diff --git a/features/steps/group/members.rb b/features/steps/group/members.rb index b04a7015d4e..0ab1012660c 100644 --- a/features/steps/group/members.rb +++ b/features/steps/group/members.rb @@ -1,5 +1,5 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps - include WaitForAjax + include WaitForRequests include SharedAuthentication include SharedPaths include SharedGroup @@ -58,7 +58,7 @@ class Spinach::Features::GroupMembers < Spinach::FeatureSteps click_link 'Developer' end - wait_for_ajax + wait_for_requests end end diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb index 0b0983f0d06..0542b06c0ab 100644 --- a/features/steps/group/milestones.rb +++ b/features/steps/group/milestones.rb @@ -1,5 +1,5 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps - include WaitForAjax + include WaitForRequests include SharedAuthentication include SharedPaths include SharedGroup @@ -91,7 +91,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps end step 'I should see the list of labels' do - wait_for_ajax + wait_for_requests page.within('#tab-labels') do expect(page).to have_content 'bug' diff --git a/features/steps/profile/active_tab.rb b/features/steps/profile/active_tab.rb index 4724a326277..069d4e6a23d 100644 --- a/features/steps/profile/active_tab.rb +++ b/features/steps/profile/active_tab.rb @@ -19,7 +19,7 @@ class Spinach::Features::ProfileActiveTab < Spinach::FeatureSteps ensure_active_main_tab('Preferences') end - step 'the active main tab should be Audit Log' do - ensure_active_main_tab('Audit Log') + step 'the active main tab should be Authentication log' do + ensure_active_main_tab('Authentication log') end end diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb index eec375b0532..4b72355b125 100644 --- a/features/steps/project/builds/artifacts.rb +++ b/features/steps/project/builds/artifacts.rb @@ -3,7 +3,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps include SharedProject include SharedBuilds include RepoHelpers - include WaitForAjax + include WaitForRequests step 'I click artifacts download button' do click_link 'Download' @@ -25,7 +25,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps step 'I should see the build header' do page.within('.build-header') do - expect(page).to have_content "Job ##{@build.id} in pipeline ##{@pipeline.id} for commit #{@pipeline.short_sha}" + expect(page).to have_content "Job ##{@build.id} in pipeline ##{@pipeline.id} for #{@pipeline.short_sha}" end end @@ -79,7 +79,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps step 'I click a link to file within build artifacts' do page.within('.tree-table') { find_link('ci_artifacts.txt').click } - wait_for_ajax + wait_for_requests end step 'I see a download link' do diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 5f5f806df36..28be9c6df5b 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -5,7 +5,9 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps step 'fill project form with valid data' do fill_in 'project_path', with: 'Empty' - click_button "Create project" + page.within '#content-body' do + click_button "Create project" + end end step 'I should see project page' do diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 7591e7d5612..35df403a85f 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -5,7 +5,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps step 'I click link "Fork"' do expect(page).to have_content "Shop" - click_link "Fork project" + click_link "Fork" end step 'I am a member of project "Shop"' do @@ -42,7 +42,9 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I click link "New merge request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see the new merge request page for my namespace' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 310db6e6dad..2d9d3efd9d4 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps include SharedNote include SharedPaths include Select2Helper - include WaitForVueResource + include WaitForRequests step 'I am a member of project "Shop"' do @project = ::Project.find_by(name: "Shop") @@ -17,7 +17,9 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I should see merge request "Merge Request On Forked Project"' do @@ -33,7 +35,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps expect(page).to have_content @merge_request.source_branch expect(page).to have_content @merge_request.target_branch - wait_for_vue_resource + wait_for_requests end step 'I fill out a "Merge Request On Forked Project" merge request' do @@ -47,6 +49,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps first('.dropdown-target-project a', text: @project.path_with_namespace) first('.js-source-branch').click + wait_for_requests first('.dropdown-source-branch .dropdown-content a', text: 'fix').click click_button "Compare branches and continue" @@ -62,31 +65,6 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps click_button "Submit merge request" end - step 'I follow the target commit link' do - commit = @project.repository.commit - click_link commit.short_id(8) - end - - step 'I should see the commit under the forked from project' do - commit = @project.repository.commit - expect(page).to have_content(commit.message) - end - - step 'I click "Create Merge Request on fork" link' do - click_link "Create Merge Request on fork" - end - - step 'I see prefilled new Merge Request page for the forked project' do - expect(current_path).to eq new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project) - expect(find("#merge_request_source_project_id").value).to eq @forked_project.id.to_s - expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s - expect(find("#merge_request_source_branch").value).to have_content "new_design" - expect(find("#merge_request_target_branch").value).to have_content "master" - expect(find("#merge_request_title").value).to eq "New Design" - verify_commit_link(".mr_target_commit", @project) - verify_commit_link(".mr_source_commit", @forked_project) - end - step 'I update the merge request title' do fill_in "merge_request_title", with: "An Edited Forked Merge Request" end @@ -155,10 +133,4 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps expect(page).to have_content @project.users.first.name end end - - # Verify a link is generated against the correct project - def verify_commit_link(container_div, container_project) - # This should force a wait for the javascript to execute - expect(find(:div, container_div).find(".commit_short_id")['href']).to have_content "#{container_project.path_with_namespace}/commit" - end end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb deleted file mode 100644 index 945d58a6458..00000000000 --- a/features/steps/project/hooks.rb +++ /dev/null @@ -1,75 +0,0 @@ -require 'webmock' - -class Spinach::Features::ProjectHooks < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RSpec::Matchers - include RSpec::Mocks::ExampleMethods - include WebMock::API - - step 'project has hook' do - @hook = create(:project_hook, project: current_project) - end - - step 'I own empty project with hook' do - @project = create(:empty_project, - name: 'Empty Project', namespace: @user.namespace) - @hook = create(:project_hook, project: current_project) - end - - step 'I should see project hook' do - expect(page).to have_content @hook.url - end - - step 'I submit new hook' do - @url = 'http://example.org/1' - fill_in "hook_url", with: @url - expect { click_button "Add webhook" }.to change(ProjectHook, :count).by(1) - end - - step 'I submit new hook with SSL verification enabled' do - @url = 'http://example.org/2' - fill_in "hook_url", with: @url - check "hook_enable_ssl_verification" - expect { click_button "Add webhook" }.to change(ProjectHook, :count).by(1) - end - - step 'I should see newly created hook' do - expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project) - expect(page).to have_content(@url) - end - - step 'I should see newly created hook with SSL verification enabled' do - expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project) - expect(page).to have_content(@url) - expect(page).to have_content("SSL Verification: enabled") - end - - step 'I click test hook button' do - stub_request(:post, @hook.url).to_return(status: 200) - click_link 'Test' - end - - step 'I click test hook button with invalid URL' do - stub_request(:post, @hook.url).to_raise(SocketError) - click_link 'Test' - end - - step 'hook should be triggered' do - expect(current_path).to eq namespace_project_settings_integrations_path(current_project.namespace, current_project) - expect(page).to have_selector '.flash-notice', - text: 'Hook executed successfully: HTTP 200' - end - - step 'I should see hook error message' do - expect(page).to have_selector '.flash-alert', - text: 'Hook execution failed. '\ - 'Ensure the project has commits.' - end - - step 'I should see hook service down error message' do - expect(page).to have_selector '.flash-alert', - text: 'Hook execution failed: Exception from' - end -end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 637e6568267..e4a559d8ff5 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -28,7 +28,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "Closed"' do - find('.issues-state-filters a', text: "Closed").click + find('.issues-state-filters [data-state="closed"] span', text: 'Closed').click end step 'I click button "Unsubscribe"' do @@ -44,7 +44,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "All"' do - click_link "All" + find('.issues-state-filters [data-state="all"] span', text: 'All').click # Waits for load expect(find('.issues-state-filters > .active')).to have_content 'All' end @@ -62,7 +62,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I click link "New issue"' do - page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + page.within '#content-body' do + page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue') + end end step 'I click "author" dropdown' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 573be44c695..69f5d0f8410 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -7,15 +7,16 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps include SharedMarkdown include SharedDiffNote include SharedUser - include WaitForAjax - include WaitForVueResource + include WaitForRequests after do - wait_for_ajax if javascript_test? + wait_for_requests if javascript_test? end step 'I click link "New Merge Request"' do - page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + page.within '#content-body' do + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') + end end step 'I click link "Bug NS-04"' do @@ -27,42 +28,40 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "All"' do - click_link "All" + find('.issues-state-filters [data-state="all"] span', text: 'All').click # Waits for load expect(find('.issues-state-filters > .active')).to have_content 'All' end step 'I click link "Merged"' do - click_link "Merged" + find('#state-merged').trigger('click') end step 'I click link "Closed"' do - page.within('.issues-state-filters') do - click_link "Closed" - end + find('.issues-state-filters [data-state="closed"] span', text: 'Closed').click end step 'I should see merge request "Wiki Feature"' do page.within '.merge-request' do expect(page).to have_content "Wiki Feature" end - wait_for_vue_resource + wait_for_requests end step 'I should see closed merge request "Bug NS-04"' do expect(page).to have_content "Bug NS-04" expect(page).to have_content "Closed by" - wait_for_vue_resource + wait_for_requests end step 'I should see merge request "Bug NS-04"' do expect(page).to have_content "Bug NS-04" - wait_for_vue_resource + wait_for_requests end step 'I should see merge request "Feature NS-05"' do expect(page).to have_content "Feature NS-05" - wait_for_vue_resource + wait_for_requests end step 'I should not see "master" branch' do @@ -99,7 +98,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I click button "Unsubscribe"' do click_on "Unsubscribe" - wait_for_ajax + wait_for_requests end step 'I click link "Close"' do @@ -300,6 +299,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I change the comment "Line is wrong" to "Typo, please fix" on diff' do page.within('.diff-file:nth-of-type(5) .note') do + find('.more-actions').click + find('.more-actions .dropdown-menu li', match: :first) + find('.js-note-edit').click page.within('.current-note-edit-form', visible: true) do @@ -325,13 +327,16 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I delete the comment "Line is wrong" on diff' do page.within('.diff-file:nth-of-type(5) .note') do + find('.more-actions').click + find('.more-actions .dropdown-menu li', match: :first) + find('.js-note-delete').click end end step 'I click on the Discussion tab' do page.within '.merge-request-tabs' do - click_link 'Discussion' + find('.notes-tab').trigger('click') end # Waits for load @@ -353,7 +358,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see a discussion by user "John Doe" has started on diff' do # Trigger a refresh of notes execute_script("$(document).trigger('visibilitychange');") - wait_for_ajax + wait_for_requests page.within(".notes .discussion") do page.should have_content "#{user_exists("John Doe").name} #{user_exists("John Doe").to_reference} started a discussion" page.should have_content sample_commit.line_code_path @@ -363,12 +368,12 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see a badge of "1" next to the discussion link' do expect_discussion_badge_to_have_counter("1") - wait_for_vue_resource + wait_for_requests end step 'I should see a badge of "0" next to the discussion link' do expect_discussion_badge_to_have_counter("0") - wait_for_vue_resource + wait_for_requests end step 'I should see a discussion has started on commit diff' do @@ -376,7 +381,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps page.should have_content "#{current_user.name} #{current_user.to_reference} started a discussion on commit" page.should have_content sample_commit.line_code_path page.should have_content "Line is wrong" - wait_for_vue_resource + wait_for_requests end end @@ -384,7 +389,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps page.within(".notes .discussion") do page.should have_content "#{current_user.name} #{current_user.to_reference} started a discussion on commit" page.should have_content "One comment to rule them all" - wait_for_vue_resource + wait_for_requests end end @@ -410,7 +415,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see merged request' do page.within '.status-box' do expect(page).to have_content "Merged" - wait_for_vue_resource + wait_for_requests end end @@ -422,7 +427,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps page.within '.status-box' do expect(page).to have_content "Open" end - wait_for_vue_resource + wait_for_requests end step 'I click link "Hide inline discussion" of the third file' do @@ -446,7 +451,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see a comment like "Line is wrong" in the third file' do page.within '.files>div:nth-child(3) .note-body > .note-text' do expect(page).to have_visible_content "Line is wrong" - wait_for_vue_resource + wait_for_requests end end @@ -470,7 +475,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Comment" end - wait_for_ajax + wait_for_requests page.within ".files>div:nth-child(2) .note-body > .note-text" do expect(page).to have_content "Line is correct" @@ -485,7 +490,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Comment" end - wait_for_ajax + wait_for_requests end step 'I should still see a comment like "Line is correct" in the second file' do @@ -514,7 +519,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see comments on the side-by-side diff page' do page.within '.files>div:nth-child(2) .parallel .note-body > .note-text' do expect(page).to have_visible_content "Line is correct" - wait_for_vue_resource + wait_for_requests end end @@ -538,7 +543,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps 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 'changed target branch from merge-test to feature' - wait_for_ajax + wait_for_requests end step 'I click on "Email Patches"' do @@ -556,7 +561,14 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step '"Bug NS-05" has CI status' do project = merge_request.source_project project.enable_ci - pipeline = create :ci_pipeline, project: project, sha: merge_request.diff_head_sha, ref: merge_request.source_branch + + pipeline = + create(:ci_pipeline, + project: project, + sha: merge_request.diff_head_sha, + ref: merge_request.source_branch, + head_pipeline_of: merge_request) + create :ci_build, pipeline: pipeline end @@ -571,7 +583,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps expect(page).to have_content /([0-9]+ commits behind)/ end - wait_for_vue_resource + wait_for_requests end step 'I should not see the diverged commits count' do @@ -579,7 +591,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps expect(page).not_to have_content /([0-9]+ commit[s]? behind)/ end - wait_for_vue_resource + wait_for_requests end def merge_request @@ -596,7 +608,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Comment" end - wait_for_ajax + wait_for_requests page.within(".notes_holder", visible: true) do expect(page).to have_content message diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb index 3c976f675a2..870dc862992 100644 --- a/features/steps/project/merge_requests/acceptance.rb +++ b/features/steps/project/merge_requests/acceptance.rb @@ -1,7 +1,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps include LoginHelpers include GitlabRoutingHelper - include WaitForVueResource + include WaitForRequests step 'I am on the Merge Request detail page' do visit merge_request_path(@merge_request) @@ -11,10 +11,14 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps visit merge_request_path(@merge_request, anchor: 'note_123') end - step 'I click on "Remove source branch" option' do + step 'I uncheck the "Remove source branch" option' do uncheck('Remove source branch') end + step 'I check the "Remove source branch" option' do + check('Remove source branch') + end + step 'I click on Accept Merge Request' do click_button('Merge') end @@ -24,7 +28,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps # Wait for View Resource requests to complete so they don't blow up if they are # only handled after `DatabaseCleaner` has already run - wait_for_vue_resource + wait_for_requests end step 'I should not see the Remove Source Branch button' do @@ -32,7 +36,7 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps # Wait for View Resource requests to complete so they don't blow up if they are # only handled after `DatabaseCleaner` has already run - wait_for_vue_resource + wait_for_requests end step 'There is an open Merge Request' do diff --git a/features/steps/project/merge_requests/revert.rb b/features/steps/project/merge_requests/revert.rb index aa76d6f8c48..98d990f112f 100644 --- a/features/steps/project/merge_requests/revert.rb +++ b/features/steps/project/merge_requests/revert.rb @@ -1,7 +1,7 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps include LoginHelpers include GitlabRoutingHelper - include WaitForVueResource + include WaitForRequests step 'I click on the revert button' do find("a[href='#modal-revert-commit']").click @@ -16,7 +16,7 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps step 'I should see the revert merge request notice' do page.should have_content('The merge request has been successfully reverted.') - wait_for_vue_resource + wait_for_requests end step 'I should not see the revert button' do diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb index fea82d9fb57..4e6830f738b 100644 --- a/features/steps/project/pages.rb +++ b/features/steps/project/pages.rb @@ -35,7 +35,7 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps end step 'pages are deployed' do - pipeline = @project.ensure_pipeline('HEAD', @project.commit('HEAD').sha) + pipeline = @project.pipelines.create(ref: 'HEAD', sha: @project.commit('HEAD').sha) build = build(:ci_build, project: @project, pipeline: pipeline, diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 03d6704e1ab..7d34331db46 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -2,6 +2,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps include SharedAuthentication include SharedProject include SharedPaths + include WaitForRequests step 'change project settings' do fill_in 'project_name_edit', with: 'NewName' @@ -86,6 +87,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see project "Shop" README' do + wait_for_requests page.within('.readme-holder') do expect(page).to have_content 'testme' end diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb index dc1190b7eea..a7d3352b8c4 100644 --- a/features/steps/project/project_milestone.rb +++ b/features/steps/project/project_milestone.rb @@ -2,7 +2,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps include SharedAuthentication include SharedProject include SharedPaths - include WaitForAjax + include WaitForRequests step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do project = Project.find_by(name: "Shop") @@ -35,7 +35,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps end step 'I should see the labels "bug", "enhancement" and "feature"' do - wait_for_ajax + wait_for_requests page.within('#tab-issues') do expect(page).to have_content 'bug' diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 772b07d0ad8..6bac4df16f8 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -34,8 +34,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see hipchat service settings saved' do - expect(find_field('Room').value).to eq 'gitlab' + step 'I should see the Hipchat success message' do + expect(page).to have_content 'HipChat activated.' end step 'I fill hipchat settings with custom server' do @@ -46,10 +46,6 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see hipchat service settings with custom server saved' do - expect(find_field('Server').value).to eq 'https://chat.example.com' - end - step 'I click pivotaltracker service link' do click_link 'PivotalTracker' end @@ -60,8 +56,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see pivotaltracker service settings saved' do - expect(find_field('Token').value).to eq 'verySecret' + step 'I should see the Pivotaltracker success message' do + expect(page).to have_content 'PivotalTracker activated.' end step 'I click Flowdock service link' do @@ -74,8 +70,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Flowdock service settings saved' do - expect(find_field('Token').value).to eq 'verySecret' + step 'I should see the Flowdock success message' do + expect(page).to have_content 'Flowdock activated.' end step 'I click Assembla service link' do @@ -88,8 +84,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Assembla service settings saved' do - expect(find_field('Token').value).to eq 'verySecret' + step 'I should see the Assembla success message' do + expect(page).to have_content 'Assembla activated.' end step 'I click Asana service link' do @@ -103,9 +99,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Asana service settings saved' do - expect(find_field('Api key').value).to eq 'verySecret' - expect(find_field('Restrict to branch').value).to eq 'master' + step 'I should see the Asana success message' do + expect(page).to have_content 'Asana activated.' end step 'I click email on push service link' do @@ -113,12 +108,13 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I fill email on push settings' do + check 'Active' fill_in 'Recipients', with: 'qa@company.name' click_button 'Save' end - step 'I should see email on push service settings saved' do - expect(find_field('Recipients').value).to eq 'qa@company.name' + step 'I should see the Emails on push success message' do + expect(page).to have_content 'Emails on push activated.' end step 'I click Irker service link' do @@ -132,9 +128,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Irker service settings saved' do - expect(find_field('Recipients').value).to eq 'irc://chat.freenode.net/#commits' - expect(find_field('Colorize messages').value).to eq '1' + step 'I should see the Irker success message' do + expect(page).to have_content 'Irker (IRC gateway) activated.' end step 'I click Slack notifications service link' do @@ -147,8 +142,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Slack Notifications service settings saved' do - expect(find_field('Webhook').value).to eq 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' + step 'I should see the Slack notifications success message' do + expect(page).to have_content 'Slack notifications activated.' end step 'I click Pushover service link' do @@ -165,12 +160,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Pushover service settings saved' do - expect(find_field('Api key').value).to eq 'verySecret' - expect(find_field('User key').value).to eq 'verySecret' - expect(find_field('Device').value).to eq 'myDevice' - expect(find_field('Priority').find('option[selected]').value).to eq '1' - expect(find_field('Sound').find('option[selected]').value).to eq 'bike' + step 'I should see the Pushover success message' do + expect(page).to have_content 'Pushover activated.' end step 'I click jira service link' do @@ -178,17 +169,18 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I fill jira settings' do - fill_in 'URL', with: 'http://jira.example' + check 'Active' + + fill_in 'Web URL', with: 'http://jira.example' + fill_in 'JIRA API URL', with: 'http://jira.example/api' fill_in 'Username', with: 'gitlab' fill_in 'Password', with: 'gitlab' fill_in 'Project Key', with: 'GITLAB' click_button 'Save' end - step 'I should see jira service settings saved' do - expect(find_field('URL').value).to eq 'http://jira.example' - expect(find_field('Username').value).to eq 'gitlab' - expect(find_field('Project Key').value).to eq 'GITLAB' + step 'I should see the JIRA success message' do + expect(page).to have_content 'JIRA activated.' end step 'I click Atlassian Bamboo CI service link' do @@ -204,14 +196,14 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see Atlassian Bamboo CI service settings saved' do - expect(find_field('Bamboo url').value).to eq 'http://bamboo.example.com' - expect(find_field('Build key').value).to eq 'KEY' - expect(find_field('Username').value).to eq 'user' + step 'I should see the Bamboo success message' do + expect(page).to have_content 'Atlassian Bamboo CI activated.' end step 'I should see empty field Change Password' do - expect(find_field('Change Password').value).to be_nil + click_link 'Atlassian Bamboo CI' + + expect(find_field('Enter new password').value).to be_nil end step 'I click JetBrains TeamCity CI service link' do @@ -227,9 +219,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps click_button 'Save' end - step 'I should see JetBrains TeamCity CI service settings saved' do - expect(find_field('Teamcity url').value).to eq 'http://teamcity.example.com' - expect(find_field('Build type').value).to eq 'GitlabTest_Build' - expect(find_field('Username').value).to eq 'user' + step 'I should see the JetBrains success message' do + expect(page).to have_content 'JetBrains TeamCity CI activated.' end end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index 60febd20104..dd49701a3d9 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -3,7 +3,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps include SharedProject include SharedNote include SharedPaths - include WaitForAjax + include WaitForRequests step 'project "Shop" have "Snippet one" snippet' do create(:project_snippet, @@ -23,7 +23,9 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I click link "New snippet"' do - first(:link, "New snippet").click + page.within '#content-body' do + first(:link, "New snippet").click + end end step 'I click link "Snippet one"' do @@ -59,7 +61,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps find('.ace_editor').native.send_keys 'Content of snippet three' end click_button "Create snippet" - wait_for_ajax + wait_for_requests end step 'I should see snippet "Snippet three"' do @@ -81,7 +83,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps fill_in "note_note", with: "Good snippet!" click_button "Comment" end - wait_for_ajax + wait_for_requests end step 'I should see comment "Good snippet!"' do diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index ef09bddddd8..d099d7af167 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps include SharedProject include SharedPaths include RepoHelpers - include WaitForAjax + include WaitForRequests step "I don't have write access" do @project = create(:project, :repository, name: "Other Project", path: "other-project") @@ -37,12 +37,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see its content' do - wait_for_ajax + wait_for_requests expect(page).to have_content old_gitignore_content end step 'I should see its new content' do - wait_for_ajax + wait_for_requests expect(page).to have_content new_gitignore_content end @@ -372,6 +372,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content 'Permalink' expect(page).not_to have_content 'Edit' expect(page).not_to have_content 'Blame' + expect(page).not_to have_content 'Annotate' expect(page).to have_content 'Delete' expect(page).to have_content 'Replace' end diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index abdbd795cd5..0fee158d590 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -5,7 +5,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps include SharedAuthentication include SharedPaths include SharedMarkdown - include WaitForAjax + include WaitForRequests step 'I own project "Delta"' do @project = ::Project.find_by(name: "Delta") @@ -35,7 +35,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps 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") - wait_for_ajax + wait_for_requests expect(page).to have_content "All API requests require authentication" end @@ -65,7 +65,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps 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") - wait_for_ajax + wait_for_requests expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" end @@ -97,7 +97,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps step 'I see correct file rendered' do 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_link "Users" expect(page).to have_link "Rake tasks" @@ -120,6 +120,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps When 'I visit markdown branch' do visit namespace_project_tree_path(@project.namespace, @project, "markdown") + wait_for_requests end When 'I visit markdown branch "README.md" blob' do @@ -142,7 +143,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps 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") - wait_for_ajax + wait_for_requests expect(page).to have_content "Contents" expect(page).to have_link "Users" expect(page).to have_link "Rake tasks" @@ -150,7 +151,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps 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") - wait_for_ajax + wait_for_requests expect(page).to have_content "All API requests require authentication" end @@ -168,7 +169,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps # Expected link contents 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") end @@ -204,7 +205,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end 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' end @@ -299,12 +300,12 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps 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") - wait_for_ajax + wait_for_requests expect(page).to have_content "List users" end 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') end diff --git a/features/steps/search.rb b/features/steps/search.rb index f885baf8453..16c4a5ab2e4 100644 --- a/features/steps/search.rb +++ b/features/steps/search.rb @@ -10,12 +10,12 @@ class Spinach::Features::Search < Spinach::FeatureSteps step 'I search for "Foo"' do fill_in "dashboard_search", with: "Foo" - click_button "Search" + find('.btn-search').trigger('click') end step 'I search for "rspec"' do fill_in "dashboard_search", with: "rspec" - click_button "Search" + find('.btn-search').trigger('click') end step 'I search for "rspec" on project page' do @@ -25,7 +25,7 @@ class Spinach::Features::Search < Spinach::FeatureSteps step 'I search for "Wiki content"' do fill_in "dashboard_search", with: "content" - click_button "Search" + find('.btn-search').trigger('click') end step 'I click "Issues" link' do @@ -35,7 +35,7 @@ class Spinach::Features::Search < Spinach::FeatureSteps end step 'I click project "Shop" link' do - click_button 'Project' + find('.js-search-project-dropdown').trigger('click') page.within '.project-filter' do click_link project.name_with_namespace end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index 8bae80a8707..af5db05e9e8 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -1,9 +1,9 @@ module SharedActiveTab include Spinach::DSL - include WaitForAjax + include WaitForRequests after do - wait_for_ajax if javascript_test? + wait_for_requests if javascript_test? end def ensure_active_main_tab(content) diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 5549fc25525..624f1a7858b 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -27,11 +27,11 @@ module SharedBuilds end step 'I visit recent build details page' do - visit namespace_project_build_path(@project.namespace, @project, @build) + visit namespace_project_job_path(@project.namespace, @project, @build) end step 'I visit project builds page' do - visit namespace_project_builds_path(@project.namespace, @project) + visit namespace_project_jobs_path(@project.namespace, @project) end step 'recent build has artifacts available' do @@ -56,7 +56,7 @@ module SharedBuilds end step 'I access artifacts download page' do - visit download_namespace_project_build_artifacts_path(@project.namespace, @project, @build) + visit download_namespace_project_job_artifacts_path(@project.namespace, @project, @build) end step 'I see details of a build' do diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 071aa2e3eff..36fc315599e 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -1,10 +1,10 @@ module SharedDiffNote include Spinach::DSL include RepoHelpers - include WaitForAjax + include WaitForRequests after do - wait_for_ajax if javascript_test? + wait_for_requests if javascript_test? end step 'I cancel the diff comment' do diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 6610b97ecb2..c2bec2a6320 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -30,7 +30,7 @@ module SharedMarkdown end step 'I should see the Markdown write tab' do - expect(find('.gfm-form')).to have_css('.js-md-write-button', visible: true) + expect(first('.gfm-form')).to have_link('Write', visible: true) end step 'I should see the Markdown preview' do @@ -49,9 +49,9 @@ module SharedMarkdown end step 'I preview a description text like "Bug fixed :smile:"' do - page.within('.gfm-form') do + page.within(first('.gfm-form')) do fill_in 'Description', with: 'Bug fixed :smile:' - find('.js-md-preview-button').click + click_link 'Preview' end end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 7d260025052..80187b83fee 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -1,14 +1,19 @@ module SharedNote include Spinach::DSL - include WaitForAjax + include WaitForRequests after do - wait_for_ajax if javascript_test? + wait_for_requests if javascript_test? end step 'I delete a comment' do page.within('.main-notes-list') do - find('.note').hover + note = find('.note') + note.hover + + note.find('.more-actions').click + note.find('.more-actions .dropdown-menu li', match: :first) + find(".js-note-delete").click end end @@ -25,7 +30,7 @@ module SharedNote click_button "Comment" end - wait_for_ajax + wait_for_requests end step 'I preview a comment text like "Bug fixed :smile:"' do @@ -40,7 +45,7 @@ module SharedNote click_button "Comment" end - wait_for_ajax + wait_for_requests end step 'I write a comment like ":+1: Nice"' do @@ -127,7 +132,7 @@ module SharedNote click_button "Comment" end - wait_for_ajax + wait_for_requests end step 'The comment with the header should not have an ID' do @@ -139,8 +144,13 @@ module SharedNote step 'I edit the last comment with a +1' do page.within(".main-notes-list") do - find(".note").hover - find('.js-note-edit').click + note = find('.note') + note.hover + + note.find('.more-actions').click + note.find('.more-actions .dropdown-menu li', match: :first) + + note.find('.js-note-edit').click end page.within(".current-note-edit-form") do diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 46b3cb79af2..f0e751b820a 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -2,7 +2,7 @@ module SharedPaths include Spinach::DSL include RepoHelpers include DashboardHelper - include WaitForVueResource + include WaitForRequests step 'I visit new project page' do visit new_project_path @@ -152,7 +152,7 @@ module SharedPaths visit profile_preferences_path end - step 'I visit Audit Log page' do + step 'I visit Authentication log page' do visit audit_log_profile_path end @@ -378,28 +378,28 @@ module SharedPaths step 'I visit merge request page "Bug NS-04"' do visit merge_request_path("Bug NS-04") - wait_for_vue_resource + wait_for_requests end step 'I visit merge request page "Bug NS-05"' do visit merge_request_path("Bug NS-05") - wait_for_vue_resource + wait_for_requests end step 'I visit merge request page "Bug NS-07"' do visit merge_request_path("Bug NS-07") - wait_for_vue_resource + wait_for_requests end step 'I visit merge request page "Bug NS-08"' do visit merge_request_path("Bug NS-08") - wait_for_vue_resource + wait_for_requests end step 'I visit merge request page "Bug CO-01"' do mr = MergeRequest.find_by(title: "Bug CO-01") visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - wait_for_vue_resource + wait_for_requests end step 'I visit project "Shop" merge requests page' do diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 15625e045f5..c4f1c57836f 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -256,9 +256,9 @@ module SharedProject end step 'I should see last commit with CI status' do - page.within ".project-last-commit" do + page.within ".blob-commit-info" do expect(page).to have_content(project.commit.sha[0..6]) - expect(page).to have_content("skipped") + expect(page).to have_link("Commit: skipped") end end diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb index 0b3e942a4fd..a4fc77746ee 100644 --- a/features/steps/snippets/snippets.rb +++ b/features/steps/snippets/snippets.rb @@ -3,7 +3,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps include SharedPaths include SharedProject include SharedSnippet - include WaitForAjax + include WaitForRequests step 'I click link "Personal snippet one"' do click_link "Personal snippet one" @@ -30,7 +30,7 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps find('.ace_editor').native.send_keys 'Content of snippet three' end click_button "Create snippet" - wait_for_ajax + wait_for_requests end step 'I submit new internal snippet' do diff --git a/features/support/env.rb b/features/support/env.rb index 23a1f702068..1690465d9b2 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -10,7 +10,7 @@ if ENV['CI'] Knapsack::Adapters::SpinachAdapter.bind end -%w(select2_helper test_env repo_helpers wait_for_ajax wait_for_requests sidekiq 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) end @@ -33,7 +33,7 @@ end Spinach.hooks.after_scenario do |scenario_data, step_definitions| if scenario_data.tags.include?('javascript') include WaitForRequests - wait_for_requests_complete + block_and_wait_for_requests_complete end end |