| 1 | 'use strict'; |
| 2 | |
| 3 | const Page = require( 'wdio-mediawiki/Page' ); |
| 4 | |
| 5 | class UndoPage extends Page { |
| 6 | |
| 7 | get save() { |
| 8 | return $( '#wpSave' ); |
| 9 | } |
| 10 | |
| 11 | async undo( title, previousRev, undoRev ) { |
| 12 | await super.openTitle( title, { |
| 13 | action: 'edit', |
| 14 | undoafter: previousRev, |
| 15 | undo: undoRev, |
| 16 | // T276783: suppress welcome dialog that would prevent save if VisualEditor is installed |
| 17 | vehidebetadialog: 1 |
| 18 | } ); |
| 19 | await this.save.click(); |
| 20 | } |
| 21 | |
| 22 | } |
| 23 | |
| 24 | module.exports = new UndoPage(); |