| 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 |
|
| 18 |
|
| 19 |
|
| 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 |
|
| 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 |
} ); |