mediawiki-extensions-Revisi.../tests/selenium/specs/timeline.js
Adam Wight 0c9ef9d88f Port timeline browser tests to js
`aria-disabled` is a bit of a hack, but maybe more robust than
coupling to the OOUI internal class name.

Bug: T267205
Change-Id: I5c1f547f2d25d9acaa74d63da03cd215be82bd71
2020-11-09 12:04:36 +01:00

54 lines
1.1 KiB
JavaScript

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