| Current Path : /var/www/html/mediawiki-1.43.1/tests/selenium/pageobjects/ |
| Current File : /var/www/html/mediawiki-1.43.1/tests/selenium/pageobjects/protect.page.js |
'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' );
}
async open( title ) {
return 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();