mediawiki-extensions-CodeMi.../tests/selenium/fixturecontent.js
Adam Wight d6c6dbd73a Browser tests for CodeMirror (wikitext 2010 editor)
Basic tests to show that the highlighting classes have been attached
to the expected elements.

TODO in later patches:
* tests for the wikitext 2017 editor

Bug: T270240
Change-Id: I01ebd9881d38dd877f19ee3bb4fdcbb74d43afaf
2021-01-08 11:01:13 +01:00

24 lines
501 B
JavaScript

'use strict';
const Api = require( 'wdio-mediawiki/Api' );
const Util = require( 'wdio-mediawiki/Util' );
const fixture1 = '[]{{template}}';
class FixtureContent {
/**
* Create a new fixture for testing syntax highlighting.
*
* @return {string} Page title
*/
createFixturePage() {
const title = Util.getTestString( 'CodeMirror-fixture1-' );
browser.call( () => Api.bot().then( ( bot ) => bot.edit( title, fixture1 ) ) );
return title;
}
}
module.exports = new FixtureContent();