mediawiki-extensions-Revisi.../tests/selenium/specs/pointers.js
Vaughn Walters 8a53d056be selenium: Refactor WebdriverIO tests from sync to async mode
WebdriverIO has dropped support of sync mode, hence changed to async.

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

Remove npm packages: @wdio/dot-reporter and @wdio/sync.

Bug: T300798
Change-Id: I053ea6b5fbfdcff279f4eb10cf2429155690bd72
2023-03-31 14:10:46 -05:00

55 lines
1.2 KiB
JavaScript

'use strict';
const assert = require( 'assert' ),
DiffPage = require( '../pageobjects/diff.page' );
describe( 'RevisionSlider pointers', function () {
before( async function () {
await DiffPage.prepareSimpleTests( 3 );
} );
beforeEach( async function () {
DiffPage.ready();
await DiffPage.openSlider();
} );
afterEach( async function () {
await browser.refresh();
} );
it( ' can be dragged', async function () {
assert(
await DiffPage.isOlderPointerOn( 2 ),
'older pointer should be on previous revision'
);
assert(
await DiffPage.isNewerPointerOn( 3 ),
'newer pointer should be on current revision'
);
await DiffPage.dragOlderPointerTo( 1 );
await DiffPage.waitUntilLoaded();
await DiffPage.dragNewerPointerTo( 2 );
await DiffPage.waitUntilLoaded();
assert(
await DiffPage.isOlderPointerOn( 1 ),
'older pointer should be on revision 1'
);
assert(
await DiffPage.isNewerPointerOn( 2 ),
'newer pointer should be on revision 2'
);
assert(
await DiffPage.showsOlderSummary( 1 ),
'revision 1 should be loaded on the left of the diff'
);
assert(
await DiffPage.showsNewerSummary( 2 ),
'revision 2 should be loaded on the right of the diff'
);
} );
} );