Commit 6becd151 authored by Jose Vargas's avatar Jose Vargas Committed by Douglas Barbosa Alexandre

Readd missing data attribute, rework tests

parent a3af6dbd
- breadcrumb_title _('Pipelines')
- page_title s_('Pipeline|Run pipeline')
- settings_link = link_to _('CI/CD settings'), project_settings_ci_cd_path(@project)
%h3.page-title
= s_('Pipeline|Run pipeline')
......
......@@ -5562,9 +5562,6 @@ msgstr ""
msgid "CI/CD for external repo"
msgstr ""
msgid "CI/CD settings"
msgstr ""
msgid "CICDAnalytics|%{percent}%{percentSymbol}"
msgstr ""
......
......@@ -663,16 +663,20 @@ RSpec.describe 'Pipelines', :js do
context 'for valid commit', :js do
before do
click_button project.default_branch
wait_for_requests
find('p', text: 'master').click
wait_for_requests
end
context 'with gitlab-ci.yml' do
context 'with gitlab-ci.yml', :js do
before do
stub_ci_pipeline_to_return_yaml_file
end
it 'creates a new pipeline' do
expect do
click_on 'Run Pipeline'
click_on 'Run pipeline'
wait_for_requests
end
.to change { Ci::Pipeline.count }.by(1)
......@@ -684,19 +688,17 @@ RSpec.describe 'Pipelines', :js do
context 'when variables are specified' do
it 'creates a new pipeline with variables' do
page.within(all("[data-testid='ci-variable-row']")[0]) do
page.within(find("[data-testid='ci-variable-row']")) do
find("[data-testid='pipeline-form-ci-variable-key']").set('key_name')
find("[data-testid='pipeline-form-ci-variable-value']").set('value')
end
expect do
click_on 'Run Pipeline'
click_on 'Run pipeline'
wait_for_requests
end
.to change { Ci::Pipeline.count }.by(1)
wait_for_requests
expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) })
.to eq [{ key: "key_name", secret_value: "value" }.with_indifferent_access]
end
......@@ -705,18 +707,16 @@ RSpec.describe 'Pipelines', :js do
context 'without gitlab-ci.yml' do
before do
click_on 'Run Pipeline'
click_on 'Run pipeline'
wait_for_requests
end
it { expect(page).to have_content('Missing CI config file') }
it 'creates a pipeline after first request failed and a valid gitlab-ci.yml file is available when trying again' do
click_button project.default_branch
stub_ci_pipeline_to_return_yaml_file
expect do
click_on 'Run Pipeline'
click_on 'Run pipeline'
wait_for_requests
end
.to change { Ci::Pipeline.count }.by(1)
......@@ -787,8 +787,8 @@ RSpec.describe 'Pipelines', :js do
describe 'new pipeline page' do
it 'has field to add a new pipeline' do
expect(page).to have_selector('.js-branch-select')
expect(find('.js-branch-select')).to have_content project.default_branch
expect(page).to have_selector('[data-testid="ref-select"]')
expect(find('[data-testid="ref-select"]')).to have_content project.default_branch
expect(page).to have_content('Run for')
end
end
......@@ -797,10 +797,10 @@ RSpec.describe 'Pipelines', :js do
it 'shows filtered pipelines', :js do
click_button project.default_branch
page.within '.dropdown-menu' do
find('.dropdown-input-field').native.send_keys('fix')
page.within '[data-testid="ref-select"]' do
find('[data-testid="search-refs"]').native.send_keys('fix')
page.within '.dropdown-content' do
page.within '.gl-new-dropdown-contents' do
expect(page).to have_content('fix')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment