This commit adds missing async defintions in a couple of methods for our wdio page tests. It's better to define the functions so that its clear that its async. Bug: T358092 Change-Id: I9006deb9a9a0bb524ab61a16c6f41621482f21bf
31 lines
629 B
JavaScript
31 lines
629 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' );
|
|
}
|
|
|
|
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();
|