Debian Codegraph @

tests/selenium/specs/highlighting-wikitext2017.js

raw
1 'use strict';
2
3 const assert = require( 'assert' ),
4 EditPage = require( '../pageobjects/edit.page' ),
5 FixtureContent = require( '../fixturecontent' ),
6 LoginPage = require( 'wdio-mediawiki/LoginPage' ),
7 UserPreferences = require( '../userpreferences' ),
8 Util = require( 'wdio-mediawiki/Util' );
9
10 // Skipped on 2024-03-20 in 1012801
11 // Disable as test is consistently failing on CI.
12 describe.skip( 'CodeMirror bracket match highlighting for the wikitext 2017 editor', () => {
13 let title;
14
15 before( async () => {
16 title = Util.getTestString( 'CodeMirror-fixture1-' );
17 await LoginPage.loginAdmin();
18 await FixtureContent.createFixturePage( title );
19 await UserPreferences.enableWikitext2017EditorWithCodeMirror();
20 } );
21
22 beforeEach( async () => {
23 await EditPage.openForEditing( title );
24 await EditPage.visualEditorSave.waitForDisplayed();
25 assert( !( await EditPage.wikiEditorToolbar.isDisplayed() ) );
26 await EditPage.clickText();
27 } );
28
29 it( 'highlights matching bracket', async () => {
30 await EditPage.cursorToPosition( 0 );
31 assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '[]' );
32 } );
33
34 it( 'matches according to cursor movement', async () => {
35 await EditPage.cursorToPosition( 3 );
36 assert.strictEqual( await EditPage.getHighlightedMatchingBrackets(), '{}' );
37 } );
38 } );