2020-11-06 11:03:23 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const assert = require( 'assert' ),
|
|
|
|
DiffPage = require( '../pageobjects/diff.page' );
|
|
|
|
|
2024-06-08 04:13:35 +00:00
|
|
|
describe( 'RevisionSlider pointers', () => {
|
2020-11-06 11:03:23 +00:00
|
|
|
|
2024-06-08 04:13:35 +00:00
|
|
|
before( async () => {
|
2023-03-29 20:23:48 +00:00
|
|
|
await DiffPage.prepareSimpleTests( 3 );
|
2020-11-06 11:03:23 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-08 04:13:35 +00:00
|
|
|
beforeEach( async () => {
|
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
|
|
|
} );
|
|
|
|
|
2024-06-08 04:13:35 +00:00
|
|
|
afterEach( async () => {
|
2023-03-29 20:23:48 +00:00
|
|
|
await browser.refresh();
|
2020-11-06 11:03:23 +00:00
|
|
|
} );
|
|
|
|
|
2024-06-08 04:13:35 +00:00
|
|
|
it( ' can be dragged', async () => {
|
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
|
|
|
);
|
|
|
|
} );
|
|
|
|
} );
|