mediawiki-extensions-Revisi.../tests/selenium/specs/timeline.js
WMDE-Fisch 8fe657e90e Fix test for scrolling over revisions
Due to some change in the test setup, possibly related to the new
Vector skin, the slider now has more space and the need to scroll
triggers at a later point.

Change-Id: I5411d5a31714761434135e65d916f57f1e437003
2023-05-22 13:13:06 +03:00

54 lines
1.2 KiB
JavaScript

'use strict';
const assert = require( 'assert' ),
DiffPage = require( '../pageobjects/diff.page' );
describe( 'RevisionSlider timeline arrows', function () {
afterEach( async function () {
await browser.refresh();
} );
it( ' should be disabled with 3 revisions', async function () {
await DiffPage.prepareSimpleTests( 3 );
DiffPage.ready();
await DiffPage.openSlider();
assert(
await DiffPage.isBackwardsArrowDisabled(),
'backwards arrow should be disabled'
);
assert(
await DiffPage.isForwardsArrowDisabled(),
'forwards arrow should be disabled'
);
} );
it( ' should be enabled with adequate revisions', async function () {
await browser.setWindowSize( 400, 600 );
await DiffPage.prepareSimpleTests( 20 );
DiffPage.ready();
await DiffPage.openSlider();
await DiffPage.backwardsArrow.click();
await DiffPage.waitForSliding();
assert(
!await DiffPage.isForwardsArrowDisabled(),
'forwards arrow should be enabled'
);
await DiffPage.forwardsArrow.click();
DiffPage.waitForSliding();
assert(
!await DiffPage.isBackwardsArrowDisabled(),
'backwards arrow should be enabled'
);
assert(
await DiffPage.isForwardsArrowDisabled(),
'forwards arrow should be disabled'
);
} );
} );