mediawiki-extensions-Visual.../tests/selenium/pageobjects/edit.page.js
Esther Akinloose 329574d645 selenium: Toolbar should open help popup
Bug: T296187
Change-Id: Ic818a97405e93e7545b6655073a62fd7e5b4e8a3
2022-11-30 12:36:42 +00:00

50 lines
1.8 KiB
JavaScript

'use strict';
const Page = require( 'wdio-mediawiki/Page' );
class EditPage extends Page {
get content() { return $( '#content' ); }
get edited() { return $( '*=Your edit was saved' ); }
get helpPopup() { return $( '.ve-ui-mwHelpPopupTool-items' ); }
get helpElement() { return $( '.oo-ui-tool-name-help' ); }
get insert() { return $( '.ve-ui-toolbar-group-insert' ); }
get insertTableElement() { return $( '.oo-ui-tool-name-insertTable' ); }
get insertedTable() { return $( 'table.ve-ce-branchNode' ); }
get notices() { return $( '.ve-ui-mwNoticesPopupTool-items' ); }
get notification() { return $( 'div.mw-notification-content span.oo-ui-labelElement-label' ); }
get savePage() { return $( '.ve-ui-overlay-global .oo-ui-processDialog-actions-primary' ); }
get savePageDots() { return $( '.ve-ui-toolbar-saveButton' ); }
get switchEditorElement() { return $( '.ve-ui-toolbar-group-editMode' ); }
get switchEditorPopup() { return $( '.oo-ui-popupToolGroup-active-tools' ); }
get toolbar() { return $( '.ve-init-mw-desktopArticleTarget-toolbar-open' ); }
get veBodyContent() { return $( '.mw-body-content.ve-ui-surface' ); }
get veRootNode() { return $( '.ve-ce-rootNode[role="textbox"]' ); }
openForEditing( title ) {
super.openTitle( title, { veaction: 'edit', cxhidebetapopup: 1, hidewelcomedialog: 1, vehidebetadialog: 1 } );
}
activationComplete() {
return browser.executeAsync( function ( done ) {
mw.hook( 've.activationComplete' ).add( function () {
done();
} );
} );
}
async insertTable() {
await this.insert.click();
await this.insertTableElement.click();
}
saveComplete() {
return browser.executeAsync( function ( done ) {
ve.init.target.on( 'save', function () {
done();
} );
} );
}
}
module.exports = new EditPage();