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
722 B
JavaScript
26 lines
722 B
JavaScript
const Page = require( 'wdio-mediawiki/Page' ),
|
|
Api = require( 'wdio-mediawiki/Api' );
|
|
|
|
class EditPage extends Page {
|
|
get content() { return browser.element( '#wpTextbox1' ); }
|
|
get displayedContent() { return browser.element( '#mw-content-text' ); }
|
|
get heading() { return browser.element( '#firstHeading' ); }
|
|
get save() { return browser.element( '#wpSave' ); }
|
|
|
|
openForEditing( title ) {
|
|
super.openTitle( title, { action: 'edit' } );
|
|
}
|
|
|
|
edit( name, content ) {
|
|
this.openForEditing( name );
|
|
this.content.setValue( content );
|
|
this.save.click();
|
|
}
|
|
|
|
// @deprecated Use wdio-mediawiki/Api#edit() instead.
|
|
apiEdit( name, content ) {
|
|
return Api.edit( name, content );
|
|
}
|
|
}
|
|
|
|
module.exports = new EditPage();
|