Assert prod environment is live after Auto Devops

Goes to Operations > Environments and clicks on the
"View deployment" link for production.
This commit is contained in:
Thong Kuah 2018-10-05 16:36:32 +13:00
parent f71c497f5d
commit bde028c4af
5 changed files with 69 additions and 0 deletions

View File

@ -201,6 +201,11 @@ module QA
end
module Operations
module Environments
autoload :Index, 'qa/page/project/operations/environments/index'
autoload :Show, 'qa/page/project/operations/environments/show'
end
module Kubernetes
autoload :Index, 'qa/page/project/operations/kubernetes/index'
autoload :Add, 'qa/page/project/operations/kubernetes/add'

View File

@ -40,6 +40,14 @@ module QA
end
end
def click_operations_environments
hover_operations do
within_submenu do
click_link('Environments')
end
end
end
def click_operations_kubernetes
hover_operations do
within_submenu do

View File

@ -0,0 +1,23 @@
# frozen_string_literal: true
module QA
module Page
module Project
module Operations
module Environments
class Index < Page::Base
view 'app/assets/javascripts/environments/components/environment_item.vue' do
element :environment_link, 'class="environment-name table-mobile-content"'
end
def go_to_environment(environment_name)
wait(reload: false) do
click_link(environment_name)
end
end
end
end
end
end
end
end

View File

@ -0,0 +1,23 @@
# frozen_string_literal: true
module QA
module Page
module Project
module Operations
module Environments
class Show < Page::Base
view 'app/views/projects/environments/_external_url.html.haml' do
element :view_deployment, %q{title: s_('Environments|Open live environment')}
end
def view_deployment(&block)
new_window = window_opened_by { click_on('Open live environment') }
within_window(new_window, &block) if block
end
end
end
end
end
end
end

View File

@ -65,6 +65,16 @@ module QA
expect(pipeline).to have_build('test', status: :success, wait: 600)
expect(pipeline).to have_build('production', status: :success, wait: 1200)
end
Page::Menu::Side.act { click_operations_environments }
Page::Project::Operations::Environments::Index.perform do |index|
index.go_to_environment('production')
end
Page::Project::Operations::Environments::Show.perform do |show|
show.view_deployment do
expect(page).to have_content('Hello World!')
end
end
end
end
end