mediawiki-extensions-Math/tests/selenium/specs/basic.js
physikerwelt 89e45815e8
Fix selenium tests
Update test to find MathML element instead of image.

This is required since the default in labs in now MathML.

Bug: T372872
Change-Id: I4e9500effaca9cef704f06ec003a0e01bdcfb3f1
2024-08-27 13:28:46 +02:00

30 lines
602 B
JavaScript

'use strict';
const assert = require( 'assert' ),
Api = require( 'wdio-mediawiki/Api' ),
MathPage = require( '../pageobjects/math.page' );
describe( 'Math', () => {
let bot;
before( async () => {
bot = await Api.bot();
} );
it( 'should work for addition', async () => {
// page should have random name
const pageName = Math.random().toString();
// create a page with a simple addition
await bot.edit( pageName, '<math>3 + 2</math>' );
await MathPage.openTitle( pageName );
// check if the page displays the image
assert( await MathPage.mathml.isExisting() );
} );
} );