| 1 | 'use strict'; |
| 2 | |
| 3 | const Page = require( 'wdio-mediawiki/Page' ); |
| 4 | |
| 5 | class RestorePage extends Page { |
| 6 | get reason() { |
| 7 | return $( '#wpComment' ); |
| 8 | } |
| 9 | |
| 10 | get submit() { |
| 11 | return $( '#mw-undelete-submit' ); |
| 12 | } |
| 13 | |
| 14 | get displayedContent() { |
| 15 | return $( '#mw-content-text' ); |
| 16 | } |
| 17 | |
| 18 | async open( subject ) { |
| 19 | return super.openTitle( 'Special:Undelete/' + subject ); |
| 20 | } |
| 21 | |
| 22 | async restore( subject, reason ) { |
| 23 | await this.open( subject ); |
| 24 | await this.reason.setValue( reason ); |
| 25 | await this.submit.click(); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | module.exports = new RestorePage(); |