From 09668285d6c1547882adbfe2bf7d8ec3c23fcd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDeljko=20Filipin?= Date: Mon, 7 Feb 2022 16:53:17 +0100 Subject: [PATCH] selenium: Wait for VisualEditor to load Bug: T296187 Change-Id: Iac98690dd49b6e82062973da05ce30c6f08ba8bc --- tests/selenium/pageobjects/edit.page.js | 8 ++++++++ tests/selenium/specs/content_editable.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/selenium/pageobjects/edit.page.js b/tests/selenium/pageobjects/edit.page.js index 251cea91a7..07c678a35d 100644 --- a/tests/selenium/pageobjects/edit.page.js +++ b/tests/selenium/pageobjects/edit.page.js @@ -9,5 +9,13 @@ class EditPage extends Page { super.openTitle( title, { veaction: 'edit', vehidebetadialog: 1, hidewelcomedialog: 1 } ); } + activationComplete() { + return browser.executeAsync( function ( done ) { + mw.hook( 've.activationComplete' ).add( function () { + done(); + } ); + } ); + } + } module.exports = new EditPage(); diff --git a/tests/selenium/specs/content_editable.js b/tests/selenium/specs/content_editable.js index b3c954035f..fb9614b31b 100644 --- a/tests/selenium/specs/content_editable.js +++ b/tests/selenium/specs/content_editable.js @@ -12,7 +12,7 @@ describe( 'Content Editable', function () { await EditPage.openForEditing( name ); - await EditPage.notices.waitForDisplayed(); + await EditPage.activationComplete(); assert( await EditPage.notices.isDisplayed() ); } );