Commit df8d9a44 authored by Mark Lapierre's avatar Mark Lapierre

Merge branch '246791-fix-ci-variable-spec' into 'master'

Fix CI Variable spec

See merge request gitlab-org/gitlab!44514
parents 57e0cdcc 24f7e157
...@@ -26,6 +26,10 @@ module QA ...@@ -26,6 +26,10 @@ module QA
within_element(:ci_variable_key_field) { find('input').set key } within_element(:ci_variable_key_field) { find('input').set key }
fill_element :ci_variable_value_field, value fill_element :ci_variable_value_field, value
click_ci_variable_save_button click_ci_variable_save_button
wait_until(reload: false) do
within_element(:ci_variable_table_content) { has_element?(:edit_ci_variable_button) }
end
end end
def click_add_variable def click_add_variable
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module QA module QA
RSpec.describe 'Verify' do RSpec.describe 'Verify' do
describe 'Add or Remove CI variable via UI', :smoke do describe 'Add or Remove CI variable via UI', :smoke do
let!(:project) do let(:project) do
Resource::Project.fabricate_via_api! do |project| Resource::Project.fabricate_via_api! do |project|
project.name = 'project-with-ci-variables' project.name = 'project-with-ci-variables'
project.description = 'project with CI variables' project.description = 'project with CI variables'
...@@ -12,31 +12,27 @@ module QA ...@@ -12,31 +12,27 @@ module QA
before do before do
Flow::Login.sign_in Flow::Login.sign_in
project.visit!
add_ci_variable add_ci_variable
open_ci_cd_settings
end end
it 'user adds a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/395' do it 'user adds a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/395' do
Page::Project::Settings::CICD.perform do |settings| Page::Project::Settings::CiVariables.perform do |ci_variable|
settings.expand_ci_variables do |page| expect(ci_variable).to have_text('VARIABLE_KEY')
expect(page).to have_text('VARIABLE_KEY') expect(ci_variable).to have_no_text('some_CI_variable')
expect(page).not_to have_text('some_CI_variable')
page.click_reveal_ci_variable_value_button ci_variable.click_reveal_ci_variable_value_button
expect(page).to have_text('some_CI_variable') expect(ci_variable).to have_text('some_CI_variable')
end
end end
end end
it 'user removes a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/394' do it 'user removes a CI variable', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/394' do
Page::Project::Settings::CICD.perform do |settings| Page::Project::Settings::CiVariables.perform do |ci_variable|
settings.expand_ci_variables do |page| ci_variable.click_edit_ci_variable
page.click_edit_ci_variable ci_variable.click_ci_variable_delete_button
page.click_ci_variable_delete_button
expect(page).not_to have_text('VARIABLE_KEY') expect(ci_variable).to have_text('There are no variables yet', wait: 60)
end
end end
end end
...@@ -50,11 +46,6 @@ module QA ...@@ -50,11 +46,6 @@ module QA
ci_variable.masked = false ci_variable.masked = false
end end
end end
def open_ci_cd_settings
project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
end
end end
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