build: Updating eslint-config-wikimedia to 0.28.0

The following rules are failing and were disabled:
* modules/ve-mw/tests:
  * implicit-arrow-linebreak

Change-Id: If857233c0de24c8cf619dbb1347ebb375f3ab1ba
This commit is contained in:
libraryupgrader 2024-06-04 03:39:48 +00:00
parent 7789b55666
commit 702677220d
26 changed files with 639 additions and 529 deletions

View file

@ -146,13 +146,13 @@ module.exports = function ( grunt ) {
grunt.registerTask( 'git-status', function () {
const done = this.async();
// Are there unstaged changes?
require( 'child_process' ).exec( 'git ls-files --modified', function ( err, stdout, stderr ) {
require( 'child_process' ).exec( 'git ls-files --modified', ( err, stdout, stderr ) => {
const ret = err || stderr || stdout;
if ( ret ) {
grunt.log.error( 'Unstaged changes in these files:' );
grunt.log.error( ret );
// Show a condensed diff
require( 'child_process' ).exec( 'git diff -U1 | tail -n +3', function ( err2, stdout2, stderr2 ) {
require( 'child_process' ).exec( 'git diff -U1 | tail -n +3', ( err2, stdout2, stderr2 ) => {
grunt.log.write( err2 || stderr2 || stdout2 );
done( false );
} );

View file

@ -76,9 +76,7 @@ function checkFiles() {
const modulesFiles = new Set();
addModulesToSet( modulesJson, modulesFiles, 'lib/ve' );
const missingFiles = Array.from( modulesFiles ).filter( ( file ) => {
return !extensionFiles.has( file ) && !isIgnored( file );
} );
const missingFiles = Array.from( modulesFiles ).filter( ( file ) => !extensionFiles.has( file ) && !isIgnored( file ) );
if ( unusedIgnores.size ) {
console.warn(

View file

@ -11,7 +11,7 @@ function runTests( lang ) {
test.describe( 'Screenshots: ' + lang, function () {
this.lang = lang;
test.it( 'Simple diff', function () {
test.it( 'Simple diff', () => {
runLang( 'VisualEditor_diff_simple', diffs.simple );
runLang( 'VisualEditor_diff_move_and_change', diffs.moveAndChange );
runLang( 'VisualEditor_diff_link_change', diffs.linkChange );

View file

@ -33,15 +33,15 @@ function createScreenshotEnvironment( test ) {
driver.manage().window().setSize( 1200, 1000 );
driver.get( 'https://en.wikipedia.org/wiki/Help:Sample_page?veaction=edit&vehidebetadialog=1&uselang=' + lang )
.then( null, function ( e ) {
.then( null, ( e ) => {
console.error( e.message );
} );
driver.wait(
driver.executeAsyncScript(
require( './screenshots-client/utils.js' )
).then( function ( cs ) {
).then( ( cs ) => {
clientSize = cs;
}, function ( e ) {
}, ( e ) => {
// Log error (timeout)
console.error( e.message );
// Setup failed, set clientSize to null so no screenshots are generated
@ -50,9 +50,9 @@ function createScreenshotEnvironment( test ) {
);
} );
test.afterEach( function () {
test.afterEach( () => {
driver.quit()
.then( null, function ( e ) {
.then( null, ( e ) => {
console.error( e.message );
} );
} );
@ -67,7 +67,7 @@ function createScreenshotEnvironment( test ) {
const right = Math.min( clientSize.width, rect.left + rect.width + padding );
const bottom = Math.min( clientSize.height, rect.top + rect.height + padding );
return Jimp.read( imageBuffer ).then( function ( jimpImage ) {
return Jimp.read( imageBuffer ).then( ( jimpImage ) => {
try {
jimpImage
.crop( left, top, right - left, bottom - top )
@ -89,20 +89,18 @@ function createScreenshotEnvironment( test ) {
driver.manage().timeouts().setScriptTimeout( TIMEOUT );
driver.wait(
driver.executeAsyncScript( clientScript ).then( function ( rect ) {
return driver.takeScreenshot().then( function ( base64Image ) {
if ( rect ) {
const imageBuffer = Buffer.from( base64Image, 'base64' );
return cropScreenshot( filename, imageBuffer, rect, padding );
} else {
fs.writeFile( filename, base64Image, 'base64' );
}
} ).then( function () {
if ( teardownScript ) {
return driver.executeAsyncScript( teardownScript );
}
} );
}, function ( e ) {
driver.executeAsyncScript( clientScript ).then( ( rect ) => driver.takeScreenshot().then( ( base64Image ) => {
if ( rect ) {
const imageBuffer = Buffer.from( base64Image, 'base64' );
return cropScreenshot( filename, imageBuffer, rect, padding );
} else {
fs.writeFile( filename, base64Image, 'base64' );
}
} ).then( () => {
if ( teardownScript ) {
return driver.executeAsyncScript( teardownScript );
}
} ), ( e ) => {
// Log error (timeout)
console.error( e );
} )

View file

@ -11,7 +11,7 @@ function runTests( lang ) {
test.describe( 'Screenshots: ' + lang, function () {
this.lang = lang;
test.it( 'Screenshots', function () {
test.it( 'Screenshots', () => {
// Toolbar & action tools
runLang( 'VisualEditor_toolbar', userGuide.toolbar, 0 );
@ -57,6 +57,6 @@ function runTests( lang ) {
} );
}
langs.forEach( function ( lang ) {
langs.forEach( ( lang ) => {
runTests( lang );
} );

View file

@ -12,10 +12,14 @@
"sinon": "readonly"
},
"rules": {
"compat/compat": [ "error", "last 2 chrome versions, last 2 firefox versions" ],
"compat/compat": [
"error",
"last 2 chrome versions, last 2 firefox versions"
],
"indent": "off",
"no-jquery/no-html": "off",
"no-jquery/no-parse-html-literal": "off"
"no-jquery/no-parse-html-literal": "off",
"implicit-arrow-linebreak": "warn"
},
"parserOptions": {
"ecmaVersion": 2018

View file

@ -235,6 +235,6 @@ QUnit.test.each( 'getFragment', {
original: 'Foo#bar#baz#bat',
expected: 'bar#baz#bat'
}
}, function ( assert, { original, expected } ) {
}, ( assert, { original, expected } ) => {
assert.strictEqual( ve.dm.MWInternalLinkAnnotation.static.getFragment( original ), expected );
} );

View file

@ -44,8 +44,7 @@
[ '/unexpected_prefix', '/unexpected prefix' ],
[ './Template:%C3%9Cnicode%5Fexample/subpage', 'Template:Ünicode example/subpage' ],
[ './Template:Possibly_invalid%5B%5D', 'Template:Possibly invalid[]' ]
].forEach( ( [ href, expected ] ) =>
QUnit.test( 'getTitle: ' + href, ( assert ) => {
].forEach( ( [ href, expected ] ) => QUnit.test( 'getTitle: ' + href, ( assert ) => {
const transclusion = { nextUniquePartId: () => '' },
template = new ve.dm.MWTemplateModel( transclusion, { href } );
assert.strictEqual( template.getTitle(), expected );
@ -200,8 +199,7 @@
},
expected: [ 'foo', 'bar', 'Bar', 'empty' ]
}
].forEach( ( { name, spec, expected } ) =>
QUnit.test( name, ( assert ) => {
].forEach( ( { name, spec, expected } ) => QUnit.test( name, ( assert ) => {
const template = newTemplateModel();
template.getSpec().setTemplateData( spec );
@ -322,8 +320,7 @@
''
]
}
].forEach( ( { name, spec, expected } ) =>
QUnit.test( 'getOrderedParameterNames: ' + name, ( assert ) => {
].forEach( ( { name, spec, expected } ) => QUnit.test( 'getOrderedParameterNames: ' + name, ( assert ) => {
const template = newTemplateModel();
if ( spec ) {
@ -459,8 +456,7 @@
''
]
}
].forEach( ( { name, spec, expected } ) =>
QUnit.test( 'getAllParametersOrdered: ' + name, ( assert ) => {
].forEach( ( { name, spec, expected } ) => QUnit.test( 'getAllParametersOrdered: ' + name, ( assert ) => {
const template = newTemplateModel();
if ( spec ) {
@ -493,8 +489,7 @@
[ ' SUBST: a', 'b', 'Template:A', 'ignores capitalization and whitespace' ],
[ 'subst :a', 'b', 'Template:Subst :a', 'leaves bad whitespace untouched' ],
[ 'int:a', 'b', 'Template:Int:a', 'leaves other prefixes untouched' ]
].forEach( ( [ wt, href, expected, message ] ) =>
QUnit.test( 'getTemplateDataQueryTitle: ' + message, ( assert ) => {
].forEach( ( [ wt, href, expected, message ] ) => QUnit.test( 'getTemplateDataQueryTitle: ' + message, ( assert ) => {
const transclusion = { nextUniquePartId: () => '' },
data = { target: { wt, href } },
model = ve.dm.MWTemplateModel.newFromData( transclusion, data );
@ -512,8 +507,7 @@
[ { p1: { wt: ' ' } }, true, 'space' ],
[ { p1: { wt: '0' } }, true, '0' ],
[ { p1: { wt: '\nfoo' } }, true, 'newline' ]
].forEach( ( [ params, expected, message ] ) =>
QUnit.test( 'containsValuableData: ' + message, ( assert ) => {
].forEach( ( [ params, expected, message ] ) => QUnit.test( 'containsValuableData: ' + message, ( assert ) => {
const transclusion = { nextUniquePartId: () => '' },
data = { target: {}, params },
model = ve.dm.MWTemplateModel.newFromData( transclusion, data );

View file

@ -118,8 +118,7 @@
[ '{{a_a}}', './Talk:b_b', 'Talk:B b', 'does not strip other namespaces' ],
[ '{{a_a}}', './b_b', ':B b', 'title in main namespace must be prefixed' ],
[ '{{a_a}}', './Template:{{b_b}}', 'Template:{{b b}}', 'falls back to unmodified href if invalid' ]
].forEach( ( [ wt, href, expected, message ] ) =>
QUnit.test( 'getLabel: ' + message, ( assert ) => {
].forEach( ( [ wt, href, expected, message ] ) => QUnit.test( 'getLabel: ' + message, ( assert ) => {
const transclusion = new ve.dm.MWTransclusionModel(),
template = new ve.dm.MWTemplateModel( transclusion, { wt, href } ),
spec = new ve.dm.MWTemplateSpecModel( template );
@ -133,8 +132,7 @@
null,
[],
{}
].forEach( ( templateData ) =>
QUnit.test( 'Invalid TemplateData, e.g. empty or without params', ( assert ) => {
].forEach( ( templateData ) => QUnit.test( 'Invalid TemplateData, e.g. empty or without params', ( assert ) => {
const template = createTemplateMock(),
spec = new ve.dm.MWTemplateSpecModel( template );
@ -301,8 +299,7 @@
[ { notemplatedata: false }, true, 'unexpected false' ],
[ { notemplatedata: '' }, true, 'unsupported formatversion=1' ]
].forEach( ( [ templateData, expected, message ] ) =>
QUnit.test( 'isDocumented(): ' + message, ( assert ) => {
].forEach( ( [ templateData, expected, message ] ) => QUnit.test( 'isDocumented(): ' + message, ( assert ) => {
const template = createTemplateMock(),
spec = new ve.dm.MWTemplateSpecModel( template );

View file

@ -17,8 +17,7 @@
[ ' ', true ],
[ '0', true ],
[ '\nfoo', true ]
].forEach( ( [ wikitext, expected ] ) =>
QUnit.test( 'containsValuableData: ' + wikitext, ( assert ) => {
].forEach( ( [ wikitext, expected ] ) => QUnit.test( 'containsValuableData: ' + wikitext, ( assert ) => {
const model = new ve.dm.MWTransclusionContentModel( createTransclusionModel(), wikitext );
assert.strictEqual( model.containsValuableData(), expected );

View file

@ -31,7 +31,7 @@
} );
};
QUnit.test( 'nextUniquePartId', function ( assert ) {
QUnit.test( 'nextUniquePartId', ( assert ) => {
const transclusion = new ve.dm.MWTransclusionModel();
assert.strictEqual( transclusion.nextUniquePartId(), 'part_0' );
assert.strictEqual( transclusion.nextUniquePartId(), 'part_1' );

View file

@ -14,11 +14,9 @@ ve.dm.mwExample = {};
ve.dm.mwExample.baseUri = 'http://example.com/wiki/';
ve.dm.mwExample.createExampleDocument = ( name, store, base ) =>
ve.dm.example.createExampleDocumentFromObject( name, store, ve.dm.mwExample, base || ve.dm.mwExample.baseUri );
ve.dm.mwExample.createExampleDocument = ( name, store, base ) => ve.dm.example.createExampleDocumentFromObject( name, store, ve.dm.mwExample, base || ve.dm.mwExample.baseUri );
ve.dm.mwExample.createExampleDocumentFromData = ( data, store, base ) =>
ve.dm.example.createExampleDocumentFromData( data, store, base || ve.dm.mwExample.baseUri );
ve.dm.mwExample.createExampleDocumentFromData = ( data, store, base ) => ve.dm.example.createExampleDocumentFromData( data, store, base || ve.dm.mwExample.baseUri );
ve.dm.mwExample.MWTransclusion = {
blockOpen: ve.dm.example.singleLine`

View file

@ -22,11 +22,9 @@ ve.test.utils.runWikitextStringHandlerTest = ( assert, server, string, mimeType,
item = ve.ui.DataTransferItem.static.newFromString( string, mimeType ),
doc = ve.dm.Document.static.newBlankDocument(),
mockSurface = {
getModel: () => {
return {
getModel: () => ( {
getDocument: () => doc
};
},
} ),
createProgress: () => ve.createDeferred().promise()
};

View file

@ -14,7 +14,7 @@ QUnit.module( 've.ui.FragmentInspector (MW)', ve.test.utils.newMwEnvironment( {
/* Tests */
QUnit.test( 'Wikitext link inspector', function ( assert ) {
QUnit.test( 'Wikitext link inspector', ( assert ) => {
const done = assert.async(),
surface = ve.init.target.createSurface(
ve.dm.converter.getModelFromDom(

View file

@ -46,8 +46,7 @@ QUnit.test( 'Input event handlers', ( assert ) => {
[ 'usedAliasNoLabel', '(visualeditor-dialog-transclusion-add-param-error-alias: usedAliasNoLabel, usedAliasNoLabel)' ],
[ 'usedDeprecated', '(visualeditor-dialog-transclusion-add-param-error-exists-selected: usedDeprecated, usedDeprecated)' ],
[ 'unusedDeprecated', '(visualeditor-dialog-transclusion-add-param-error-deprecated: unusedDeprecated, unusedDeprecated)' ]
].forEach( ( [ input, expected ] ) =>
QUnit.test( 'getValidationErrors: ' + input, ( assert ) => {
].forEach( ( [ input, expected ] ) => QUnit.test( 'getValidationErrors: ' + input, ( assert ) => {
const data = {
target: {},
params: {

View file

@ -38,8 +38,7 @@ QUnit.module( 've.ui.MWParameterPage', ve.test.utils.newMwEnvironment );
[ 'wiki-template-name', '', mw.widgets.TitleInputWidget ],
[ 'wiki-template-name', 'GoodTitle', mw.widgets.TitleInputWidget ],
[ 'wiki-template-name', '[[BadTitle]]', ve.ui.MWLazyMultilineTextInputWidget ]
].forEach( ( [ type, value, expected ] ) =>
QUnit.test( `createValueInput: ${ type }, ${ value }`, ( assert ) => {
].forEach( ( [ type, value, expected ] ) => QUnit.test( `createValueInput: ${ type }, ${ value }`, ( assert ) => {
const transclusion = new ve.dm.MWTransclusionModel(),
template = new ve.dm.MWTemplateModel( transclusion, {} ),
parameter = new ve.dm.MWParameterModel( template, 'p', value );
@ -68,8 +67,7 @@ QUnit.module( 've.ui.MWParameterPage', ve.test.utils.newMwEnvironment );
[ 'wiki-user-name', mw.widgets.UserInputWidget ],
[ 'wiki-file-name', mw.widgets.TitleInputWidget ],
[ 'wiki-template-name', mw.widgets.TitleInputWidget ]
].forEach( ( [ type, expected ] ) =>
QUnit.test( `suggestedvalues: ${ type }`, ( assert ) => {
].forEach( ( [ type, expected ] ) => QUnit.test( `suggestedvalues: ${ type }`, ( assert ) => {
const transclusion = new ve.dm.MWTransclusionModel(),
template = new ve.dm.MWTemplateModel( transclusion, {} ),
parameter = new ve.dm.MWParameterModel( template, 'p', '' );
@ -119,8 +117,7 @@ QUnit.module( 've.ui.MWParameterPage', ve.test.utils.newMwEnvironment );
'', ' ', true,
'same for the default'
]
].forEach( ( [ value, defaultValue, expected, message ] ) =>
QUnit.test( 'containsSomeValue: ' + message, ( assert ) => {
].forEach( ( [ value, defaultValue, expected, message ] ) => QUnit.test( 'containsSomeValue: ' + message, ( assert ) => {
const transclusion = new ve.dm.MWTransclusionModel(),
template = new ve.dm.MWTemplateModel( transclusion, {} ),
parameter = new ve.dm.MWParameterModel( template, 'p', value );

View file

@ -13,8 +13,7 @@ QUnit.test( 'Constructor passes config to parent', ( assert ) => {
[ '', false, 'empty string' ],
[ '2', false, 'unexpected string' ],
[ true, false, 'unexpected type' ]
].forEach( ( [ value, expected, message ] ) =>
QUnit.test( `setValue( ${ message } )`, ( assert ) => {
].forEach( ( [ value, expected, message ] ) => QUnit.test( `setValue( ${ message } )`, ( assert ) => {
const widget = new ve.ui.MWParameterCheckboxInputWidget();
widget.setValue( value );
@ -26,8 +25,7 @@ QUnit.test( 'Constructor passes config to parent', ( assert ) => {
[
true,
false
].forEach( ( value ) =>
QUnit.test( `setSelected( ${ value } )`, ( assert ) => {
].forEach( ( value ) => QUnit.test( `setSelected( ${ value } )`, ( assert ) => {
const widget = new ve.ui.MWParameterCheckboxInputWidget();
widget.setSelected( value );

View file

@ -1,20 +1,15 @@
{
const toggleCirrusSearchLookup = ( enabled ) =>
mw.config.set( 'wgVisualEditorConfig', ve.extendObject( {}, mw.config.get( 'wgVisualEditorConfig' ), {
const toggleCirrusSearchLookup = ( enabled ) => mw.config.set( 'wgVisualEditorConfig', ve.extendObject( {}, mw.config.get( 'wgVisualEditorConfig' ), {
cirrusSearchLookup: enabled !== false
} ) );
const makeFakeApi = () => {
return {
const makeFakeApi = () => ( {
defaults: { parameters: {} },
get: () => {
return {
get: () => ( {
abort: { bind: () => {} },
then: () => {}
};
}
};
};
} )
} );
QUnit.module( 've.ui.MWTemplateTitleInputWidget', ve.test.utils.newMwEnvironment( {
// Config will be reset by newMwEnvironment's teardown

View file

@ -70,8 +70,7 @@ QUnit.test( 'Adding and moving parts to specific positions', ( assert ) => {
[ 'part_0/foo', 'foo' ],
[ 'part_1/foo', null ],
[ 'part_0/foo/bar', 'foo/bar' ]
].forEach( ( [ pageName, expected ] ) =>
QUnit.test( 'setSelectionByPageName: ' + pageName, ( assert ) => {
].forEach( ( [ pageName, expected ] ) => QUnit.test( 'setSelectionByPageName: ' + pageName, ( assert ) => {
const transclusion = new ve.dm.MWTransclusionModel(),
template = new ve.dm.MWTemplateModel( transclusion, { wt: '' } ),
partWidget = new ve.ui.MWTransclusionOutlineTemplateWidget( template ),

View file

@ -137,7 +137,7 @@ ve.ui.MWAceEditorWidget.prototype.setupEditor = function () {
this.editor.renderer.on( 'resize', this.onEditorResize.bind( this ) );
this.setEditorValue( this.getValue() );
// Force resize (T303964)
// eslint-disable-next-line es-x/no-resizable-and-growable-arraybuffers
this.editor.resize( true );
};
@ -399,7 +399,7 @@ ve.ui.MWAceEditorWidget.prototype.adjustSize = function ( force ) {
// so do nothing here unless this is a user triggered resize, otherwise call the parent method.
if ( force ) {
this.loadingPromise.done( () => {
// eslint-disable-next-line es-x/no-resizable-and-growable-arraybuffers
this.editor.resize();
} );
}

966
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -20,7 +20,7 @@
"@wdio/mocha-framework": "7.16.13",
"@wdio/spec-reporter": "7.16.13",
"api-testing": "1.6.0",
"eslint-config-wikimedia": "0.27.0",
"eslint-config-wikimedia": "0.28.0",
"grunt": "1.6.1",
"grunt-banana-checker": "0.13.0",
"grunt-contrib-watch": "1.1.0",
@ -29,10 +29,10 @@
"grunt-mocha-test": "0.13.3",
"grunt-stylelint": "0.20.0",
"grunt-tyops": "0.1.1",
"jimp": "0.13.0",
"jsdoc": "4.0.2",
"jsdoc-class-hierarchy": "1.1.2",
"jsdoc-wmf-theme": "1.0.1",
"jimp": "0.13.0",
"mocha": "5.2.0",
"selenium-webdriver": "3.6.0",
"stringify-object": "3.2.2",

View file

@ -2,7 +2,7 @@
const { action, assert, utils } = require( 'api-testing' );
describe( 'Visual Editor API', function () {
describe( 'Visual Editor API', () => {
const title = utils.title( 'VisualEditor' );
let alice;
@ -66,7 +66,7 @@ describe( 'Visual Editor API', function () {
// VisualEditor edit: 'visualeditoredit' action API ///
const page = utils.title( 'VisualEditorNew' );
describe( 'Editing', function () {
describe( 'Editing', () => {
it( 'Should create page, edit and save page with HTML', async () => {
const token = await alice.token();
const html = '<p>save paction</p>';

View file

@ -120,8 +120,8 @@ class EditPage extends Page {
}
activationComplete() {
return browser.executeAsync( function ( done ) {
mw.hook( 've.activationComplete' ).add( function () {
return browser.executeAsync( ( done ) => {
mw.hook( 've.activationComplete' ).add( () => {
done();
} );
} );
@ -133,8 +133,8 @@ class EditPage extends Page {
}
saveComplete() {
return browser.executeAsync( function ( done ) {
ve.init.target.on( 'save', function () {
return browser.executeAsync( ( done ) => {
ve.init.target.on( 'save', () => {
done();
} );
} );

View file

@ -4,11 +4,11 @@ const EditPage = require( '../pageobjects/edit.page' );
const LoginPage = require( 'wdio-mediawiki/LoginPage' );
const Util = require( 'wdio-mediawiki/Util' );
describe( 'Content Editable', function () {
describe( 'Content Editable', () => {
let name, content;
beforeEach( async function () {
beforeEach( async () => {
content = Util.getTestString();
name = Util.getTestString();
await LoginPage.loginAdmin();
@ -17,24 +17,24 @@ describe( 'Content Editable', function () {
await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
} );
afterEach( async function () {
afterEach( async () => {
// 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();
} );
it( 'should load when an url is opened @daily', async function () {
it( 'should load when an url is opened @daily', async () => {
assert( await EditPage.toolbar.isDisplayed() );
} );
it( 'should be editable', async function () {
it( 'should be editable', async () => {
await EditPage.veRootNode.setValue( content );
assert.equal( await EditPage.veRootNode.getText(), content );
} );
it( 'should save an edit', async function () {
it( 'should save an edit', async () => {
await EditPage.veRootNode.setValue( content );
await EditPage.savePageDots.click();
await EditPage.savePage.waitForClickable();
@ -44,7 +44,7 @@ describe( 'Content Editable', function () {
assert.strictEqual( await EditPage.notification.getText(), 'The page has been created.' );
} );
it( 'should insert a table', async function () {
it( 'should insert a table', async () => {
await EditPage.insertTable();
assert( await EditPage.insertedTable.isDisplayed() );

View file

@ -3,71 +3,71 @@ const assert = require( 'assert' );
const EditPage = require( '../pageobjects/edit.page' );
const Util = require( 'wdio-mediawiki/Util' );
describe( 'Toolbar', function () {
describe( 'Toolbar', () => {
let name;
beforeEach( async function () {
beforeEach( async () => {
name = Util.getTestString();
await EditPage.openForEditing( name );
await EditPage.toolbar.waitForDisplayed( { timeout: 20000 } );
} );
afterEach( async function () {
afterEach( async () => {
// 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();
} );
it( 'should open notices popup as soon as it loads', async function () {
it( 'should open notices popup as soon as it loads', async () => {
assert( await EditPage.notices.isDisplayed() );
} );
it( 'should open switch editor', async function () {
it( 'should open switch editor', async () => {
await EditPage.switchEditorElement.click();
assert( await EditPage.visualEditing.isDisplayed() );
} );
it( 'should open page options', async function () {
it( 'should open page options', async () => {
await EditPage.pageOptionsElement.click();
assert( await EditPage.options.isDisplayed() );
} );
it( 'should open help popup', async function () {
it( 'should open help popup', async () => {
await EditPage.helpElement.click();
assert( await EditPage.helpPopup.isDisplayed() );
} );
it.skip( 'should open special characters menu', async function () {
it.skip( 'should open special characters menu', async () => {
await EditPage.specialCharacterElement.click();
await EditPage.specialCharacterMenu.waitForDisplayed( { timeout: 1000 } );
assert( await EditPage.specialCharacterMenu.isDisplayed() );
} );
it( 'should open insert menu', async function () {
it( 'should open insert menu', async () => {
await EditPage.insert.click();
assert( await EditPage.insertMenu.isDisplayed() );
} );
it( 'should open structure options menu', async function () {
it( 'should open structure options menu', async () => {
await EditPage.structureOptionsElement.click();
assert( await EditPage.bulletListOption.isDisplayed() );
} );
it( 'should open style text options', async function () {
it( 'should open style text options', async () => {
await EditPage.styleTextElement.click();
assert( await EditPage.boldTextStyleOption.isDisplayed() );
} );
it( 'should open format paragraph menu', async function () {
it( 'should open format paragraph menu', async () => {
await EditPage.formatParagraphElement.click();
assert( await EditPage.paragraphFormatMenu.isDisplayed() );