Tests were disabled for a long time because of 66e9dab5f5
so nobody noticed they were failing.
Bug: T303737
Change-Id: I57d0cd39a582beb7720488f2ae2cb5b69d38714f
23 lines
605 B
JavaScript
23 lines
605 B
JavaScript
'use strict';
|
|
|
|
const Page = require( 'wdio-mediawiki/Page' );
|
|
|
|
class ProtectPage extends Page {
|
|
get reason() { return $( '#mwProtect-reason input' ); }
|
|
get editProtectSelect() { return $( '#mwProtect-level-edit select' ); }
|
|
get submit() { return $( '#mw-Protect-submit' ); }
|
|
|
|
open( title ) {
|
|
super.openTitle( title, { action: 'protect' } );
|
|
}
|
|
|
|
async protect( title, reason, editProtect ) {
|
|
await this.open( title );
|
|
await this.reason.setValue( reason );
|
|
await this.editProtectSelect.selectByVisibleText( editProtect );
|
|
await this.submit.click();
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = new ProtectPage();
|