mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-14 08:01:31 +00:00
54 lines
1.1 KiB
JavaScript
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'
|
||
|
);
|
||
|
} );
|
||
|
} );
|