diff options
author | Benjamin Neff <benjamin@coding4coffee.ch> | 2022-08-01 00:10:38 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2022-08-01 00:12:00 +0300 |
commit | 9485a0263985a5c2a41446e020e02c2accabc2bb (patch) | |
tree | 01bf7a345b4cc80009586c8832ff2a5fdb905a8a /features/step_definitions/web_steps.rb | |
parent | 02eba842aed40e6411fbed8db9e32fcd0e59c642 (diff) | |
parent | eaedd3d26ca7e993e42fba02bc4e4fc5e72ae73e (diff) |
Merge branch 'next-minor'v0.7.18.0
Diffstat (limited to 'features/step_definitions/web_steps.rb')
-rw-r--r-- | features/step_definitions/web_steps.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 4067ad5f4..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| @@ -195,3 +195,8 @@ Then /^I wait until ajax requests finished$/ do loop until page.evaluate_script("jQuery.active") == 0 end end + +When /^I scroll to "([^"]*)"$/ do |element_id| + element = find_by_id(element_id) # rubocop:disable Rails/DynamicFindBy + page.scroll_to(element, align: :bottom) +end |