2022-10-19 13:04:49 +00:00
|
|
|
'use strict';
|
|
|
|
const EditPage = require( '../pageobjects/edit.page' );
|
|
|
|
const Util = require( 'wdio-mediawiki/Util' );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
describe( 'Toolbar', () => {
|
2022-10-19 13:04:49 +00:00
|
|
|
|
|
|
|
let name;
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
beforeEach( async () => {
|
2022-10-19 13:04:49 +00:00
|
|
|
name = Util.getTestString();
|
|
|
|
await EditPage.openForEditing( name );
|
|
|
|
await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
|
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
afterEach( async () => {
|
2022-10-19 13:04:49 +00:00
|
|
|
// 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();
|
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open notices popup as soon as it loads', async () => {
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.notices ).toBeDisplayed();
|
2022-11-30 13:43:32 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open switch editor', async () => {
|
2022-10-19 13:04:49 +00:00
|
|
|
await EditPage.switchEditorElement.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.visualEditing ).toBeDisplayed();
|
2022-10-20 05:42:31 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open page options', async () => {
|
2022-10-20 05:42:31 +00:00
|
|
|
await EditPage.pageOptionsElement.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.options ).toBeDisplayed();
|
2022-10-19 13:04:49 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open help popup', async () => {
|
2022-11-30 12:36:42 +00:00
|
|
|
await EditPage.helpElement.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.helpPopup ).toBeDisplayed();
|
2022-11-30 12:36:42 +00:00
|
|
|
} );
|
|
|
|
|
2024-09-16 13:02:31 +00:00
|
|
|
// Skipped on 2023-06-21 in 931997 because of T296187
|
2024-06-04 03:39:48 +00:00
|
|
|
it.skip( 'should open special characters menu', async () => {
|
2022-11-30 14:17:33 +00:00
|
|
|
await EditPage.specialCharacterElement.click();
|
|
|
|
await EditPage.specialCharacterMenu.waitForDisplayed( { timeout: 1000 } );
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.specialCharacterMenu ).toBeDisplayed();
|
2022-11-30 14:17:33 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open insert menu', async () => {
|
2022-12-02 22:07:49 +00:00
|
|
|
await EditPage.insert.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.insertMenu ).toBeDisplayed();
|
2022-12-02 22:07:49 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open structure options menu', async () => {
|
2022-12-02 22:38:34 +00:00
|
|
|
await EditPage.structureOptionsElement.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.bulletListOption ).toBeDisplayed();
|
2022-12-02 22:38:34 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open style text options', async () => {
|
2022-12-02 23:10:17 +00:00
|
|
|
await EditPage.styleTextElement.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.boldTextStyleOption ).toBeDisplayed();
|
2022-12-02 23:10:17 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-04 03:39:48 +00:00
|
|
|
it( 'should open format paragraph menu', async () => {
|
2022-12-02 23:38:54 +00:00
|
|
|
await EditPage.formatParagraphElement.click();
|
|
|
|
|
2024-11-12 12:56:56 +00:00
|
|
|
await expect( await EditPage.paragraphFormatMenu ).toBeDisplayed();
|
2022-12-02 23:38:54 +00:00
|
|
|
} );
|
|
|
|
|
2022-10-19 13:04:49 +00:00
|
|
|
} );
|