2021-01-08 11:14:55 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const assert = require( 'assert' ),
|
|
|
|
EditPage = require( '../pageobjects/edit.page' ),
|
|
|
|
FixtureContent = require( '../fixturecontent' ),
|
|
|
|
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
|
2024-05-10 21:59:07 +00:00
|
|
|
UserPreferences = require( '../userpreferences' ),
|
|
|
|
Util = require( 'wdio-mediawiki/Util' );
|
2021-01-08 11:14:55 +00:00
|
|
|
|
2024-05-10 21:59:07 +00:00
|
|
|
// Disable as test is consistently failing on CI.
|
|
|
|
describe.skip( 'CodeMirror bracket match highlighting for the wikitext 2017 editor', function () {
|
|
|
|
let title;
|
|
|
|
|
|
|
|
before( async function () {
|
|
|
|
title = Util.getTestString( 'CodeMirror-fixture1-' );
|
|
|
|
await LoginPage.loginAdmin();
|
|
|
|
await FixtureContent.createFixturePage( title );
|
|
|
|
await UserPreferences.enableWikitext2017EditorWithCodeMirror();
|
2021-01-08 11:14:55 +00:00
|
|
|
} );
|
|
|
|
|
2024-05-10 21:59:07 +00:00
|
|
|
beforeEach( async function () {
|
|
|
|
await EditPage.openForEditing( title );
|
|
|
|
await EditPage.visualEditorSave.waitForDisplayed();
|
|
|
|
assert( !( await EditPage.wikiEditorToolbar.isDisplayed() ) );
|
|
|
|
await EditPage.clickText();
|
2021-01-08 11:14:55 +00:00
|
|
|
} );
|
|
|
|
|
2024-05-10 21:59:07 +00:00
|
|
|
it( 'highlights matching bracket', async function () {
|
|
|
|
await EditPage.cursorToPosition( 0 );
|
|
|
|
assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '[]' );
|
2021-01-08 11:14:55 +00:00
|
|
|
} );
|
|
|
|
|
2024-05-10 21:59:07 +00:00
|
|
|
it( 'matches according to cursor movement', async function () {
|
|
|
|
await EditPage.cursorToPosition( 3 );
|
|
|
|
assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '{}' );
|
2021-01-08 11:14:55 +00:00
|
|
|
} );
|
|
|
|
} );
|