From 4ab4ad64dc2e285056ac64661e6b589fb2be983f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDeljko=20Filipin?= Date: Thu, 2 Oct 2014 14:45:24 +0200 Subject: [PATCH] [BrowserTest] Fix failing VisualEditor_save_dialog scenario Looks like VisualEditor does not allow saving the page, if the changes to the page were made while the browser did not have focus. Change-Id: I959bcb4cc2f72237d2ea75249a56e140d4f7c867 Paired-With: Amir Aharoni --- .../browser/features/step_definitions/shared_steps.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb b/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb index d32e5a7d39..7e619d7261 100644 --- a/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb +++ b/modules/ve-mw/tests/browser/features/step_definitions/shared_steps.rb @@ -17,7 +17,10 @@ Given(/^I go to the "(.+)" page with content "(.+)"$/) do |page_title, page_cont end Given(/^I click in the editable part$/) do - on(VisualEditorPage).content_element.when_present.send_keys("") + on(VisualEditorPage) do |page| + page.content_element.when_present.fire_event("onfocus") + page.content_element.send_keys("") + end end Given(/^I make the text "(.*?)" be selected$/) do |select_text| @@ -99,4 +102,4 @@ end Then(/^I can click Cancel save$/) do on(VisualEditorPage).confirm_switch_cancel_element.when_present.click -end \ No newline at end of file +end