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') - breadcrumb_title _('Pipelines')
- page_title s_('Pipeline|Run pipeline') - page_title s_('Pipeline|Run pipeline')
- settings_link = link_to _('CI/CD settings'), project_settings_ci_cd_path(@project)
%h3.page-title %h3.page-title
= s_('Pipeline|Run pipeline') = s_('Pipeline|Run pipeline')
......
...@@ -5562,9 +5562,6 @@ msgstr "" ...@@ -5562,9 +5562,6 @@ msgstr ""
msgid "CI/CD for external repo" msgid "CI/CD for external repo"
msgstr "" msgstr ""
msgid "CI/CD settings"
msgstr ""
msgid "CICDAnalytics|%{percent}%{percentSymbol}" msgid "CICDAnalytics|%{percent}%{percentSymbol}"
msgstr "" msgstr ""
......
...@@ -663,16 +663,20 @@ RSpec.describe 'Pipelines', :js do ...@@ -663,16 +663,20 @@ RSpec.describe 'Pipelines', :js do
context 'for valid commit', :js do context 'for valid commit', :js do
before do before do
click_button project.default_branch click_button project.default_branch
wait_for_requests
find('p', text: 'master').click
wait_for_requests
end end
context 'with gitlab-ci.yml' do context 'with gitlab-ci.yml', :js do
before do before do
stub_ci_pipeline_to_return_yaml_file stub_ci_pipeline_to_return_yaml_file
end end
it 'creates a new pipeline' do it 'creates a new pipeline' do
expect do expect do
click_on 'Run Pipeline' click_on 'Run pipeline'
wait_for_requests wait_for_requests
end end
.to change { Ci::Pipeline.count }.by(1) .to change { Ci::Pipeline.count }.by(1)
...@@ -684,19 +688,17 @@ RSpec.describe 'Pipelines', :js do ...@@ -684,19 +688,17 @@ RSpec.describe 'Pipelines', :js do
context 'when variables are specified' do context 'when variables are specified' do
it 'creates a new pipeline with variables' 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-key']").set('key_name')
find("[data-testid='pipeline-form-ci-variable-value']").set('value') find("[data-testid='pipeline-form-ci-variable-value']").set('value')
end end
expect do expect do
click_on 'Run Pipeline' click_on 'Run pipeline'
wait_for_requests wait_for_requests
end end
.to change { Ci::Pipeline.count }.by(1) .to change { Ci::Pipeline.count }.by(1)
wait_for_requests
expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) }) expect(Ci::Pipeline.last.variables.map { |var| var.slice(:key, :secret_value) })
.to eq [{ key: "key_name", secret_value: "value" }.with_indifferent_access] .to eq [{ key: "key_name", secret_value: "value" }.with_indifferent_access]
end end
...@@ -705,18 +707,16 @@ RSpec.describe 'Pipelines', :js do ...@@ -705,18 +707,16 @@ RSpec.describe 'Pipelines', :js do
context 'without gitlab-ci.yml' do context 'without gitlab-ci.yml' do
before do before do
click_on 'Run Pipeline' click_on 'Run pipeline'
wait_for_requests wait_for_requests
end end
it { expect(page).to have_content('Missing CI config file') } 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 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 stub_ci_pipeline_to_return_yaml_file
expect do expect do
click_on 'Run Pipeline' click_on 'Run pipeline'
wait_for_requests wait_for_requests
end end
.to change { Ci::Pipeline.count }.by(1) .to change { Ci::Pipeline.count }.by(1)
...@@ -787,8 +787,8 @@ RSpec.describe 'Pipelines', :js do ...@@ -787,8 +787,8 @@ RSpec.describe 'Pipelines', :js do
describe 'new pipeline page' do describe 'new pipeline page' do
it 'has field to add a new pipeline' do it 'has field to add a new pipeline' do
expect(page).to have_selector('.js-branch-select') expect(page).to have_selector('[data-testid="ref-select"]')
expect(find('.js-branch-select')).to have_content project.default_branch expect(find('[data-testid="ref-select"]')).to have_content project.default_branch
expect(page).to have_content('Run for') expect(page).to have_content('Run for')
end end
end end
...@@ -797,10 +797,10 @@ RSpec.describe 'Pipelines', :js do ...@@ -797,10 +797,10 @@ RSpec.describe 'Pipelines', :js do
it 'shows filtered pipelines', :js do it 'shows filtered pipelines', :js do
click_button project.default_branch click_button project.default_branch
page.within '.dropdown-menu' do page.within '[data-testid="ref-select"]' do
find('.dropdown-input-field').native.send_keys('fix') 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') expect(page).to have_content('fix')
end end
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