Debian Codegraph @

extensions/VisualEditor/tests/selenium/specs/toolbar.js

raw symbols SCIP
1 'use strict';
2 const assert = require( 'assert' );
3 const EditPage = require( '../pageobjects/edit.page' );
4 const Util = require( 'wdio-mediawiki/Util' );
5
6 describe( 'Toolbar', () => {
7
8 let name;
9
10 beforeEach( async () => {
11 name = Util.getTestString();
12 await EditPage.openForEditing( name );
13 await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
14 } );
15
16 afterEach( async () => {
17 // T269566: Popup with text
18 // 'Leave site? Changes that you made may not be saved. Cancel/Leave'
19 // appears after the browser tries to leave the page with the preview.
20 await browser.reloadSession();
21 } );
22
23 it( 'should open notices popup as soon as it loads', async () => {
24 assert( await EditPage.notices.isDisplayed() );
25 } );
26
27 it( 'should open switch editor', async () => {
28 await EditPage.switchEditorElement.click();
29
30 assert( await EditPage.visualEditing.isDisplayed() );
31 } );
32
33 it( 'should open page options', async () => {
34 await EditPage.pageOptionsElement.click();
35
36 assert( await EditPage.options.isDisplayed() );
37 } );
38
39 it( 'should open help popup', async () => {
40 await EditPage.helpElement.click();
41
42 assert( await EditPage.helpPopup.isDisplayed() );
43 } );
44
45 // Skipped on 2023-06-21 in 931997 because of T296187
46 it.skip( 'should open special characters menu', async () => {
47 await EditPage.specialCharacterElement.click();
48 await EditPage.specialCharacterMenu.waitForDisplayed( { timeout: 1000 } );
49
50 assert( await EditPage.specialCharacterMenu.isDisplayed() );
51 } );
52
53 it( 'should open insert menu', async () => {
54 await EditPage.insert.click();
55
56 assert( await EditPage.insertMenu.isDisplayed() );
57 } );
58
59 it( 'should open structure options menu', async () => {
60 await EditPage.structureOptionsElement.click();
61
62 assert( await EditPage.bulletListOption.isDisplayed() );
63 } );
64
65 it( 'should open style text options', async () => {
66 await EditPage.styleTextElement.click();
67
68 assert( await EditPage.boldTextStyleOption.isDisplayed() );
69 } );
70
71 it( 'should open format paragraph menu', async () => {
72 await EditPage.formatParagraphElement.click();
73
74 assert( await EditPage.paragraphFormatMenu.isDisplayed() );
75 } );
76
77 } );