From ea34a25f34cab58e7fb4a9efddcc34f18d807ba1 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 6 Oct 2023 12:17:00 +0200 Subject: [PATCH 1/5] Don't use the rails-new cache on the CI --- bin/rails-new | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/rails-new b/bin/rails-new index 0581bb55..bbdd4634 100755 --- a/bin/rails-new +++ b/bin/rails-new @@ -11,6 +11,8 @@ rails_version=`bundle exec ruby -rrails/version -e'puts Rails.version'` solidus_version=`bundle exec ruby -rspree/core/version -e'puts Spree::VERSION'` cache_path="tmp/cache/rails-new/${app_name}-${rails_version}-${solidus_version}-${ruby_version}.zip" +test $CI && cache_path="" # Disable caching on CI + # Stay away from the bundler env of the containing extension. function unbundled { echo "~~> Running: $@" From e88ef294d9368c95eaf1a80996dada65de7edb96 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 6 Oct 2023 18:58:21 +0200 Subject: [PATCH 2/5] Remove the app generator cache while clobbering --- Rakefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Rakefile b/Rakefile index 2a475154..3b0b9d78 100644 --- a/Rakefile +++ b/Rakefile @@ -8,3 +8,7 @@ task :default do sh 'bin/rspec' end end + +require 'rake/clean' +CLOBBER.include('tmp/cache/rails-new') +CLOBBER.include('dummy-app') From 4933c31b2fadf70b229a461bdf4bba7c104369bd Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 6 Oct 2023 18:58:40 +0200 Subject: [PATCH 3/5] Don't install solidus twice while creating the dummy app --- bin/dummy-app | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/dummy-app b/bin/dummy-app index 7875086a..76b14a6e 100755 --- a/bin/dummy-app +++ b/bin/dummy-app @@ -22,8 +22,5 @@ echo "gem 'simplecov', '~> 0.22', require: false" >> Gemfile echo "gem 'simplecov-cobertura', require: false" >> Gemfile unbundled bundle install -unbundled bundle add solidus --github solidusio/solidus --branch "${SOLIDUS_BRANCH:-main}" --version '> 0.a' -unbundled bundle exec rake db:drop db:create -unbundled bundle exec rails generate solidus:install --auto-accept --payment-method=none --no-seed --no-sample "$@" unbundled bundle add $extension_name --path .. unbundled bundle exec rails generate $extension_name:install --migrate --load-seeds=false --specs=all From 2a8f4bd1b38ff34c243746b1ec1aee38555c7d17 Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Fri, 6 Oct 2023 12:49:10 +0200 Subject: [PATCH 4/5] Scroll to the payment link before clicking For narrower windows this is necessary. --- spec/support/solidus_stripe/backend_test_helper.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/support/solidus_stripe/backend_test_helper.rb b/spec/support/solidus_stripe/backend_test_helper.rb index e4b85cd2..36b3577b 100644 --- a/spec/support/solidus_stripe/backend_test_helper.rb +++ b/spec/support/solidus_stripe/backend_test_helper.rb @@ -70,7 +70,14 @@ def visit_payments_page def visit_payment_page(payment) visit_payments_page - click_on payment.number + click_on_payment(payment) + end + + def click_on_payment(payment) + payment_number_link = find_link(payment.number) + page.current_window.resize_to(1200, 800) + scroll_to payment_number_link + payment_number_link.click end # Action helper methods for performing operations on payments From a65376b72a838f7bd5913e4705013e33095e25af Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Wed, 4 Oct 2023 18:23:31 +0200 Subject: [PATCH 5/5] Ensure the order tabs are not collapsed into a drop down --- spec/support/solidus_stripe/backend_test_helper.rb | 1 + .../system/backend/solidus_stripe/orders/payments_spec.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/support/solidus_stripe/backend_test_helper.rb b/spec/support/solidus_stripe/backend_test_helper.rb index 36b3577b..f11054bc 100644 --- a/spec/support/solidus_stripe/backend_test_helper.rb +++ b/spec/support/solidus_stripe/backend_test_helper.rb @@ -117,6 +117,7 @@ def create_order_with_existing_payment_source def complete_order_with_existing_payment_source visit_payments_page click_on "Continue" + page.current_window.resize_to(1200, 800) click_on "Confirm" click_on "Complete Order" end diff --git a/spec/system/backend/solidus_stripe/orders/payments_spec.rb b/spec/system/backend/solidus_stripe/orders/payments_spec.rb index 4c7f5058..deb5d0ad 100644 --- a/spec/system/backend/solidus_stripe/orders/payments_spec.rb +++ b/spec/system/backend/solidus_stripe/orders/payments_spec.rb @@ -13,8 +13,12 @@ it 'navigates to the payments page' do payment = create_authorized_payment visit_payments_page - - click_on 'Payments' + within('[data-hook="admin_order_tabs"]') do + payments_link = find_link('Payments') + scroll_to payments_link + page.current_window.resize_to(1200, 800) + payments_link.click + end expect(page).to have_content(payment.number) end