Merge "selenium: Add EditPage.saveComplete()"

This commit is contained in:
jenkins-bot 2022-06-10 11:17:13 +00:00 committed by Gerrit Code Review
commit 26ffb7fb11
3 changed files with 11 additions and 2 deletions

View file

@ -4,6 +4,7 @@
"wikimedia/selenium"
],
"globals": {
"mw": "readonly"
"mw": "readonly",
"ve": "readonly"
}
}

View file

@ -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();

View file

@ -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.' );
} );