diff options
Diffstat (limited to 'features')
-rw-r--r-- | features/group/milestones.feature | 1 | ||||
-rw-r--r-- | features/project/active_tab.feature | 7 | ||||
-rw-r--r-- | features/project/builds/artifacts.feature | 5 | ||||
-rw-r--r-- | features/project/deploy_keys.feature | 6 | ||||
-rw-r--r-- | features/project/milestone.feature | 8 | ||||
-rw-r--r-- | features/project/pages.feature | 11 | ||||
-rw-r--r-- | features/steps/group/milestones.rb | 3 | ||||
-rw-r--r-- | features/steps/project/active_tab.rb | 6 | ||||
-rw-r--r-- | features/steps/project/builds/artifacts.rb | 27 | ||||
-rw-r--r-- | features/steps/project/deploy_keys.rb | 16 | ||||
-rw-r--r-- | features/steps/project/merge_requests.rb | 7 | ||||
-rw-r--r-- | features/steps/project/pages.rb | 16 | ||||
-rw-r--r-- | features/steps/project/project_milestone.rb | 3 | ||||
-rw-r--r-- | features/steps/shared/note.rb | 4 | ||||
-rw-r--r-- | features/support/env.rb | 9 |
15 files changed, 81 insertions, 48 deletions
diff --git a/features/group/milestones.feature b/features/group/milestones.feature index d6c05df9840..1c1539b3e12 100644 --- a/features/group/milestones.feature +++ b/features/group/milestones.feature @@ -38,6 +38,7 @@ Feature: Group Milestones And I should see the "feature" label And I should see the project name in the Issue row + @javascript Scenario: I should see the Labels tab Given Group has projects with milestones When I visit group "Owned" page diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature index 0d6f7350181..34201cd8486 100644 --- a/features/project/active_tab.feature +++ b/features/project/active_tab.feature @@ -63,13 +63,6 @@ Feature: Project Active Tab And no other sub tabs should be active And the active main tab should be Settings - Scenario: On Project Settings/Pages - Given I visit my project's settings page - And I click the "Pages" tab - Then the active sub tab should be Pages - And no other sub tabs should be active - And the active main tab should be Settings - Scenario: On Project Members Given I visit my project's members page Then the active sub tab should be Members diff --git a/features/project/builds/artifacts.feature b/features/project/builds/artifacts.feature index 52dc15f2eb6..5abc24949cf 100644 --- a/features/project/builds/artifacts.feature +++ b/features/project/builds/artifacts.feature @@ -17,6 +17,7 @@ Feature: Project Builds Artifacts When I visit recent build details page And I click artifacts browse button Then I should see content of artifacts archive + And I should see the build header Scenario: I browse subdirectory of build artifacts Given recent build has artifacts available @@ -25,6 +26,7 @@ Feature: Project Builds Artifacts And I click artifacts browse button And I click link to subdirectory within build artifacts Then I should see content of subdirectory within artifacts archive + And I should see the directory name in the breadcrumb Scenario: I browse directory with UTF-8 characters in name Given recent build has artifacts available @@ -44,13 +46,14 @@ Feature: Project Builds Artifacts And I navigate to parent directory of directory with invalid name Then I should not see directory with invalid name on the list + @javascript Scenario: I download a single file from build artifacts Given recent build has artifacts available And recent build has artifacts metadata available When I visit recent build details page And I click artifacts browse button And I click a link to file within build artifacts - Then download of a file extracted from build artifacts should start + Then I see a download link @javascript Scenario: I click on a row in an artifacts table diff --git a/features/project/deploy_keys.feature b/features/project/deploy_keys.feature index 960b4100ee5..6f1ed9ff5b6 100644 --- a/features/project/deploy_keys.feature +++ b/features/project/deploy_keys.feature @@ -3,28 +3,33 @@ Feature: Project Deploy Keys Given I sign in as a user And I own project "Shop" + @javascript Scenario: I should see deploy keys list Given project has deploy key When I visit project deploy keys page Then I should see project deploy key + @javascript Scenario: I should see project deploy keys Given other projects have deploy keys When I visit project deploy keys page Then I should see other project deploy key And I should only see the same deploy key once + @javascript Scenario: I should see public deploy keys Given public deploy key exists When I visit project deploy keys page Then I should see public deploy key + @javascript Scenario: I add new deploy key Given I visit project deploy keys page And I submit new deploy key Then I should be on deploy keys page And I should see newly created deploy key + @javascript Scenario: I attach other project deploy key to project Given other projects have deploy keys And I visit project deploy keys page @@ -32,6 +37,7 @@ Feature: Project Deploy Keys Then I should be on deploy keys page And I should see newly created deploy key + @javascript Scenario: I attach public deploy key to project Given public deploy key exists And I visit project deploy keys page diff --git a/features/project/milestone.feature b/features/project/milestone.feature index 713f0f3b979..5e7b211fa27 100644 --- a/features/project/milestone.feature +++ b/features/project/milestone.feature @@ -7,14 +7,6 @@ Feature: Project Milestone And milestone has issue "Bugfix1" with labels: "bug", "feature" And milestone has issue "Bugfix2" with labels: "bug", "enhancement" - - @javascript - Scenario: Listing issues from issues tab - Given I visit project "Shop" milestones page - And I click link "v2.2" - Then I should see the labels "bug", "enhancement" and "feature" - And I should see the "bug" label listed only once - @javascript Scenario: Listing labels from labels tab Given I visit project "Shop" milestones page diff --git a/features/project/pages.feature b/features/project/pages.feature index 87d88348d09..56e47287b5c 100644 --- a/features/project/pages.feature +++ b/features/project/pages.feature @@ -3,10 +3,15 @@ Feature: Project Pages Given I sign in as a user And I own a project - Scenario: Pages are disabled + Scenario: I cannot navigate to Pages settings if pages enabled Given pages are disabled - When I visit the Project Pages - Then I should see that GitLab Pages are disabled + And I visit my project's settings page + Then I should not see the "Pages" tab + + Scenario: I can navigate to Pages settings if pages enabled + Given pages are enabled + And I visit my project's settings page + Then I should see the "Pages" tab Scenario: I can see the pages usage if not deployed Given pages are enabled diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb index f8f5e3f2382..49fcd6f1201 100644 --- a/features/steps/group/milestones.rb +++ b/features/steps/group/milestones.rb @@ -1,4 +1,5 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps + include WaitForAjax include SharedAuthentication include SharedPaths include SharedGroup @@ -90,6 +91,8 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps end step 'I should see the list of labels' do + wait_for_ajax + page.within('#tab-labels') do expect(page).to have_content 'bug' expect(page).to have_content 'feature' diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index 4befd49ac81..5cd9bd38c9d 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -39,12 +39,6 @@ class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps end end - step 'I click the "Pages" tab' do - page.within '.sub-nav' do - click_link('Pages') - end - end - step 'I click the "Activity" tab' do page.within '.sub-nav' do click_link('Activity') diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb index be0f6eee55a..eec375b0532 100644 --- a/features/steps/project/builds/artifacts.rb +++ b/features/steps/project/builds/artifacts.rb @@ -3,6 +3,7 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps include SharedProject include SharedBuilds include RepoHelpers + include WaitForAjax step 'I click artifacts download button' do click_link 'Download' @@ -22,6 +23,12 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps end end + 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}" + end + end + step 'I click link to subdirectory within build artifacts' do page.within('.tree-table') { click_link 'other_artifacts_0.1.2' } end @@ -34,6 +41,12 @@ class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps end end + step 'I should see the directory name in the breadcrumb' do + page.within('.repo-breadcrumb') do + expect(page).to have_content 'other_artifacts_0.1.2' + end + end + step 'recent build artifacts contain directory with UTF-8 characters' do # metadata fixture contains relevant directory end @@ -66,19 +79,11 @@ 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 end - step 'download of a file extracted from build artifacts should start' do - send_data = response_headers[Gitlab::Workhorse::SEND_DATA_HEADER] - - expect(send_data).to start_with('artifacts-entry:') - - base64_params = send_data.sub(/\Aartifacts\-entry:/, '') - params = JSON.parse(Base64.urlsafe_decode64(base64_params)) - - expect(params.keys).to eq(%w(Archive Entry)) - expect(params['Archive']).to end_with('build_artifacts.zip') - expect(params['Entry']).to eq(Base64.encode64('ci_artifacts.txt')) + step 'I see a download link' do + expect(page).to have_link 'download it' end step 'I click a first row within build artifacts table' do diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index ec59a2c094e..8ad9d4a4741 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -8,19 +8,19 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should see project deploy key' do - page.within '.deploy-keys' do + page.within(find('.deploy-keys')) do expect(page).to have_content deploy_key.title end end step 'I should see other project deploy key' do - page.within '.deploy-keys' do + page.within(find('.deploy-keys')) do expect(page).to have_content other_deploy_key.title end end step 'I should see public deploy key' do - page.within '.deploy-keys' do + page.within(find('.deploy-keys')) do expect(page).to have_content public_deploy_key.title end end @@ -40,7 +40,8 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should see newly created deploy key' do - page.within '.deploy-keys' do + @project.reload + page.within(find('.deploy-keys')) do expect(page).to have_content(deploy_key.title) end end @@ -56,7 +57,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should only see the same deploy key once' do - page.within '.deploy-keys' do + page.within(find('.deploy-keys')) do expect(page).to have_selector('ul li', count: 1) end end @@ -66,8 +67,9 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I click attach deploy key' do - page.within '.deploy-keys' do - click_link 'Enable' + page.within(find('.deploy-keys')) do + click_button 'Enable' + expect(page).not_to have_selector('.fa-spinner') end end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index a06b2f2911f..4b7d6cd840b 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -458,6 +458,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Comment" end + wait_for_ajax + page.within ".files>div:nth-child(2) .note-body > .note-text" do expect(page).to have_content "Line is correct" end @@ -470,6 +472,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps fill_in "note_note", with: "Line is wrong on here" click_button "Comment" end + + wait_for_ajax end step 'I should still see a comment like "Line is correct" in the second file' do @@ -574,6 +578,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps fill_in "note_note", with: message click_button "Comment" end + + wait_for_ajax + page.within(".notes_holder", visible: true) do expect(page).to have_content message end diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb index 4045955a8b9..fea82d9fb57 100644 --- a/features/steps/project/pages.rb +++ b/features/steps/project/pages.rb @@ -18,14 +18,22 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps visit namespace_project_pages_path(@project.namespace, @project) end - step 'I should see that GitLab Pages are disabled' do - expect(page).to have_content('GitLab Pages are disabled') - end - step 'I should see the usage of GitLab Pages' do expect(page).to have_content('Configure pages') end + step 'I should see the "Pages" tab' do + page.within '.sub-nav' do + expect(page).to have_link('Pages') + end + end + + step 'I should not see the "Pages" tab' do + page.within '.sub-nav' do + expect(page).not_to have_link('Pages') + end + end + step 'pages are deployed' do pipeline = @project.ensure_pipeline('HEAD', @project.commit('HEAD').sha) build = build(:ci_build, diff --git a/features/steps/project/project_milestone.rb b/features/steps/project/project_milestone.rb index 1864b3a2b52..dc1190b7eea 100644 --- a/features/steps/project/project_milestone.rb +++ b/features/steps/project/project_milestone.rb @@ -2,6 +2,7 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps include SharedAuthentication include SharedProject include SharedPaths + include WaitForAjax step 'milestone has issue "Bugfix1" with labels: "bug", "feature"' do project = Project.find_by(name: "Shop") @@ -34,6 +35,8 @@ class Spinach::Features::ProjectMilestone < Spinach::FeatureSteps end step 'I should see the labels "bug", "enhancement" and "feature"' do + wait_for_ajax + page.within('#tab-issues') do expect(page).to have_content 'bug' expect(page).to have_content 'enhancement' diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 7885cc7ab77..7d260025052 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -24,6 +24,8 @@ module SharedNote fill_in "note[note]", with: "XML attached" click_button "Comment" end + + wait_for_ajax end step 'I preview a comment text like "Bug fixed :smile:"' do @@ -37,6 +39,8 @@ module SharedNote page.within(".js-main-target-form") do click_button "Comment" end + + wait_for_ajax end step 'I write a comment like ":+1: Nice"' do diff --git a/features/support/env.rb b/features/support/env.rb index 06c804b1db7..92d13bea4b6 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 sidekiq).each do |f| +%w(select2_helper test_env repo_helpers wait_for_ajax wait_for_requests sidekiq).each do |f| require Rails.root.join('spec', 'support', f) end @@ -30,6 +30,13 @@ Spinach.hooks.before_run do include FactoryGirl::Syntax::Methods end +Spinach.hooks.after_feature do |feature_data| + if feature_data.scenarios.flat_map(&:tags).include?('javascript') + include WaitForRequests + wait_for_requests_complete + end +end + module StdoutReporterWithScenarioLocation # Override the standard reporter to show filename and line number next to each # scenario for easy, focused re-runs |