diff --git a/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb b/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb index 69265542e..fd831b070 100644 --- a/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb +++ b/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb @@ -11,19 +11,19 @@ end When(/^I click the next arrow$/) do on(LightboxDemoPage) do |page| - page.next_image() + page.mmv_next_button_element.when_present.click end end When(/^I click the previous arrow$/) do on(LightboxDemoPage) do |page| - page.previous_image() + page.mmv_previous_button_element.when_present.click end end When(/^I close MMV$/) do on(LightboxDemoPage) do |page| - page.exit_mmv() + page.mmv_close_button_element.when_present.click end end diff --git a/tests/browser/features/support/pages/lightbox_demo_page.rb b/tests/browser/features/support/pages/lightbox_demo_page.rb index 76201673d..de48a07a5 100644 --- a/tests/browser/features/support/pages/lightbox_demo_page.rb +++ b/tests/browser/features/support/pages/lightbox_demo_page.rb @@ -37,21 +37,4 @@ class LightboxDemoPage div(:mmv_next_button, class: "mw-mlb-next-image") div(:mmv_previous_button, class: "mw-mlb-prev-image") div(:mmv_close_button, class: "mlb-close") - - # Convenient functions on some of these elements - def next_image() - mmv_next_button_element.fire_event("onfocus") - mmv_next_button_element.when_present.click - end - - def previous_image() - mmv_previous_button_element.fire_event("onfocus") - mmv_previous_button_element.when_present.click - end - - def exit_mmv() - mmv_close_button_element.fire_event("onfocus") - mmv_close_button_element.when_present.click - end - end