diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 4e8aad2be0..e452939972 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -100,8 +100,8 @@ module WebHelper def tomselect_search_and_select(value, options) tomselect_wrapper = page.find("[name='#{options[:from]}']").sibling(".ts-wrapper") tomselect_wrapper.find(".ts-control").click - tomselect_wrapper.find(:css, '.ts-dropdown input.dropdown-input').set(value) - tomselect_wrapper.find(".ts-control").click + # Use send_keys as setting the value directly doesn't trigger the search + tomselect_wrapper.find(:css, '.ts-dropdown input.dropdown-input').send_keys(value) tomselect_wrapper.find(:css, '.ts-dropdown .ts-dropdown-content .option', text: value).click end diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 379bd88e8f..4c5b677983 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -1074,19 +1074,18 @@ describe ' end describe "searching customers" do - def serching_for_customers + def searching_for_customers # opens the customer dropdown find(".items-placeholder").click - # sets the query name - find(".dropdown-input").set("John") + find(".dropdown-input").send_keys("John") within(".customer-details") do expect(page).to have_content("John Doe") expect(page).to have_content(customer.email.to_s) end # sets the query email - find(".dropdown-input").set("maura@smith.biz") + find(".dropdown-input").send_keys("maura@smith.biz") within(".customer-details") do expect(page).to have_content("John Doe") expect(page).to have_content(customer.email.to_s) @@ -1103,7 +1102,7 @@ describe ' end it "finds a customer by name" do - serching_for_customers + searching_for_customers end end @@ -1117,7 +1116,7 @@ describe ' end it "finds a customer by name" do - serching_for_customers + searching_for_customers end end end