From 7b897e9c07db110da1bc74f0099ac4bf10dfd6d3 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Mon, 16 Feb 2015 16:37:22 +0100 Subject: [PATCH] Workaround for Safari web driver It doesn't support mouse move, so let's do a plain click in that case Bug: T89087 Change-Id: Idb89b72896d29772aff893c7cde92728450cc678 --- tests/browser/features/step_definitions/mmv_steps.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/browser/features/step_definitions/mmv_steps.rb b/tests/browser/features/step_definitions/mmv_steps.rb index 3011abbcc..cdd42b274 100644 --- a/tests/browser/features/step_definitions/mmv_steps.rb +++ b/tests/browser/features/step_definitions/mmv_steps.rb @@ -43,7 +43,12 @@ When /^I click the image$/ do on(E2ETestPage) do |page| # Clicking the top-left corner of the image is necessary for the test to work on IE # A plain click on the image element ends up hitting the dialog, which means it won't close - @browser.driver.action.move_to(@browser.driver.find_element(:class, 'mw-mmv-image'), 10, 10).click.perform + begin + @browser.driver.action.move_to(@browser.driver.find_element(:class, 'mw-mmv-image'), 10, 10).click.perform + rescue + # Plain click for web drivers that don't support mouse moves (Safari, currently) + on(E2ETestPage).mmv_image_div_element.when_present.click + end end end