Skip to content

Commit 59547ba

Browse files
authored
Merge pull request #13964 from mkllnk/flaky-spec
Stabilise actions_spec
2 parents 9fb8bb1 + fd178ee commit 59547ba

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

spec/support/products_helper.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ def validate_tomselect_without_search!(page, field_name, search_selector)
7979
end
8080
end
8181

82-
def validate_tomselect_with_search!(page, field_name, search_selector)
83-
open_tomselect_to_validate!(page, field_name) do
84-
expect(page).to have_selector(search_selector)
85-
end
86-
end
87-
8882
def random_producer(product)
8983
Enterprise.is_primary_producer
9084
.where.not(id: product.supplier.id)

spec/system/admin/products_v3/actions_spec.rb

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ def save_preferences
167167
before do
168168
create_list(:supplier_enterprise, 11, users: [user])
169169
create_list(:tax_category, 11)
170-
create_list(:taxon, 11)
170+
build_list(:taxon, 11).each_with_index do |taxon, i|
171+
taxon.name += " #{i}"
172+
taxon.save!
173+
end
171174

172175
visit admin_products_url
173176
end
@@ -178,24 +181,8 @@ def save_preferences
178181
tax_category_to_select = random_tax_category
179182

180183
within row_containing_name(variant_a1.display_name) do
181-
validate_tomselect_with_search!(
182-
page, "Producer",
183-
producer_search_selector
184-
)
185184
tomselect_search_and_select(producer_to_select, from: "Producer")
186-
187-
sleep(0.1)
188-
validate_tomselect_with_search!(
189-
page, "Category",
190-
categories_search_selector
191-
)
192185
tomselect_search_and_select(category_to_select, from: "Category")
193-
194-
sleep(0.1)
195-
validate_tomselect_with_search!(
196-
page, "Tax Category",
197-
tax_categories_search_selector
198-
)
199186
tomselect_search_and_select(tax_category_to_select, from: "Tax Category")
200187
end
201188

0 commit comments

Comments
 (0)