diff --git a/tests/selenium/.eslintrc.json b/tests/selenium/.eslintrc.json index 2b15ecf751..f6b644e69e 100644 --- a/tests/selenium/.eslintrc.json +++ b/tests/selenium/.eslintrc.json @@ -4,6 +4,7 @@ "wikimedia/selenium" ], "globals": { - "mw": "readonly" + "mw": "readonly", + "ve": "readonly" } } diff --git a/tests/selenium/pageobjects/edit.page.js b/tests/selenium/pageobjects/edit.page.js index 0b3685a9a6..c9c9e66bfe 100644 --- a/tests/selenium/pageobjects/edit.page.js +++ b/tests/selenium/pageobjects/edit.page.js @@ -25,5 +25,13 @@ class EditPage extends Page { } ); } + saveComplete() { + return browser.executeAsync( function ( done ) { + ve.init.target.on( 'save', function () { + done(); + } ); + } ); + } + } module.exports = new EditPage(); diff --git a/tests/selenium/specs/content_editable.js b/tests/selenium/specs/content_editable.js index bd451a94cd..cde6b6daac 100644 --- a/tests/selenium/specs/content_editable.js +++ b/tests/selenium/specs/content_editable.js @@ -54,7 +54,7 @@ describe( 'Content Editable', function () { await EditPage.savePage.waitForClickable(); await EditPage.savePage.click(); - await EditPage.notification.waitForDisplayed(); + await EditPage.saveComplete(); assert.strictEqual( await EditPage.notification.getText(), 'The page has been created.' ); } );