2022-10-19 13:04:49 +00:00
|
|
|
'use strict';
|
|
|
|
const assert = require( 'assert' );
|
|
|
|
const EditPage = require( '../pageobjects/edit.page' );
|
|
|
|
const Util = require( 'wdio-mediawiki/Util' );
|
|
|
|
|
|
|
|
describe( 'Toolbar', function () {
|
|
|
|
|
|
|
|
let name;
|
|
|
|
|
|
|
|
beforeEach( async function () {
|
|
|
|
name = Util.getTestString();
|
|
|
|
await EditPage.openForEditing( name );
|
|
|
|
await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
|
|
|
|
} );
|
|
|
|
|
|
|
|
afterEach( async function () {
|
|
|
|
// T269566: Popup with text
|
|
|
|
// 'Leave site? Changes that you made may not be saved. Cancel/Leave'
|
|
|
|
// appears after the browser tries to leave the page with the preview.
|
|
|
|
await browser.reloadSession();
|
|
|
|
} );
|
|
|
|
|
2022-11-30 13:43:32 +00:00
|
|
|
it( 'should open notices popup as soon as it loads', async function () {
|
|
|
|
assert( await EditPage.notices.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2022-10-19 13:04:49 +00:00
|
|
|
it( 'should open switch editor', async function () {
|
|
|
|
await EditPage.switchEditorElement.click();
|
|
|
|
|
2022-10-20 05:42:31 +00:00
|
|
|
assert( await EditPage.visualEditing.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'should open page options', async function () {
|
|
|
|
await EditPage.pageOptionsElement.click();
|
|
|
|
|
|
|
|
assert( await EditPage.options.isDisplayed() );
|
2022-10-19 13:04:49 +00:00
|
|
|
} );
|
|
|
|
|
2022-11-30 12:36:42 +00:00
|
|
|
it( 'should open help popup', async function () {
|
|
|
|
await EditPage.helpElement.click();
|
|
|
|
|
|
|
|
assert( await EditPage.helpPopup.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2023-06-21 20:07:17 +00:00
|
|
|
it.skip( 'should open special characters menu', async function () {
|
2022-11-30 14:17:33 +00:00
|
|
|
await EditPage.specialCharacterElement.click();
|
|
|
|
await EditPage.specialCharacterMenu.waitForDisplayed( { timeout: 1000 } );
|
|
|
|
|
|
|
|
assert( await EditPage.specialCharacterMenu.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2022-12-02 22:07:49 +00:00
|
|
|
it( 'should open insert menu', async function () {
|
|
|
|
await EditPage.insert.click();
|
|
|
|
|
|
|
|
assert( await EditPage.insertMenu.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2022-12-02 22:38:34 +00:00
|
|
|
it( 'should open structure options menu', async function () {
|
|
|
|
await EditPage.structureOptionsElement.click();
|
|
|
|
|
|
|
|
assert( await EditPage.bulletListOption.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2022-12-02 23:10:17 +00:00
|
|
|
it( 'should open style text options', async function () {
|
|
|
|
await EditPage.styleTextElement.click();
|
|
|
|
|
|
|
|
assert( await EditPage.boldTextStyleOption.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2022-12-02 23:38:54 +00:00
|
|
|
it( 'should open format paragraph menu', async function () {
|
|
|
|
await EditPage.formatParagraphElement.click();
|
|
|
|
|
|
|
|
assert( await EditPage.paragraphFormatMenu.isDisplayed() );
|
|
|
|
} );
|
|
|
|
|
2022-10-19 13:04:49 +00:00
|
|
|
} );
|