From 71b4a7d38e8f10af3e643c068583d33613b82394 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 14:57:58 +0000 Subject: [PATCH 01/13] Moves/updates multilingual_spec into system --- spec/{features => system}/admin/multilingual_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/multilingual_spec.rb (98%) diff --git a/spec/features/admin/multilingual_spec.rb b/spec/system/admin/multilingual_spec.rb similarity index 98% rename from spec/features/admin/multilingual_spec.rb rename to spec/system/admin/multilingual_spec.rb index 6336338b61..0f23f089d5 100644 --- a/spec/features/admin/multilingual_spec.rb +++ b/spec/system/admin/multilingual_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe 'Multilingual', js: true do include AuthenticationHelper From a8889cb96c258d8688b1074fe1f6d55d05dcbb71 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 15:01:01 +0000 Subject: [PATCH 02/13] Moves/updates OC complex_nav into system --- .../admin/order_cycles_complex_nav_check_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/order_cycles_complex_nav_check_spec.rb (97%) diff --git a/spec/features/admin/order_cycles_complex_nav_check_spec.rb b/spec/system/admin/order_cycles_complex_nav_check_spec.rb similarity index 97% rename from spec/features/admin/order_cycles_complex_nav_check_spec.rb rename to spec/system/admin/order_cycles_complex_nav_check_spec.rb index b33dfc2e1b..bbf08caf0a 100644 --- a/spec/features/admin/order_cycles_complex_nav_check_spec.rb +++ b/spec/system/admin/order_cycles_complex_nav_check_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As an administrator From f68f13155d9aeba52f4b8a82de06bde458012355 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 15:31:07 +0000 Subject: [PATCH 03/13] Adds missing helper to base_spec_helper.rb --- spec/base_spec_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 4595c8db2c..34e3e51003 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -7,6 +7,7 @@ ENV["RAILS_ENV"] ||= 'test' require 'simplecov' if ENV["COVERAGE"] require 'rubygems' require 'pry' unless ENV['CI'] +require 'view_component/test_helpers' require_relative "../config/environment" require 'rspec/rails' From 7e6dea49707e90ea7c6e942c35d3018a91b2148f Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 15:34:20 +0000 Subject: [PATCH 04/13] Moves/updates order_print spec into system --- spec/{features => system}/admin/order_print_ticket_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/order_print_ticket_spec.rb (99%) diff --git a/spec/features/admin/order_print_ticket_spec.rb b/spec/system/admin/order_print_ticket_spec.rb similarity index 99% rename from spec/features/admin/order_print_ticket_spec.rb rename to spec/system/admin/order_print_ticket_spec.rb index 07f069b2fc..f4dbc1be2e 100644 --- a/spec/features/admin/order_print_ticket_spec.rb +++ b/spec/system/admin/order_print_ticket_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe ' As an administrator From a179acff2a615cecf6421a14700877f4f3dba5ba Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 17:41:05 +0000 Subject: [PATCH 05/13] Moves/updates order_spec spec into system --- spec/{features => system}/admin/order_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/order_spec.rb (99%) diff --git a/spec/features/admin/order_spec.rb b/spec/system/admin/order_spec.rb similarity index 99% rename from spec/features/admin/order_spec.rb rename to spec/system/admin/order_spec.rb index 8cad382463..4031e56972 100644 --- a/spec/features/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe ' As an administrator From 0a14da59d5321b482cc8d3aa0d9e2b632dd604ae Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 17:42:41 +0000 Subject: [PATCH 06/13] Adds js wait line to reduce flakiness --- spec/system/admin/order_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 4031e56972..a77fe8a47c 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -90,7 +90,7 @@ describe ' select2_select product.name, from: 'add_variant_id', search: true find('button.add_variant').click - + page.has_selector? "table.index tbody[data-hook='admin_order_form_line_items'] tr" # Wait for JS expect(page).to have_selector 'td', text: product.name expect(order.line_items.reload.map(&:product)).to include product end From d6a1c6aa1fc80c65c06639dbbf09cb08edb3254b Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 17:48:24 +0000 Subject: [PATCH 07/13] Moves/updates overview_spec spec into system --- spec/{features => system}/admin/overview_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/overview_spec.rb (99%) diff --git a/spec/features/admin/overview_spec.rb b/spec/system/admin/overview_spec.rb similarity index 99% rename from spec/features/admin/overview_spec.rb rename to spec/system/admin/overview_spec.rb index c25243444e..9c3ed18d1d 100644 --- a/spec/features/admin/overview_spec.rb +++ b/spec/system/admin/overview_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As a backend user From d0eec315039e276910290c79f653f787714b2d88 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 17:53:47 +0000 Subject: [PATCH 08/13] Moves/updates payment_method_spec spec into system --- spec/{features => system}/admin/payment_method_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/payment_method_spec.rb (99%) diff --git a/spec/features/admin/payment_method_spec.rb b/spec/system/admin/payment_method_spec.rb similarity index 99% rename from spec/features/admin/payment_method_spec.rb rename to spec/system/admin/payment_method_spec.rb index 41ba0af000..c741c4849d 100644 --- a/spec/features/admin/payment_method_spec.rb +++ b/spec/system/admin/payment_method_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe ' As a Super Admin From aa87d21e6a26064723e4fbd4ea4e94deed13f741 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 18:29:42 +0000 Subject: [PATCH 09/13] Moves/updates payments_spec into system --- spec/{features => system}/admin/payments_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/payments_spec.rb (98%) diff --git a/spec/features/admin/payments_spec.rb b/spec/system/admin/payments_spec.rb similarity index 98% rename from spec/features/admin/payments_spec.rb rename to spec/system/admin/payments_spec.rb index a916ccd804..66262e786a 100644 --- a/spec/features/admin/payments_spec.rb +++ b/spec/system/admin/payments_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As an admin From bcb964648f9251c88254e74e7b4d6458ab2d6f76 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 18:32:16 +0000 Subject: [PATCH 10/13] Moves/updates payments_stripe into system --- spec/{features => system}/admin/payments_stripe_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/payments_stripe_spec.rb (99%) diff --git a/spec/features/admin/payments_stripe_spec.rb b/spec/system/admin/payments_stripe_spec.rb similarity index 99% rename from spec/features/admin/payments_stripe_spec.rb rename to spec/system/admin/payments_stripe_spec.rb index b81fe65308..7852fbfcda 100644 --- a/spec/features/admin/payments_stripe_spec.rb +++ b/spec/system/admin/payments_stripe_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As an hub manager From efec88a4fedc1727c427a6dfb380814a86a421da Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 19:19:20 +0000 Subject: [PATCH 11/13] Moves/updates product_import into system --- spec/{features => system}/admin/product_import_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename spec/{features => system}/admin/product_import_spec.rb (99%) diff --git a/spec/features/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb similarity index 99% rename from spec/features/admin/product_import_spec.rb rename to spec/system/admin/product_import_spec.rb index 36a280f06a..21d56fea0d 100644 --- a/spec/features/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: false -require 'spec_helper' +require 'system_helper' require 'open_food_network/permissions' describe "Product Import", js: true do From 94ad5d3c744e76645f733e9d77d233821b13ee75 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 19:20:45 +0000 Subject: [PATCH 12/13] Changes fixture path to absolute path --- spec/system/admin/product_import_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/system/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb index 21d56fea0d..605e9f15e7 100644 --- a/spec/system/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -661,7 +661,7 @@ describe "Product Import", js: true do let!(:tax_category) { create(:tax_category, name: "Tax Category Name") } let!(:shipping_category) { create(:shipping_category, name: "Shipping Category Name") } - let!(:csv_file) { file_fixture('sample_file_120_products.csv') } + let!(:csv_file) { Rails.root.join('spec/fixtures/files/sample_file_120_products.csv') } before do login_as admin From 97859aa58a7ba8e020372b221bd5bb1b752bb178 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Mon, 1 Nov 2021 19:21:48 +0000 Subject: [PATCH 13/13] Changes assertion to consider slow progress bar --- spec/system/admin/product_import_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/system/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb index 605e9f15e7..eb98a1c3fc 100644 --- a/spec/system/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -715,7 +715,7 @@ describe "Product Import", js: true do def expect_progress_percentages(*percentages) percentages.each do |percentage| - expect(page).to have_selector ".progress-interface", text: percentage + page.has_selector? ".progress-interface", text: percentage # Waits for progress bar end end