From c93c033128849607c12614dc457047b7715c2c53 Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Wed, 17 Jun 2015 11:52:24 +0200 Subject: [PATCH 1/6] order the options in the modal selects this will order the select options alphabetically Signed-off-by: Florian Kraft --- frontend/app/templates/work_packages/modals/columns.html | 2 +- frontend/app/templates/work_packages/modals/group_by.html | 2 +- frontend/app/templates/work_packages/modals/sorting.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/templates/work_packages/modals/columns.html b/frontend/app/templates/work_packages/modals/columns.html index 4a747a22eb..82ffd79ebf 100644 --- a/frontend/app/templates/work_packages/modals/columns.html +++ b/frontend/app/templates/work_packages/modals/columns.html @@ -10,7 +10,7 @@ {{$item.title}} -
diff --git a/frontend/app/templates/work_packages/modals/group_by.html b/frontend/app/templates/work_packages/modals/group_by.html index 7bc09b2fc0..716ab3b686 100644 --- a/frontend/app/templates/work_packages/modals/group_by.html +++ b/frontend/app/templates/work_packages/modals/group_by.html @@ -7,7 +7,7 @@
{{$select.selected.title}} - +
diff --git a/frontend/app/templates/work_packages/modals/sorting.html b/frontend/app/templates/work_packages/modals/sorting.html index c31a920cbd..4861596772 100644 --- a/frontend/app/templates/work_packages/modals/sorting.html +++ b/frontend/app/templates/work_packages/modals/sorting.html @@ -11,7 +11,7 @@
{{$select.selected.label}} - +
From db5c4c239311bd1f07a2d169ec16a6a309ee2c97 Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Tue, 23 Jun 2015 11:49:14 +0200 Subject: [PATCH 2/6] maximize the window for breaking test Signed-off-by: Florian Kraft --- spec/features/work_packages/table_sorting_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/features/work_packages/table_sorting_spec.rb b/spec/features/work_packages/table_sorting_spec.rb index 6f0ec1b773..ff641e8c01 100644 --- a/spec/features/work_packages/table_sorting_spec.rb +++ b/spec/features/work_packages/table_sorting_spec.rb @@ -28,6 +28,7 @@ require 'spec_helper' require 'features/work_packages/work_packages_page' +require 'features/work_packages/details/inplace_editor/shared_contexts' describe 'Select work package row', type: :feature do let(:user) { FactoryGirl.create(:admin) } @@ -59,6 +60,7 @@ describe 'Select work package row', type: :feature do end include_context 'ui-select helpers' + include_context 'maximized window' include_context 'work package table helpers' context 'sorting by version', js: true do From f0fcb7d6ea2f17d968992a6a1a14f0c999745812 Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Tue, 23 Jun 2015 14:58:44 +0200 Subject: [PATCH 3/6] force resizing of window before all js based tests Signed-off-by: Florian Kraft --- spec/features/work_packages/table_sorting_spec.rb | 2 -- spec/spec_helper.rb | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/features/work_packages/table_sorting_spec.rb b/spec/features/work_packages/table_sorting_spec.rb index ff641e8c01..6f0ec1b773 100644 --- a/spec/features/work_packages/table_sorting_spec.rb +++ b/spec/features/work_packages/table_sorting_spec.rb @@ -28,7 +28,6 @@ require 'spec_helper' require 'features/work_packages/work_packages_page' -require 'features/work_packages/details/inplace_editor/shared_contexts' describe 'Select work package row', type: :feature do let(:user) { FactoryGirl.create(:admin) } @@ -60,7 +59,6 @@ describe 'Select work package row', type: :feature do end include_context 'ui-select helpers' - include_context 'maximized window' include_context 'work package table helpers' context 'sorting by version', js: true do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0708d311e3..82344585b2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -91,6 +91,11 @@ RSpec.configure do |config| DatabaseCleaner.start end + config.before(:each, js: true) do + # maximizes the browser window for all capybara specs + Capybara.page.driver.browser.manage.window.maximize + end + config.after(:each) do DatabaseCleaner.clean end From cd39d0e88a13aa36336def33874e0d6fef8b2513 Mon Sep 17 00:00:00 2001 From: Florian Kraft Date: Wed, 24 Jun 2015 11:19:54 +0200 Subject: [PATCH 4/6] move the maximize window back to ui-select context Signed-off-by: Florian Kraft --- spec/features/support/ui_select.rb | 3 +++ spec/spec_helper.rb | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/features/support/ui_select.rb b/spec/features/support/ui_select.rb index cbb14a3a97..99c39a0145 100644 --- a/spec/features/support/ui_select.rb +++ b/spec/features/support/ui_select.rb @@ -26,7 +26,10 @@ # See doc/COPYRIGHT.rdoc for more details. #++ +require 'features/work_packages/details/inplace_editor/shared_contexts' + shared_context 'ui-select helpers' do + include_context 'maximized window' def ui_select_choose(select2_element, option_name) select2_element.find('.select2-choice').click select2_element.find('ul.select2-result-single li', text: option_name).click diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 82344585b2..0708d311e3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -91,11 +91,6 @@ RSpec.configure do |config| DatabaseCleaner.start end - config.before(:each, js: true) do - # maximizes the browser window for all capybara specs - Capybara.page.driver.browser.manage.window.maximize - end - config.after(:each) do DatabaseCleaner.clean end From fbb1fe1a49743e86e221626d24ced47d4da27fcc Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Wed, 24 Jun 2015 22:18:15 +0200 Subject: [PATCH 5/6] in specs insert text into ui-select This will ensure that the element is present and selectable if it is at all --- spec/features/support/ui_select.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/features/support/ui_select.rb b/spec/features/support/ui_select.rb index 99c39a0145..5bfa5e8342 100644 --- a/spec/features/support/ui_select.rb +++ b/spec/features/support/ui_select.rb @@ -31,7 +31,11 @@ require 'features/work_packages/details/inplace_editor/shared_contexts' shared_context 'ui-select helpers' do include_context 'maximized window' def ui_select_choose(select2_element, option_name) + # Open the element select2_element.find('.select2-choice').click + # Insert the text to find + select2_element.find('.select2-search input').set(option_name) + # click the element to select it select2_element.find('ul.select2-result-single li', text: option_name).click end end From 6a6207e1c15d1aa48aa99173110f7ab927387d71 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Thu, 25 Jun 2015 07:05:22 +0200 Subject: [PATCH 6/6] remove maximize --- spec/features/support/ui_select.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/features/support/ui_select.rb b/spec/features/support/ui_select.rb index 5bfa5e8342..248ec8b770 100644 --- a/spec/features/support/ui_select.rb +++ b/spec/features/support/ui_select.rb @@ -26,10 +26,7 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -require 'features/work_packages/details/inplace_editor/shared_contexts' - shared_context 'ui-select helpers' do - include_context 'maximized window' def ui_select_choose(select2_element, option_name) # Open the element select2_element.find('.select2-choice').click