mediawiki-skins-MinervaNeue/tests/selenium/pageobjects/edit.page.js
jdlrobson f9a8703a64 Minerva uses core page title handling
Bug: T265892
Change-Id: I2ffdedd64414ffb3c6e441391a75fd6e744847a4
2021-12-20 19:39:42 +00:00

26 lines
699 B
JavaScript

'use strict';
const Page = require( 'wdio-mediawiki/Page' );
class EditPage extends Page {
get content() { return $( '#wikitext-editor' ); }
get displayedContent() { return $( '#mw-content-text .mw-parser-output' ); }
get heading() { return $( 'h1.mw-first-heading' ); }
get next() { return $( '.mw-ui-icon-mf-next-invert' ); }
get save() { return $( 'button.mw-ui-button' ); }
openForEditing( title ) {
super.openTitle( title, { action: 'edit', mobileaction: 'toggle_view_mobile' } );
}
edit( name, content ) {
this.openForEditing( name );
this.content.setValue( content );
this.next.click();
this.save.click();
browser.acceptAlert();
}
}
module.exports = new EditPage();