wiki.techinc.nl/tests/selenium/pageobjects/edit.page.js
Kosta Harlan 0257160852 [selenium] Make tests skin agnostic
The current tests in core rely on selectors provided by Vector, but with some
small modifications the tests can work equally well with and without Vector.

Bug: T248484
Change-Id: I5bc0c80b796252b1a920f6549ef4a462a9b13b87
2020-03-25 16:21:18 +01:00

28 lines
801 B
JavaScript

const Page = require( 'wdio-mediawiki/Page' );
class EditPage extends Page {
get content() { return $( '#wpTextbox1' ); }
get conflictingContent() { return $( '#wpTextbox2' ); }
get displayedContent() { return $( '#mw-content-text .mw-parser-output' ); }
get heading() { return $( '.firstHeading' ); }
get save() { return $( '#wpSave' ); }
get previewButton() { return $( '#wpPreview' ); }
openForEditing( title ) {
super.openTitle( title, { action: 'edit', vehidebetadialog: 1, hidewelcomedialog: 1 } );
}
preview( name, content ) {
this.openForEditing( name );
this.content.setValue( content );
this.previewButton.click();
}
edit( name, content ) {
this.openForEditing( name );
this.content.setValue( content );
this.save.click();
}
}
module.exports = new EditPage();