mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 03:08:12 +00:00
8ef144f936
Change-Id: I5aa3ab891890b52057a5fc855315e5b1b2203037
41 lines
789 B
JavaScript
41 lines
789 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' );
|
|
}
|
|
|
|
// Sync with src/mobile.editor.overlay/EditorOverlayBase.js in MobileFrontend
|
|
get next() {
|
|
return $( '.mf-icon-next-invert' );
|
|
}
|
|
|
|
get save() {
|
|
return $( 'button.cdx-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();
|