From d14036b63093c60fa32d11b3597cc75404b1c584 Mon Sep 17 00:00:00 2001 From: Sage Ross Date: Thu, 30 Dec 2021 14:55:24 -0800 Subject: [PATCH] Replace "evaluate_script" for toggling a Bootstrap switch in spec --- features/step_definitions/web_steps.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 952bcbee0..2c2ca4400 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -170,8 +170,8 @@ Then /^the "([^"]*)" bootstrap-switch should be (on|off)$/ do |label, state| end end -Then /^I toggle the "([^"]*)" bootstrap-switch$/ do |label| - page.execute_script("return $('#{label}').bootstrapSwitch('toggleState')") +Then /^I toggle the "#([^"]*)" bootstrap-switch$/ do |id| + find(".bootstrap-switch-id-#{id}").click end Then /^(?:|I )should be on (.+)$/ do |page_name|