Commit de0fa351 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Implement QA factory for enabling hashed storage

[ci skip]
parent db7037bf
......@@ -49,6 +49,10 @@ module QA
module Sandbox
autoload :Prepare, 'qa/scenario/gitlab/sandbox/prepare'
end
module Admin
autoload :HashedStorage, 'qa/scenario/gitlab/admin/hashed_storage'
end
end
end
......@@ -81,6 +85,7 @@ module QA
module Admin
autoload :Menu, 'qa/page/admin/menu'
autoload :Settings, 'qa/page/admin/settings'
end
module Mattermost
......
......@@ -11,10 +11,9 @@ module QA
attribute :geo_secondary_name, '--secondary-name SECONDARY_NAME'
def perform(**args)
# TODO, abstract this away in the Factory module
# TODO, Factory::License -> gitlab-org/gitlab-qa#86
#
QA::Specs::Config.act { configure_capybara! }
# TODO, devise a way to decouple licence factory from Runtime.gitlab_address
QA::Runtime::Scenario.define(:gitlab_address, args[:geo_primary_address])
Geo::Primary.act do
......@@ -45,17 +44,19 @@ module QA
end
def add_license
# TODO move ENV call to the scenario
# TODO EE license to Runtime.license, gitlab-org/gitlab-qa#86
#
Scenario::License::Add.perform(ENV['EE_LICENSE'])
end
def enable_hashed_storage
# TODO implement hashed storage factory
# TODO, Factory::HashedStorage - gitlab-org/gitlab-qa#86
#
QA::Scenario::Gitlab::Admin::HashedStorage.perform(:enabled)
end
def add_secondary_node
# TODO implement secondary node factory
# TODO EE::Factory::GeoNode - gitlab-org/gitlab-qa#86
end
def set_replication_password
......@@ -83,7 +84,6 @@ module QA
require 'uri'
host = URI(QA::Runtime::Scenario.geo_primary_address).host
host = '172.22.0.2' #tmp
slot = QA::Runtime::Scenario.geo_primary_name.tr('-', '_')
gitlab_ctl "replicate-geo-database --host=#{host} --slot-name=#{slot} " \
......
......@@ -2,9 +2,16 @@ module QA
module Page
module Admin
class Menu < Page::Base
def go_to_geo_nodes
click_link 'Geo Nodes'
end
def go_to_license
link = find_link 'License'
link.click
click_link 'License'
end
def go_to_settings
click_link 'Settings'
end
end
end
......
module QA
module Page
module Admin
class Settings < Page::Base
def enable_hashed_storage
check 'Create new projects using hashed storage paths'
end
def save_settings
scroll_to '.form-actions' do
click_button 'Save'
end
end
end
end
end
end
......@@ -9,6 +9,14 @@ module QA
def refresh
visit current_path
end
def scroll_to(css, &block)
page.execute_script <<~JS
document.getElementsByClassName("#{css.sub(/^\./, '')}")[0].scrollIntoView();
JS
page.within(css, &block)
end
end
end
end
module QA
module Scenario
module Gitlab
module Admin
class HashedStorage < Scenario::Template
def perform(*traits)
raise ArgumentError unless traits.include?(:enabled)
Page::Main::Entry.act { sign_in_using_credentials }
Page::Main::Menu.act { go_to_admin_area }
Page::Admin::Menu.act { go_to_settings }
Page::Admin::Settings.act do
enable_hashed_storage
save_settings
end
QA::Page::Main::Menu.act { sign_out }
end
end
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