wiki.techinc.nl/tests/selenium/pageobjects/protect.page.js
Peter Hedenskog 4a42035c11 Add missing async.
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
2024-02-21 12:29:07 +01:00

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();