| 1 | 'use strict'; |
| 2 | |
| 3 | const Page = require( 'wdio-mediawiki/Page' ); |
| 4 | |
| 5 | class DeletePage extends Page { |
| 6 | get reason() { |
| 7 | return $( '#wpReason input' ); |
| 8 | } |
| 9 | |
| 10 | get watch() { |
| 11 | return $( '#wpWatch' ); |
| 12 | } |
| 13 | |
| 14 | get submit() { |
| 15 | return $( '#wpConfirmB' ); |
| 16 | } |
| 17 | |
| 18 | get displayedContent() { |
| 19 | return $( '#mw-content-text' ); |
| 20 | } |
| 21 | |
| 22 | async open( title ) { |
| 23 | return super.openTitle( title, { action: 'delete' } ); |
| 24 | } |
| 25 | |
| 26 | async delete( title, reason ) { |
| 27 | await this.open( title ); |
| 28 | await this.reason.setValue( reason ); |
| 29 | await this.submit.click(); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | module.exports = new DeletePage(); |