Skip to content

Commit 7901f79

Browse files
authored
Merge pull request #6203 from blish/fix-chrome-errors
Fix flaky test errors using chrome 134
2 parents ceadf35 + 414a46e commit 7901f79

File tree

19 files changed

+115
-168
lines changed

19 files changed

+115
-168
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
browser-tools: circleci/browser-tools@1.4.6
4+
browser-tools: circleci/browser-tools@1.5.3
55
codecov: codecov/[email protected]
66

77
executors:
@@ -59,7 +59,9 @@ commands:
5959
setup:
6060
steps:
6161
- checkout
62-
- browser-tools/install-chrome
62+
- browser-tools/install-chrome:
63+
chrome-version: "133.0.6943.53"
64+
replace-existing: true
6365
- run:
6466
name: Check chrome version
6567
command: |

admin/lib/solidus_admin/testing_support/feature_helpers.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def find_row_checkbox(text)
2727
end
2828

2929
def select_row(text)
30-
find_row_checkbox(text).check
30+
find_row_checkbox(text).tap do |checkbox|
31+
checkbox.check
32+
checkbox.synchronize { checkbox.checked? }
33+
end
3134
end
3235
end
3336
end

admin/lib/solidus_admin/testing_support/shared_examples/promotion_categories_features.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RSpec.shared_examples_for 'promotion categories features' do
66
before { sign_in create(:admin_user, email: "[email protected]") }
77

8-
it "lists promotion categories" do
8+
it "lists promotion categories", :js do
99
create(factory_name, name: "test1", code: "code1")
1010
create(factory_name, name: "test2", code: "code2")
1111

@@ -53,7 +53,7 @@
5353
expect(page).to have_content("exp.2")
5454
end
5555

56-
it 'allows to delete promo category' do
56+
it 'allows to bulk delete promo category', :js do
5757
create(factory_name, name: "Soon to expire", code: "ste.1")
5858
create(factory_name, name: "Expired", code: "exp.2")
5959

@@ -65,8 +65,4 @@
6565
expect(page).not_to have_content("Expired")
6666
expect(model_class.count).to eq(1)
6767
end
68-
69-
include_examples 'feature: bulk delete resources' do
70-
let(:resource_factory) { factory_name }
71-
end
7268
end

admin/spec/features/adjustment_reasons_spec.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
require 'spec_helper'
44
require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources'
55

6-
describe "Adjustment Reasons", :js, type: :feature do
6+
describe "Adjustment Reasons", type: :feature do
77
before { sign_in create(:admin_user, email: '[email protected]') }
88

9-
it "lists adjustment reasons and allows deleting them" do
9+
it "lists adjustment reasons and allows deleting them", :js do
1010
create(:adjustment_reason, name: "Default-adjustment-reason")
1111

1212
visit "/admin/adjustment_reasons"
@@ -21,11 +21,6 @@
2121
expect(page).to be_axe_clean
2222
end
2323

24-
include_examples 'feature: bulk delete resources' do
25-
let(:resource_factory) { :adjustment_reason }
26-
let(:index_path) { "/admin/adjustment_reasons" }
27-
end
28-
2924
context "when creating a new adjustment reason" do
3025
let(:query) { "?page=1&q%5Bname_or_code_cont%5D=new" }
3126

@@ -34,10 +29,13 @@
3429
click_on "Add new"
3530
expect(page).to have_selector("dialog")
3631
expect(page).to have_content("New Adjustment Reason")
32+
end
33+
34+
it "is accessible", :js do
3735
expect(page).to be_axe_clean
3836
end
3937

40-
it "closing the modal keeps query params" do
38+
it "closing the modal keeps query params", :js do
4139
within("dialog") { click_on "Cancel" }
4240
expect(page).not_to have_selector("dialog")
4341
expect(page.current_url).to include(query)
@@ -77,10 +75,13 @@
7775
click_on "Good Reason"
7876
expect(page).to have_selector("dialog")
7977
expect(page).to have_content("Edit Adjustment Reason")
78+
end
79+
80+
it "is accessible", :js do
8081
expect(page).to be_axe_clean
8182
end
8283

83-
it "closing the modal keeps query params" do
84+
it "closing the modal keeps query params", :js do
8485
within("dialog") { click_on "Cancel" }
8586
expect(page).not_to have_selector("dialog")
8687
expect(page.current_url).to include(query)

admin/spec/features/properties_spec.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
require 'spec_helper'
44
require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources'
55

6-
describe "Properties", :js, type: :feature do
6+
describe "Properties", type: :feature do
77
before { sign_in create(:admin_user, email: '[email protected]') }
88

9-
it "lists properties and allows deleting them" do
9+
it "lists properties and allows deleting them", :js do
1010
create(:property, name: "Type prop", presentation: "Type prop")
1111
create(:property, name: "Size", presentation: "Size")
1212

@@ -23,11 +23,6 @@
2323
expect(Spree::Property.count).to eq(1)
2424
end
2525

26-
include_examples 'feature: bulk delete resources' do
27-
let(:resource_factory) { :property }
28-
let(:index_path) { "/admin/properties" }
29-
end
30-
3126
context "creating a new property" do
3227
it "creates a new product property" do
3328
visit "/admin/properties"

admin/spec/features/refund_reasons_spec.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
require 'spec_helper'
44
require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources'
55

6-
describe "Refund Reasons", :js, type: :feature do
6+
describe "Refund Reasons", type: :feature do
77
before { sign_in create(:admin_user, email: '[email protected]') }
88

9-
it "lists refund reasons and allows deleting them" do
9+
it "lists refund reasons and allows deleting them", :js do
1010
create(:refund_reason, name: "Default-refund-reason")
1111

1212
visit "/admin/refund_reasons"
@@ -21,11 +21,6 @@
2121
expect(page).to be_axe_clean
2222
end
2323

24-
include_examples 'feature: bulk delete resources' do
25-
let(:resource_factory) { :refund_reason }
26-
let(:index_path) { "/admin/refund_reasons" }
27-
end
28-
2924
context "when creating a new refund reason" do
3025
let(:query) { "?page=1&q%5Bname_or_description_cont%5D=Ret" }
3126

@@ -34,10 +29,13 @@
3429
click_on "Add new"
3530
expect(page).to have_css("dialog")
3631
expect(page).to have_content("New Refund Reason")
32+
end
33+
34+
it "is accessible", :js do
3735
expect(page).to be_axe_clean
3836
end
3937

40-
it "closing the modal keeps query params" do
38+
it "closing the modal keeps query params", :js do
4139
within("dialog") { click_on "Cancel" }
4240
expect(page).not_to have_selector("dialog")
4341
expect(page.current_url).to include(query)
@@ -74,10 +72,13 @@
7472
click_on "Return process"
7573
expect(page).to have_css("dialog")
7674
expect(page).to have_content("Edit Refund Reason")
75+
end
76+
77+
it "is accessible", :js do
7778
expect(page).to be_axe_clean
7879
end
7980

80-
it "closing the modal keeps query params" do
81+
it "closing the modal keeps query params", :js do
8182
within("dialog") { click_on "Cancel" }
8283
expect(page).not_to have_selector("dialog")
8384
expect(page.current_url).to include(query)

admin/spec/features/return_reasons_spec.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
require 'spec_helper'
44
require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources'
55

6-
describe "Return Reasons", :js, type: :feature do
6+
describe "Return Reasons", type: :feature do
77
before { sign_in create(:admin_user, email: '[email protected]') }
88

9-
it "lists Return Reasons and allows deleting them" do
9+
it "lists Return Reasons and allows deleting them", :js do
1010
create(:return_reason, name: "Default-return-reason")
1111

1212
visit "/admin/return_reasons"
@@ -21,11 +21,6 @@
2121
expect(page).to be_axe_clean
2222
end
2323

24-
include_examples 'feature: bulk delete resources' do
25-
let(:resource_factory) { :return_reason }
26-
let(:index_path) { "/admin/return_reasons" }
27-
end
28-
2924
context "when creating a new return reason" do
3025
let(:query) { "?page=1&q%5Bname_cont%5D=new" }
3126

@@ -34,10 +29,13 @@
3429
click_on "Add new"
3530
expect(page).to have_selector("dialog")
3631
expect(page).to have_content("New Return Reason")
32+
end
33+
34+
it "is accessible", :js do
3735
expect(page).to be_axe_clean
3836
end
3937

40-
it "closing the modal keeps query params" do
38+
it "closing the modal keeps query params", :js do
4139
within("dialog") { click_on "Cancel" }
4240
expect(page).not_to have_selector("dialog")
4341
expect(page.current_url).to include(query)
@@ -76,10 +74,13 @@
7674
click_on "Good Reason"
7775
expect(page).to have_selector("dialog")
7876
expect(page).to have_content("Edit Return Reason")
77+
end
78+
79+
it "is accessible", :js do
7980
expect(page).to be_axe_clean
8081
end
8182

82-
it "closing the modal keeps query params", :flaky do
83+
it "closing the modal keeps query params", :flaky, :js do
8384
within("dialog") { click_on "Cancel" }
8485
expect(page).not_to have_selector("dialog")
8586
expect(page.current_url).to include(query)

admin/spec/features/roles_spec.rb

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper'
44
require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources'
55

6-
describe "Roles", :js, type: :feature do
6+
describe "Roles", type: :feature do
77
before do
88
sign_in create(:admin_user, email: '[email protected]')
99
end
@@ -25,12 +25,7 @@
2525
)
2626
}
2727

28-
include_examples 'feature: bulk delete resources' do
29-
let(:resource_factory) { :role }
30-
let(:index_path) { "/admin/roles" }
31-
end
32-
33-
it "lists roles and allows deleting them" do
28+
it "lists roles and allows deleting them", :js do
3429
create(:role, name: "Customer Role" )
3530
Spree::Role.find_or_create_by(name: 'admin')
3631

@@ -62,10 +57,13 @@
6257
click_on "Add new"
6358
expect(page).to have_selector("dialog", wait: 5)
6459
expect(page).to have_content("New Role")
60+
end
61+
62+
it "is accessible", :js do
6563
expect(page).to be_axe_clean
6664
end
6765

68-
it "closing the modal keeps query params" do
66+
it "closing the modal keeps query params", :js do
6967
within("dialog") { click_on "Cancel" }
7068
expect(page).not_to have_selector("dialog", wait: 5)
7169
expect(page.current_url).to include(query)
@@ -129,12 +127,15 @@
129127
click_on "Reviewer"
130128
expect(page).to have_selector("dialog", wait: 5)
131129
expect(page).to have_content("Edit Role")
132-
expect(page).to be_axe_clean
133130
expect(Spree::Role.find_by(name: "Reviewer").permission_set_ids)
134-
.to contain_exactly(settings_edit_permission.id)
131+
.to contain_exactly(settings_edit_permission.id)
132+
end
133+
134+
it "is accessible", :js do
135+
expect(page).to be_axe_clean
135136
end
136137

137-
it "closing the modal keeps query params" do
138+
it "closing the modal keeps query params", :js do
138139
within("dialog") { click_on "Cancel" }
139140
expect(page).not_to have_selector("dialog", wait: 5)
140141
expect(page.current_url).to include(query)

admin/spec/features/shipping_categories_spec.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
require 'spec_helper'
44
require 'solidus_admin/testing_support/shared_examples/bulk_delete_resources'
55

6-
describe "Shipping Categories", :js, type: :feature do
6+
describe "Shipping Categories", type: :feature do
77
before { sign_in create(:admin_user, email: '[email protected]') }
88

9-
it "lists shipping categories and allows deleting them" do
9+
it "lists shipping categories and allows deleting them", :js do
1010
create(:shipping_category, name: "Default-shipping")
1111

1212
visit "/admin/shipping_categories"
@@ -21,11 +21,6 @@
2121
expect(page).to be_axe_clean
2222
end
2323

24-
include_examples 'feature: bulk delete resources' do
25-
let(:resource_factory) { :shipping_category }
26-
let(:index_path) { "/admin/shipping_categories" }
27-
end
28-
2924
context "when creating a new shipping category" do
3025
let(:query) { "?page=1&q%5Bname_or_description_cont%5D=What" }
3126

@@ -34,10 +29,13 @@
3429
click_on "Add new"
3530
expect(page).to have_css("dialog")
3631
expect(page).to have_content("New Shipping Category")
32+
end
33+
34+
it "is accessible", :js do
3735
expect(page).to be_axe_clean
3836
end
3937

40-
it "closing the modal keeps query params" do
38+
it "closing the modal keeps query params", :js do
4139
within("dialog") { click_on "Cancel" }
4240
expect(page).not_to have_selector("dialog")
4341
expect(page.current_url).to include(query)
@@ -74,10 +72,13 @@
7472
click_on "Letter Mail"
7573
expect(page).to have_css("dialog")
7674
expect(page).to have_content("Edit Shipping Category")
75+
end
76+
77+
it "is accessible", :js do
7778
expect(page).to be_axe_clean
7879
end
7980

80-
it "closing the modal keeps query params" do
81+
it "closing the modal keeps query params", :js do
8182
within("dialog") { click_on "Cancel" }
8283
expect(page).not_to have_selector("dialog")
8384
expect(page.current_url).to include(query)

admin/spec/features/shipping_methods_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
require 'spec_helper'
44

5-
describe "Shipping Methods", :js, type: :feature do
5+
describe "Shipping Methods", type: :feature do
66
before { sign_in create(:admin_user, email: '[email protected]') }
77

8-
it "lists shipping methods and allows deleting them" do
8+
it "lists shipping methods and allows deleting them", :js do
99
create(:shipping_method, name: "FAAAST")
1010

1111
visit "/admin/shipping_methods"

0 commit comments

Comments
 (0)