2016-01-15 07:09:20 -05:00
|
|
|
class Spinach::Features::ProjectBuildsArtifacts < Spinach::FeatureSteps
|
2016-01-05 07:46:42 -05:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
include SharedBuilds
|
|
|
|
include RepoHelpers
|
|
|
|
|
2016-01-07 04:33:07 -05:00
|
|
|
step 'I click artifacts download button' do
|
2016-04-20 05:11:22 -04:00
|
|
|
click_link 'Download'
|
2016-01-07 04:33:07 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'I click artifacts browse button' do
|
2016-04-20 05:11:22 -04:00
|
|
|
click_link 'Browse'
|
2016-08-11 12:48:32 -04:00
|
|
|
expect(page).not_to have_selector('.build-sidebar')
|
2016-01-07 04:33:07 -05:00
|
|
|
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 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
|
2016-01-12 05:41:24 -05:00
|
|
|
|
|
|
|
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
|
2016-01-12 09:16:16 -05:00
|
|
|
|
2016-01-18 04:18:16 -05:00
|
|
|
step 'I click a link to file within build artifacts' do
|
|
|
|
page.within('.tree-table') { find_link('ci_artifacts.txt').click }
|
2016-01-12 09:16:16 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
step 'download of a file extracted from build artifacts should start' do
|
2016-07-06 03:45:43 -04:00
|
|
|
send_data = response_headers[Gitlab::Workhorse::SEND_DATA_HEADER]
|
|
|
|
|
|
|
|
expect(send_data).to start_with('artifacts-entry:')
|
|
|
|
|
2016-07-11 08:06:35 -04:00
|
|
|
base64_params = send_data.sub(/\Aartifacts\-entry:/, '')
|
|
|
|
params = JSON.parse(Base64.urlsafe_decode64(base64_params))
|
2016-07-06 03:45:43 -04:00
|
|
|
|
2017-02-22 12:46:57 -05:00
|
|
|
expect(params.keys).to eq(%w(Archive Entry))
|
2016-07-06 03:45:43 -04:00
|
|
|
expect(params['Archive']).to end_with('build_artifacts.zip')
|
|
|
|
expect(params['Entry']).to eq(Base64.encode64('ci_artifacts.txt'))
|
2016-01-12 09:16:16 -05:00
|
|
|
end
|
2016-01-22 05:42:29 -05:00
|
|
|
|
|
|
|
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
|
2016-01-05 07:46:42 -05:00
|
|
|
end
|