2020-11-06 11:49:07 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const assert = require( 'assert' ),
|
|
|
|
DiffPage = require( '../pageobjects/diff.page' );
|
|
|
|
|
|
|
|
describe( 'RevisionSlider timeline arrows', function () {
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
afterEach( async function () {
|
|
|
|
await browser.refresh();
|
2020-11-06 11:49:07 +00:00
|
|
|
} );
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
it( ' should be disabled with 3 revisions', async function () {
|
|
|
|
await DiffPage.prepareSimpleTests( 3 );
|
2020-11-06 11:49:07 +00:00
|
|
|
DiffPage.ready();
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.openSlider();
|
2020-11-06 11:49:07 +00:00
|
|
|
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isBackwardsArrowDisabled(),
|
2020-11-06 11:49:07 +00:00
|
|
|
'backwards arrow should be disabled'
|
|
|
|
);
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isForwardsArrowDisabled(),
|
2020-11-06 11:49:07 +00:00
|
|
|
'forwards arrow should be disabled'
|
|
|
|
);
|
|
|
|
} );
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
it( ' should be enabled with adequate revisions', async function () {
|
|
|
|
await browser.setWindowSize( 400, 600 );
|
2023-05-22 09:57:04 +00:00
|
|
|
await DiffPage.prepareSimpleTests( 20 );
|
2020-11-06 11:49:07 +00:00
|
|
|
DiffPage.ready();
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.openSlider();
|
2020-11-06 11:49:07 +00:00
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.backwardsArrow.click();
|
|
|
|
await DiffPage.waitForSliding();
|
2020-11-06 11:49:07 +00:00
|
|
|
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
!await DiffPage.isForwardsArrowDisabled(),
|
2020-11-06 11:49:07 +00:00
|
|
|
'forwards arrow should be enabled'
|
|
|
|
);
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.forwardsArrow.click();
|
2020-11-06 11:49:07 +00:00
|
|
|
DiffPage.waitForSliding();
|
|
|
|
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
!await DiffPage.isBackwardsArrowDisabled(),
|
2020-11-06 11:49:07 +00:00
|
|
|
'backwards arrow should be enabled'
|
|
|
|
);
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isForwardsArrowDisabled(),
|
2020-11-06 11:49:07 +00:00
|
|
|
'forwards arrow should be disabled'
|
|
|
|
);
|
|
|
|
} );
|
|
|
|
} );
|