2017-04-07 13:39:38 +00:00
|
|
|
'use strict';
|
2020-06-16 14:45:59 +00:00
|
|
|
|
2018-11-12 16:21:34 +00:00
|
|
|
const assert = require( 'assert' ),
|
|
|
|
Api = require( 'wdio-mediawiki/Api' ),
|
|
|
|
MathPage = require( '../pageobjects/math.page' );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
2018-11-12 16:21:34 +00:00
|
|
|
describe( 'Math', function () {
|
2020-06-02 18:58:33 +00:00
|
|
|
let bot;
|
|
|
|
|
|
|
|
before( async () => {
|
|
|
|
bot = await Api.bot();
|
|
|
|
} );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
2022-01-19 20:16:20 +00:00
|
|
|
it( 'should work for addition', async function () {
|
2017-04-07 13:39:38 +00:00
|
|
|
|
|
|
|
// page should have random name
|
2020-06-16 14:45:59 +00:00
|
|
|
const pageName = Math.random().toString();
|
2017-04-07 13:39:38 +00:00
|
|
|
|
|
|
|
// create a page with a simple addition
|
2022-01-19 20:16:20 +00:00
|
|
|
await bot.edit( pageName, '<math>3 + 2</math>' );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
2022-01-19 20:16:20 +00:00
|
|
|
await MathPage.openTitle( pageName );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
|
|
|
// check if the page displays the image
|
2022-01-19 20:16:20 +00:00
|
|
|
assert( await MathPage.img.isExisting() );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
2018-11-12 16:21:34 +00:00
|
|
|
} );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
2018-11-12 16:21:34 +00:00
|
|
|
} );
|