diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-05-07 23:39:37 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-05-07 23:39:37 +0000 |
commit | d550211eb101d82da2887e1eccde5c338388669d (patch) | |
tree | b33a6babbc531e23ff2bf2b3bb9ad170d1074624 /features | |
parent | f9fcd2b4100d54255c2508439e9f924543aed7a7 (diff) | |
download | gitlab-ce-d550211eb101d82da2887e1eccde5c338388669d.tar.gz |
Replace the `project/builds/artifacts.feature` spinach test with an rspec analog
Diffstat (limited to 'features')
-rw-r--r-- | features/project/builds/artifacts.feature | 65 | ||||
-rw-r--r-- | features/steps/project/builds/artifacts.rb | 98 | ||||
-rw-r--r-- | features/steps/shared/builds.rb | 53 |
3 files changed, 0 insertions, 216 deletions
diff --git a/features/project/builds/artifacts.feature b/features/project/builds/artifacts.feature deleted file mode 100644 index 5abc24949cf..00000000000 --- a/features/project/builds/artifacts.feature +++ /dev/null @@ -1,65 +0,0 @@ -Feature: Project Builds Artifacts - Background: - Given I sign in as a user - And I own a project - And project has CI enabled - And project has a recent build - - Scenario: I download build artifacts - Given recent build has artifacts available - When I visit recent build details page - And I click artifacts download button - Then download of build artifacts archive starts - - Scenario: I browse 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 - 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 - And recent build has artifacts metadata available - When I visit recent build details page - 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 - And recent build has artifacts metadata available - And recent build artifacts contain directory with UTF-8 characters - When I visit recent build details page - And I click artifacts browse button - And I navigate to directory with UTF-8 characters in name - Then I should see content of directory with UTF-8 characters in name - - Scenario: I try to browse directory with invalid UTF-8 characters in name - Given recent build has artifacts available - And recent build has artifacts metadata available - And recent build artifacts contain directory with invalid UTF-8 characters - When I visit recent build details page - And I click artifacts browse button - 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 I see a download link - - @javascript - Scenario: I click on a row in an artifacts table - 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 first row within build artifacts table - Then page with a coresponding path is loading diff --git a/features/steps/project/builds/artifacts.rb b/features/steps/project/builds/artifacts.rb deleted file mode 100644 index 4b72355b125..00000000000 --- a/features/steps/project/builds/artifacts.rb +++ /dev/null @@ -1,98 +0,0 @@ -class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedBuilds - include RepoHelpers - include WaitForRequests - - step 'I click artifacts download button' do - click_link 'Download' - end - - step 'I click artifacts browse button' do - click_link 'Browse' - expect(page).not_to have_selector('.build-sidebar') - end - - step 'I should see content of artifacts archive' do - page.within('.tree-table') do - expect(page).to have_no_content '..' - expect(page).to have_content 'other_artifacts_0.1.2' - expect(page).to have_content 'ci_artifacts.txt' - expect(page).to have_content 'rails_sample.jpg' - 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 #{@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 - - step 'I should see content of subdirectory within artifacts archive' do - page.within('.tree-table') do - expect(page).to have_content '..' - expect(page).to have_content 'another-subdirectory' - expect(page).to have_content 'doc_sample.txt' - 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 - - step 'I navigate to directory with UTF-8 characters in name' do - page.within('.tree-table') { click_link 'tests_encoding' } - page.within('.tree-table') { click_link 'utf8 test dir ✓' } - end - - step 'I should see content of directory with UTF-8 characters in name' do - page.within('.tree-table') do - expect(page).to have_content '..' - expect(page).to have_content 'regular_file_2' - end - end - - step 'recent build artifacts contain directory with invalid UTF-8 characters' do - # metadata fixture contains relevant directory - end - - step 'I navigate to parent directory of directory with invalid name' do - page.within('.tree-table') { click_link 'tests_encoding' } - end - - step 'I should not see directory with invalid name on the list' do - page.within('.tree-table') do - expect(page).to have_no_content('non-utf8-dir') - end - end - - step 'I click a link to file within build artifacts' do - page.within('.tree-table') { find_link('ci_artifacts.txt').click } - wait_for_requests - end - - 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 - row = first('tr[data-link]') - @row_path = row['data-link'] - row.click - end - - step 'page with a coresponding path is loading' do - expect(current_path).to eq @row_path - end -end diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb deleted file mode 100644 index c2197584d8d..00000000000 --- a/features/steps/shared/builds.rb +++ /dev/null @@ -1,53 +0,0 @@ -module SharedBuilds - include Spinach::DSL - - step 'project has CI enabled' do - @project.enable_ci - end - - step 'project has coverage enabled' do - @project.update_attribute(:build_coverage_regex, /Coverage (\d+)%/) - end - - step 'project has a recent build' do - @pipeline = create(:ci_empty_pipeline, project: @project, sha: @project.commit.sha, ref: 'master') - @build = create(:ci_build, :running, :coverage, :trace_artifact, pipeline: @pipeline) - end - - step 'recent build is successful' do - @build.success - end - - step 'recent build failed' do - @build.drop - end - - step 'project has another build that is running' do - create(:ci_build, pipeline: @pipeline, name: 'second build', status_event: 'run') - end - - step 'I visit recent build details page' do - visit project_job_path(@project, @build) - end - - step 'recent build has artifacts available' do - artifacts = Rails.root + 'spec/fixtures/ci_build_artifacts.zip' - archive = fixture_file_upload(artifacts, 'application/zip') - @build.update_attributes(legacy_artifacts_file: archive) - end - - step 'recent build has artifacts metadata available' do - metadata = Rails.root + 'spec/fixtures/ci_build_artifacts_metadata.gz' - gzip = fixture_file_upload(metadata, 'application/x-gzip') - @build.update_attributes(legacy_artifacts_metadata: gzip) - end - - step 'recent build has a build trace' do - @build.trace.set('job trace') - end - - step 'download of build artifacts archive starts' do - expect(page.response_headers['Content-Type']).to eq 'application/zip' - expect(page.response_headers['Content-Transfer-Encoding']).to eq 'binary' - end -end |