mediawiki-extensions-Math/tests/selenium/specs/basic.js
osamaahmed17 099e327cc6 selenium: Refactor WebdriverIO tests from sync to async mode
WebdriverIO has dropped support of sync mode due to breaking changes in Chromium, hence all tests have been changed to async.

Update npm packages: @wdio/*, wdio-mediawiki and webdriverio because async mode needs at least webdriverio v7.9.

Remove npm package: @wdio/sync.

Bug: T293076
Change-Id: I35b3b29c09e80306d14a12c5194efeead22a9804
2022-02-01 01:24:19 +11:00

30 lines
611 B
JavaScript

'use strict';
const assert = require( 'assert' ),
Api = require( 'wdio-mediawiki/Api' ),
MathPage = require( '../pageobjects/math.page' );
describe( 'Math', function () {
let bot;
before( async () => {
bot = await Api.bot();
} );
it( 'should work for addition', async function () {
// 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.img.isExisting() );
} );
} );