diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/dashboard/dashboard.feature | 3 | ||||
-rw-r--r-- | features/project/issues/issues.feature | 6 | ||||
-rw-r--r-- | features/project/source/browse_files.feature | 4 | ||||
-rw-r--r-- | features/steps/project/builds/summary.rb | 2 | ||||
-rw-r--r-- | features/steps/project/fork.rb | 3 | ||||
-rw-r--r-- | features/steps/project/forked_merge_requests.rb | 2 | ||||
-rw-r--r-- | features/steps/project/hooks.rb | 4 | ||||
-rw-r--r-- | features/steps/project/issues/award_emoji.rb | 4 | ||||
-rw-r--r-- | features/steps/project/merge_requests.rb | 2 | ||||
-rw-r--r-- | features/steps/project/source/browse_files.rb | 12 | ||||
-rw-r--r-- | features/steps/shared/builds.rb | 2 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 4 | ||||
-rw-r--r-- | features/support/capybara.rb | 3 | ||||
-rw-r--r-- | features/support/env.rb | 4 |
14 files changed, 35 insertions, 20 deletions
diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature index b1d5e4a7acb..1af4d46dec9 100644 --- a/features/dashboard/dashboard.feature +++ b/features/dashboard/dashboard.feature @@ -63,7 +63,8 @@ Feature: Dashboard @javascript Scenario: Visiting Project's merge requests after sorting - Given I visit dashboard merge requests page + Given project "Shop" has a "Bugfix MR" merge request open + And I visit dashboard merge requests page And I sort the list by "Oldest updated" And I visit project "Shop" merge requests page Then The list should be sorted by "Oldest updated" diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index b2b4fe72220..27fa67c1843 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -56,14 +56,16 @@ Feature: Project Issues @javascript Scenario: Visiting Merge Requests after being sorted the list - Given I visit project "Shop" issues page + Given project "Shop" has a "Bugfix MR" merge request open + And I visit project "Shop" issues page And I sort the list by "Oldest updated" And I visit project "Shop" merge requests page Then The list should be sorted by "Oldest updated" @javascript Scenario: Visiting Merge Requests from a differente Project after sorting - Given I visit project "Shop" merge requests page + Given project "Shop" has a "Bugfix MR" merge request open + And I visit project "Shop" merge requests page And I sort the list by "Oldest updated" And I visit dashboard merge requests page Then The list should be sorted by "Oldest updated" diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index d4b91fec6e8..5ede935c562 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -158,6 +158,8 @@ Feature: Project Source Browse Files Given I don't have write access And I click on ".gitignore" file in repo And I click button "Edit" + Then I should see a Fork/Cancel combo + And I click button "Fork" Then I should see a notice about a new fork having been created And I can edit code @@ -180,6 +182,8 @@ Feature: Project Source Browse Files Given I don't have write access And I click on ".gitignore" file in repo And I click button "Edit" + Then I should see a Fork/Cancel combo + And I click button "Fork" And I edit code And I fill the commit message And I click on "Commit Changes" diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb index 19ff92f6dc6..124582de6b9 100644 --- a/features/steps/project/builds/summary.rb +++ b/features/steps/project/builds/summary.rb @@ -22,9 +22,9 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps end step 'recent build has been erased' do + expect(@build).not_to have_trace expect(@build.artifacts_file.exists?).to be_falsy expect(@build.artifacts_metadata.exists?).to be_falsy - expect(@build.trace).to be_empty end step 'recent build summary does not have artifacts widget' do diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 79db9728227..7591e7d5612 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -42,8 +42,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I click link "New merge request"' do - expect(page).to have_content(/new merge request/i) - click_link "New Merge Request" + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') 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 c0827ff8fc7..ef1bb453615 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -16,7 +16,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - click_link "New Merge Request" + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') end step 'I should see merge request "Merge Request On Forked Project"' do diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index 37b608ffbd3..0a71833a8a1 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -23,13 +23,13 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'I submit new hook' do - @url = FFaker::Internet.uri("http") + @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 = FFaker::Internet.uri("http") + @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) diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb index e55dc2913c3..a4cfc1fb8c8 100644 --- a/features/steps/project/issues/award_emoji.rb +++ b/features/steps/project/issues/award_emoji.rb @@ -24,7 +24,9 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps step 'I click to emoji in the picker' do page.within '.emoji-menu-content' do - page.first('.js-emoji-btn').click + emoji_button = page.first('.js-emoji-btn') + emoji_button.hover + emoji_button.click end end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index c9c4f537fad..5510c65265a 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -14,7 +14,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I click link "New Merge Request"' do - click_link "New Merge Request" + page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request') end step 'I click link "Bug NS-04"' do diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 5c47eaf0279..29f628763db 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -56,13 +56,17 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I click button "Edit"' do - click_link 'Edit' + find('.js-edit-blob').click end step 'I cannot see the edit button' do expect(page).not_to have_link 'edit' end + step 'I click button "Fork"' do + click_link 'Fork' + end + step 'I can edit code' do set_new_content expect(evaluate_script('ace.edit("editor").getValue()')).to eq new_gitignore_content @@ -366,6 +370,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end end + step 'I should see a Fork/Cancel combo' do + expect(page).to have_link 'Fork' + expect(page).to have_button 'Cancel' + expect(page).to have_content 'You don\'t have permission to edit this file. Try forking this project to edit the file.' + end + step 'I should see a notice about a new fork having been created' do expect(page).to have_content "You're not allowed to make changes to this project directly. A fork of this project has been created that you can make changes in, so you can submit a merge request." end diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 5bc3a1f5ac4..5549fc25525 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -47,7 +47,7 @@ module SharedBuilds end step 'recent build has a build trace' do - @build.trace = 'job trace' + @build.trace.set('job trace') end step 'download of build artifacts archive starts' do diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 47bdc708e09..4ee879fe922 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -273,6 +273,10 @@ module SharedProject @project.update(public_builds: false) end + step 'project "Shop" has a "Bugfix MR" merge request open' do + create(:merge_request, title: "Bugfix MR", target_project: project, source_project: project, author: project.users.first) + end + def user_owns_project(user_name:, project_name:, visibility: :private) user = user_exists(user_name, username: user_name.gsub(/\s/, '').underscore) project = Project.find_by(name: project_name) diff --git a/features/support/capybara.rb b/features/support/capybara.rb index 1e46b3faf0b..6da8aaac6cb 100644 --- a/features/support/capybara.rb +++ b/features/support/capybara.rb @@ -24,8 +24,5 @@ Capybara.ignore_hidden_elements = false Capybara::Screenshot.prune_strategy = :keep_last_run Spinach.hooks.before_run do - require 'spinach/capybara' - require 'capybara/rails' - TestEnv.eager_load_driver_server end diff --git a/features/support/env.rb b/features/support/env.rb index 26cdd9d746d..06c804b1db7 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -5,10 +5,6 @@ ENV['RAILS_ENV'] = 'test' require './config/environment' require 'rspec/expectations' -require_relative 'capybara' -require_relative 'db_cleaner' -require_relative 'rerun' - if ENV['CI'] require 'knapsack' Knapsack::Adapters::SpinachAdapter.bind |