Replace "evaluate_script" for toggling a Bootstrap switch in spec

This commit is contained in:
Sage Ross 2021-12-30 14:55:24 -08:00 committed by Benjamin Neff
parent 637dad208a
commit d14036b630
No known key found for this signature in database
GPG key ID: 971464C3F1A90194

View file

@ -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|