2020-11-06 11:03:23 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const assert = require( 'assert' ),
|
|
|
|
DiffPage = require( '../pageobjects/diff.page' );
|
|
|
|
|
|
|
|
describe( 'RevisionSlider pointers', function () {
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
before( async function () {
|
|
|
|
await DiffPage.prepareSimpleTests( 3 );
|
2020-11-06 11:03:23 +00:00
|
|
|
} );
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
beforeEach( async function () {
|
2020-11-06 11:03:23 +00:00
|
|
|
DiffPage.ready();
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.openSlider();
|
2020-11-06 11:03:23 +00:00
|
|
|
} );
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
afterEach( async function () {
|
|
|
|
await browser.refresh();
|
2020-11-06 11:03:23 +00:00
|
|
|
} );
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
it( ' can be dragged', async function () {
|
2020-11-06 11:03:23 +00:00
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isOlderPointerOn( 2 ),
|
2020-11-06 11:03:23 +00:00
|
|
|
'older pointer should be on previous revision'
|
|
|
|
);
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isNewerPointerOn( 3 ),
|
2020-11-06 11:03:23 +00:00
|
|
|
'newer pointer should be on current revision'
|
|
|
|
);
|
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.dragOlderPointerTo( 1 );
|
|
|
|
await DiffPage.waitUntilLoaded();
|
2020-11-06 11:03:23 +00:00
|
|
|
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.dragNewerPointerTo( 2 );
|
|
|
|
await DiffPage.waitUntilLoaded();
|
2020-11-06 11:03:23 +00:00
|
|
|
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isOlderPointerOn( 1 ),
|
2020-11-09 12:48:16 +00:00
|
|
|
'older pointer should be on revision 1'
|
2020-11-06 11:03:23 +00:00
|
|
|
);
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.isNewerPointerOn( 2 ),
|
2020-11-09 12:48:16 +00:00
|
|
|
'newer pointer should be on revision 2'
|
2020-11-06 11:03:23 +00:00
|
|
|
);
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.showsOlderSummary( 1 ),
|
2020-11-09 12:48:16 +00:00
|
|
|
'revision 1 should be loaded on the left of the diff'
|
2020-11-06 11:03:23 +00:00
|
|
|
);
|
|
|
|
assert(
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.showsNewerSummary( 2 ),
|
2020-11-09 12:48:16 +00:00
|
|
|
'revision 2 should be loaded on the right of the diff'
|
2020-11-06 11:03:23 +00:00
|
|
|
);
|
|
|
|
} );
|
|
|
|
} );
|