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
|
|
|
|
2018-11-12 16:21:34 +00:00
|
|
|
it( 'should work for addition', 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
|
2020-06-02 18:58:33 +00:00
|
|
|
browser.call( async () => {
|
|
|
|
await bot.edit( pageName, '<math>3 + 2</math>' );
|
2018-11-12 16:21:34 +00:00
|
|
|
} );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
2018-11-12 16:21:34 +00:00
|
|
|
MathPage.openTitle( pageName );
|
2017-04-07 13:39:38 +00:00
|
|
|
|
|
|
|
// check if the page displays the image
|
2018-11-12 16:21:34 +00:00
|
|
|
assert( 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
|
|
|
} );
|