From 5cb0a2ef83ee4618b7dfa4fa90cbc95689246051 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Tue, 6 Mar 2018 00:24:16 +0200 Subject: Move ReadyToMerge vue component --- qa/qa/page/merge_request/show.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qa') diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index 2f2506f08fb..166861e6c4a 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -2,7 +2,7 @@ module QA module Page module MergeRequest class Show < Page::Base - view 'app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_ready_to_merge.js' do + view 'app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue' do element :merge_button element :fast_forward_message, 'Fast-forward merge without a merge commit' end -- cgit v1.2.1 From 896ae6fc15ab5e0da364681c3beef8d9f7e18d38 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 30 Mar 2018 11:26:04 +0300 Subject: Move repository, storage, abuse settings and logging settings to expandable sections Also reorganize application settings related to repository in more maninful sections Signed-off-by: Dmitriy Zaporozhets --- qa/qa.rb | 9 ++++++- qa/qa/factory/settings/hashed_storage.rb | 8 +++--- qa/qa/page/admin/settings.rb | 26 ------------------- qa/qa/page/admin/settings/main.rb | 21 ++++++++++++++++ qa/qa/page/admin/settings/repository_storage.rb | 33 +++++++++++++++++++++++++ qa/qa/page/project/settings/common.rb | 20 ++------------- qa/qa/page/settings/common.rb | 25 +++++++++++++++++++ qa/spec/page/validator_spec.rb | 2 +- 8 files changed, 95 insertions(+), 49 deletions(-) delete mode 100644 qa/qa/page/admin/settings.rb create mode 100644 qa/qa/page/admin/settings/main.rb create mode 100644 qa/qa/page/admin/settings/repository_storage.rb create mode 100644 qa/qa/page/settings/common.rb (limited to 'qa') diff --git a/qa/qa.rb b/qa/qa.rb index 7220af5088e..56a99c32b26 100644 --- a/qa/qa.rb +++ b/qa/qa.rb @@ -90,6 +90,10 @@ module QA autoload :OAuth, 'qa/page/main/oauth' end + module Settings + autoload :Common, 'qa/page/settings/common' + end + module Menu autoload :Main, 'qa/page/menu/main' autoload :Side, 'qa/page/menu/side' @@ -150,7 +154,10 @@ module QA end module Admin - autoload :Settings, 'qa/page/admin/settings' + module Settings + autoload :RepositoryStorage, 'qa/page/admin/settings/repository_storage' + autoload :Main, 'qa/page/admin/settings/main' + end end module Mattermost diff --git a/qa/qa/factory/settings/hashed_storage.rb b/qa/qa/factory/settings/hashed_storage.rb index 13ce2435fe4..cd9738715a6 100644 --- a/qa/qa/factory/settings/hashed_storage.rb +++ b/qa/qa/factory/settings/hashed_storage.rb @@ -9,9 +9,11 @@ module QA Page::Menu::Main.act { go_to_admin_area } Page::Menu::Admin.act { go_to_settings } - Page::Admin::Settings.act do - enable_hashed_storage - save_settings + Page::Admin::Settings::Main.perform do |setting| + setting.expand_repository_storage do |page| + enable_hashed_storage + save_settings + end end QA::Page::Menu::Main.act { sign_out } diff --git a/qa/qa/page/admin/settings.rb b/qa/qa/page/admin/settings.rb deleted file mode 100644 index 1f646103e7f..00000000000 --- a/qa/qa/page/admin/settings.rb +++ /dev/null @@ -1,26 +0,0 @@ -module QA - module Page - module Admin - class Settings < Page::Base - view 'app/views/admin/application_settings/_form.html.haml' do - element :form_actions, '.form-actions' - element :submit, "submit 'Save'" - element :repository_storage, '%legend Repository Storage' - element :hashed_storage, - 'Create new projects using hashed storage paths' - end - - def enable_hashed_storage - scroll_to 'legend', text: 'Repository 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 diff --git a/qa/qa/page/admin/settings/main.rb b/qa/qa/page/admin/settings/main.rb new file mode 100644 index 00000000000..e7c1220c967 --- /dev/null +++ b/qa/qa/page/admin/settings/main.rb @@ -0,0 +1,21 @@ +module QA + module Page + module Admin + module Settings + class Main < Page::Base + include QA::Page::Settings::Common + + view 'app/views/admin/application_settings/show.html.haml' do + element :advanced_settings_section, 'Repository storage' + end + + def expand_repository_storage(&block) + expand_section('Repository storage') do + RepositoryStorage.perform(&block) + end + end + end + end + end + end +end diff --git a/qa/qa/page/admin/settings/repository_storage.rb b/qa/qa/page/admin/settings/repository_storage.rb new file mode 100644 index 00000000000..34b4374fbe6 --- /dev/null +++ b/qa/qa/page/admin/settings/repository_storage.rb @@ -0,0 +1,33 @@ +module QA + module Page + module Admin + module Settings + class RepositoryStorage < Page::Base + view 'app/views/admin/application_settings/_repository_storage.html.haml' do + element :submit, "submit 'Save changes'" + element :hashed_storage, + 'Create new projects using hashed storage paths' + end + + def enable_hashed_storage + within_repository_storage do + check 'Create new projects using hashed storage paths' + end + end + + def save_settings + within_repository_storage do + click_button 'Save changes' + end + end + + def within_repository_storage + page.within('.as-repository-storage') do + yield + end + end + end + end + end + end +end diff --git a/qa/qa/page/project/settings/common.rb b/qa/qa/page/project/settings/common.rb index 319cb1045b6..874fb381554 100644 --- a/qa/qa/page/project/settings/common.rb +++ b/qa/qa/page/project/settings/common.rb @@ -3,6 +3,8 @@ module QA module Project module Settings module Common + include QA::Page::Settings::Common + def self.included(base) base.class_eval do view 'app/views/projects/edit.html.haml' do @@ -10,24 +12,6 @@ module QA end end end - - # Click the Expand button present in the specified section - # - # @param [String] name present in the container in the DOM - def expand_section(name) - page.within('#content-body') do - page.within('section', text: name) do - # Because it is possible to click the button before the JS toggle code is bound - wait(reload: false) do - click_button 'Expand' unless first('button', text: 'Collapse') - - page.has_content?('Collapse') - end - - yield if block_given? - end - end - end end end end diff --git a/qa/qa/page/settings/common.rb b/qa/qa/page/settings/common.rb new file mode 100644 index 00000000000..a683a6829d5 --- /dev/null +++ b/qa/qa/page/settings/common.rb @@ -0,0 +1,25 @@ +module QA + module Page + module Settings + module Common + # Click the Expand button present in the specified section + # + # @param [String] name present in the container in the DOM + def expand_section(name) + page.within('#content-body') do + page.within('section', text: name) do + # Because it is possible to click the button before the JS toggle code is bound + wait(reload: false) do + click_button 'Expand' unless first('button', text: 'Collapse') + + page.has_content?('Collapse') + end + + yield if block_given? + end + end + end + end + end + end +end diff --git a/qa/spec/page/validator_spec.rb b/qa/spec/page/validator_spec.rb index 02822d7d18f..55957649904 100644 --- a/qa/spec/page/validator_spec.rb +++ b/qa/spec/page/validator_spec.rb @@ -30,7 +30,7 @@ describe QA::Page::Validator do let(:view) { spy('view') } before do - allow(QA::Page::Admin::Settings) + allow(QA::Page::Admin::Settings::Main) .to receive(:views).and_return([view]) end -- cgit v1.2.1 From 0f538c16acec8b849338b2d6f9f8c58b6bc143b2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 3 Apr 2018 18:08:56 +0300 Subject: Explicitly use page context for qa/factory/settings/hashed_storage.rb Signed-off-by: Dmitriy Zaporozhets --- qa/qa/factory/settings/hashed_storage.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qa') diff --git a/qa/qa/factory/settings/hashed_storage.rb b/qa/qa/factory/settings/hashed_storage.rb index cd9738715a6..c69ebed3c6b 100644 --- a/qa/qa/factory/settings/hashed_storage.rb +++ b/qa/qa/factory/settings/hashed_storage.rb @@ -11,8 +11,8 @@ module QA Page::Admin::Settings::Main.perform do |setting| setting.expand_repository_storage do |page| - enable_hashed_storage - save_settings + page.enable_hashed_storage + page.save_settings end end -- cgit v1.2.1 From 618959eeb001b04c99e7165e304c61e38d6b79b6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 3 Apr 2018 18:09:53 +0300 Subject: Remove unnecessary section looking in admin settings qa Signed-off-by: Dmitriy Zaporozhets --- qa/qa/page/admin/settings/repository_storage.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'qa') diff --git a/qa/qa/page/admin/settings/repository_storage.rb b/qa/qa/page/admin/settings/repository_storage.rb index 34b4374fbe6..b4a1344216e 100644 --- a/qa/qa/page/admin/settings/repository_storage.rb +++ b/qa/qa/page/admin/settings/repository_storage.rb @@ -10,21 +10,11 @@ module QA end def enable_hashed_storage - within_repository_storage do - check 'Create new projects using hashed storage paths' - end + check 'Create new projects using hashed storage paths' end def save_settings - within_repository_storage do - click_button 'Save changes' - end - end - - def within_repository_storage - page.within('.as-repository-storage') do - yield - end + click_button 'Save changes' end end end -- cgit v1.2.1