Commit 790a1cd9 authored by ddavison's avatar ddavison

Ensure autodevops is enabled before running Smoke test

Extract #enable_autodevops to new page object
Change Smoke test naming to only running pipeline
Generate AutoDevOps project with SecureRandom suffix
parent df35d772
...@@ -204,6 +204,7 @@ module QA ...@@ -204,6 +204,7 @@ module QA
autoload :Main, 'qa/page/project/settings/main' autoload :Main, 'qa/page/project/settings/main'
autoload :Repository, 'qa/page/project/settings/repository' autoload :Repository, 'qa/page/project/settings/repository'
autoload :CICD, 'qa/page/project/settings/ci_cd' autoload :CICD, 'qa/page/project/settings/ci_cd'
autoload :AutoDevops, 'qa/page/project/settings/auto_devops'
autoload :DeployKeys, 'qa/page/project/settings/deploy_keys' autoload :DeployKeys, 'qa/page/project/settings/deploy_keys'
autoload :DeployTokens, 'qa/page/project/settings/deploy_tokens' autoload :DeployTokens, 'qa/page/project/settings/deploy_tokens'
autoload :ProtectedBranches, 'qa/page/project/settings/protected_branches' autoload :ProtectedBranches, 'qa/page/project/settings/protected_branches'
......
# frozen_string_literal: true
module QA
module Page
module Project
module Settings
class AutoDevops < Page::Base
view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do
element :enable_autodevops_checkbox
element :save_changes_button
end
def enable_autodevops
check_element :enable_autodevops_checkbox
click_element :save_changes_button
end
end
end
end
end
end
...@@ -13,11 +13,6 @@ module QA ...@@ -13,11 +13,6 @@ module QA
element :variables_settings_content element :variables_settings_content
end end
view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do
element :enable_autodevops_checkbox
element :save_changes_button
end
def expand_runners_settings(&block) def expand_runners_settings(&block)
expand_section(:runners_settings_content) do expand_section(:runners_settings_content) do
Settings::Runners.perform(&block) Settings::Runners.perform(&block)
...@@ -30,10 +25,9 @@ module QA ...@@ -30,10 +25,9 @@ module QA
end end
end end
def enable_auto_devops def expand_auto_devops(&block)
expand_section(:autodevops_settings_content) do expand_section(:autodevops_settings_content) do
check_element :enable_autodevops_checkbox Settings::AutoDevops.perform(&block)
click_element :save_changes_button
end end
end end
end end
......
...@@ -147,23 +147,31 @@ module QA ...@@ -147,23 +147,31 @@ module QA
end end
describe 'Auto DevOps', :smoke do describe 'Auto DevOps', :smoke do
it 'enables AutoDevOps by default' do before do
login login
project = Resource::Project.fabricate! do |p| @project = Resource::Project.fabricate_via_browser_ui! do |p|
p.name = Runtime::Env.auto_devops_project_name || 'project-with-autodevops' p.name = "project-with-autodevops-#{SecureRandom.hex(8)}"
p.description = 'Project with AutoDevOps' p.description = 'Project with AutoDevOps'
end end
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform(&:expand_auto_devops)
Page::Project::Settings::AutoDevops.perform(&:enable_autodevops)
@project.visit!
# Create AutoDevOps repo # Create AutoDevOps repo
Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
push.project = project push.project = @project
push.directory = Pathname push.directory = Pathname
.new(__dir__) .new(__dir__)
.join('../../../../../fixtures/auto_devops_rack') .join('../../../../../fixtures/auto_devops_rack')
push.commit_message = 'Create AutoDevOps compatible Project' push.commit_message = 'Create AutoDevOps compatible Project'
end end
end
it 'runs an AutoDevOps pipeline' do
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
......
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