Merge branch 'qa-autodevops-smoke-check' into 'master'
Ensure autodevops is enabled before running Smoke test See merge request gitlab-org/gitlab-ce!31867
This commit is contained in:
commit
ca5724be5d
4 changed files with 36 additions and 12 deletions
1
qa/qa.rb
1
qa/qa.rb
|
@ -207,6 +207,7 @@ module QA
|
|||
autoload :Main, 'qa/page/project/settings/main'
|
||||
autoload :Repository, 'qa/page/project/settings/repository'
|
||||
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 :DeployTokens, 'qa/page/project/settings/deploy_tokens'
|
||||
autoload :ProtectedBranches, 'qa/page/project/settings/protected_branches'
|
||||
|
|
21
qa/qa/page/project/settings/auto_devops.rb
Normal file
21
qa/qa/page/project/settings/auto_devops.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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
|
|||
element :variables_settings_content
|
||||
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)
|
||||
expand_section(:runners_settings_content) do
|
||||
Settings::Runners.perform(&block)
|
||||
|
@ -30,10 +25,9 @@ module QA
|
|||
end
|
||||
end
|
||||
|
||||
def enable_auto_devops
|
||||
def expand_auto_devops(&block)
|
||||
expand_section(:autodevops_settings_content) do
|
||||
check_element :enable_autodevops_checkbox
|
||||
click_element :save_changes_button
|
||||
Settings::AutoDevops.perform(&block)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -147,23 +147,31 @@ module QA
|
|||
end
|
||||
|
||||
describe 'Auto DevOps', :smoke do
|
||||
it 'enables AutoDevOps by default' do
|
||||
before do
|
||||
login
|
||||
|
||||
project = Resource::Project.fabricate! do |p|
|
||||
p.name = Runtime::Env.auto_devops_project_name || 'project-with-autodevops'
|
||||
@project = Resource::Project.fabricate_via_browser_ui! do |p|
|
||||
p.name = "project-with-autodevops-#{SecureRandom.hex(8)}"
|
||||
p.description = 'Project with AutoDevOps'
|
||||
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
|
||||
Resource::Repository::ProjectPush.fabricate! do |push|
|
||||
push.project = project
|
||||
push.project = @project
|
||||
push.directory = Pathname
|
||||
.new(__dir__)
|
||||
.join('../../../../../fixtures/auto_devops_rack')
|
||||
push.commit_message = 'Create AutoDevOps compatible Project'
|
||||
end
|
||||
end
|
||||
|
||||
it 'runs an AutoDevOps pipeline' do
|
||||
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
|
||||
Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
|
||||
|
||||
|
|
Loading…
Reference in a new issue