Commit 24f7e157 authored by Tiffany Rea's avatar Tiffany Rea Committed by Mark Lapierre

Fix CI Variable spec

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