Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorDan Davison <ddavison@gitlab.com>2019-02-21 22:23:02 +0300
committerDan Davison <ddavison@gitlab.com>2019-02-21 22:23:02 +0300
commit0b846d7c550827795918c5b43ffc2d8709a2c4c7 (patch)
tree24fc40e09e7f0202eb37170e38acf6d868e525e2 /qa
parentcd401a589e292180ca7233fe5687ec2ff404faa2 (diff)
parent5ae46fe7a5f4e3327de4d2b1bd1830308176901d (diff)
Merge branch '57930-create-smoke-test-for-autodevops' into 'master'
Resolve "Create smoke test for AutoDevOps" Closes #57930 See merge request gitlab-org/gitlab-ce!25442
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb4
-rw-r--r--qa/qa/page/alert/auto_devops_alert.rb13
-rw-r--r--qa/qa/page/project/pipeline/show.rb10
-rw-r--r--qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb45
4 files changed, 66 insertions, 6 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index d6dcfa3032b..2b3ffabbbaa 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -260,6 +260,10 @@ module QA
autoload :Sidebar, 'qa/page/issuable/sidebar'
end
+ module Alert
+ autoload :AutoDevopsAlert, 'qa/page/alert/auto_devops_alert'
+ end
+
module Layout
autoload :Banner, 'qa/page/layout/banner'
end
diff --git a/qa/qa/page/alert/auto_devops_alert.rb b/qa/qa/page/alert/auto_devops_alert.rb
new file mode 100644
index 00000000000..8f66c805b77
--- /dev/null
+++ b/qa/qa/page/alert/auto_devops_alert.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Alert
+ class AutoDevopsAlert < Page::Base
+ view 'app/views/shared/_auto_devops_implicitly_enabled_banner.html.haml' do
+ element :auto_devops_banner
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb
index f192f1fc64b..22b0a168964 100644
--- a/qa/qa/page/project/pipeline/show.rb
+++ b/qa/qa/page/project/pipeline/show.rb
@@ -18,6 +18,10 @@ module QA::Page
element :status_icon, 'ci-status-icon-${status}' # rubocop:disable QA/ElementWithPattern
end
+ view 'app/views/projects/pipelines/_info.html.haml' do
+ element :pipeline_badges
+ end
+
def running?
within('.ci-header-container') do
page.has_content?('running')
@@ -32,6 +36,12 @@ module QA::Page
end
end
+ def has_tag?(tag_name)
+ within_element(:pipeline_badges) do
+ has_selector?('.badge', text: tag_name)
+ end
+ end
+
def go_to_job(job_name)
find_element(:job_link, job_name).click
end
diff --git a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
index 8b165a04382..02bd378acfc 100644
--- a/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
+++ b/qa/qa/specs/features/browser_ui/7_configure/auto_devops/create_project_with_auto_devops_spec.rb
@@ -4,13 +4,13 @@ require 'pathname'
module QA
# Transient failure issue: https://gitlab.com/gitlab-org/quality/nightly/issues/68
- context 'Configure', :orchestrated, :kubernetes, :quarantine do
- describe 'Auto DevOps support' do
- def login
- Runtime::Browser.visit(:gitlab, Page::Main::Login)
- Page::Main::Login.perform(&:sign_in_using_credentials)
- end
+ context 'Configure' do
+ def login
+ Runtime::Browser.visit(:gitlab, Page::Main::Login)
+ Page::Main::Login.perform(&:sign_in_using_credentials)
+ end
+ describe 'Auto DevOps support', :orchestrated, :kubernetes, :quarantine do
[true, false].each do |rbac|
context "when rbac is #{rbac ? 'enabled' : 'disabled'}" do
before(:all) do
@@ -173,5 +173,38 @@ module QA
end
end
end
+
+ describe 'Auto DevOps', :smoke do
+ it 'enables AutoDevOps by default' do
+ login
+
+ project = Resource::Project.fabricate! do |p|
+ p.name = Runtime::Env.auto_devops_project_name || 'project-with-autodevops'
+ p.description = 'Project with AutoDevOps'
+ end
+
+ project.visit!
+
+ Page::Alert::AutoDevopsAlert.perform do |alert|
+ expect(alert).to have_text(/.*The Auto DevOps pipeline has been enabled.*/)
+ end
+
+ # Create AutoDevOps repo
+ Resource::Repository::ProjectPush.fabricate! do |push|
+ push.project = project
+ push.directory = Pathname
+ .new(__dir__)
+ .join('../../../../../fixtures/auto_devops_rack')
+ push.commit_message = 'Create AutoDevOps compatible Project'
+ end
+
+ Page::Project::Menu.perform(&:click_ci_cd_pipelines)
+ Page::Project::Pipeline::Index.perform(&:go_to_latest_pipeline)
+
+ Page::Project::Pipeline::Show.perform do |pipeline|
+ expect(pipeline).to have_tag('Auto DevOps')
+ end
+ end
+ end
end
end