mediawiki-skins-MinervaNeue/tests/selenium/pageobjects/edit.page.js
Moh'd Khier Abualruz 41a5ac75c5 Update modules to not use data URIs to reduce bundle size
- Add "useDataURI": false to following modules:
 -- skins.minerva.mainMenu.advanced.icons
 -- skins.minerva.personalMenu.icons
 -- Remove .mw-ui-icon-mf-next-invert old class kept for caching from edit.page.js

Bug: T346162
Change-Id: I362fdc9c68a7483c182e3540cba6501d9b12959d
2023-12-06 00:24:22 +00:00

27 lines
770 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();