This is new package will be reusable by other repositories for their browser tests, without having to reference the internal selenium/pageobjects/ directory from MediaWiki core. In addition to not requiring direct imports, it will also avoid problems in the future by allowing the package to be versioned and iterated upon without forcing an atomic global upgrade (or broken master builds), everytime we change something. See wdio-mediawiki/README for details. Within MediaWiki core itself, the package is used using the 'file' specifier in its package.json, so that we always test and develop using its working copy, which makes drafting and testing changes easier. Also misc changes to make wdio.conf easier to understand. Bug: T193088 Change-Id: I547a7899e7a97693a93567dd763784e637433d55
26 lines
711 B
JavaScript
26 lines
711 B
JavaScript
const Page = require( 'wdio-mediawiki/Page' ),
|
|
Api = require( 'wdio-mediawiki/Api' );
|
|
|
|
class DeletePage extends Page {
|
|
get reason() { return browser.element( '#wpReason' ); }
|
|
get watch() { return browser.element( '#wpWatch' ); }
|
|
get submit() { return browser.element( '#wpConfirmB' ); }
|
|
get displayedContent() { return browser.element( '#mw-content-text' ); }
|
|
|
|
open( title ) {
|
|
super.openTitle( title, { action: 'delete' } );
|
|
}
|
|
|
|
delete( title, reason ) {
|
|
this.open( title );
|
|
this.reason.setValue( reason );
|
|
this.submit.click();
|
|
}
|
|
|
|
// @deprecated Use wdio-mediawiki/Api#delete() instead.
|
|
apiDelete( name, reason ) {
|
|
return Api.delete( name, reason );
|
|
}
|
|
}
|
|
|
|
module.exports = new DeletePage();
|