2020-05-14 21:14:42 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
2018-08-14 14:27:31 +00:00
|
|
|
const Page = require( 'wdio-mediawiki/Page' );
|
|
|
|
|
|
|
|
|
|
class UndoPage extends Page {
|
|
|
|
|
|
2023-11-22 18:25:32 +00:00
|
|
|
get save() {
|
|
|
|
|
return $( '#wpSave' );
|
|
|
|
|
}
|
2018-08-14 14:27:31 +00:00
|
|
|
|
2022-11-23 17:50:28 +00:00
|
|
|
async undo( title, previousRev, undoRev ) {
|
|
|
|
|
await super.openTitle( title, {
|
2021-03-09 13:50:34 +00:00
|
|
|
action: 'edit',
|
|
|
|
|
undoafter: previousRev,
|
|
|
|
|
undo: undoRev,
|
|
|
|
|
// T276783: suppress welcome dialog that would prevent save if VisualEditor is installed
|
|
|
|
|
vehidebetadialog: 1
|
|
|
|
|
} );
|
2022-11-23 17:50:28 +00:00
|
|
|
await this.save.click();
|
2018-08-14 14:27:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module.exports = new UndoPage();
|