mediawiki-extensions-Revisi.../tests/selenium/specs/timeline.js
Adam Wight 40de993f4c selenium: Update wdio-mediawiki and fix window resizing
wdio-mediawiki v1.1.1:
- Includes wdio-defaults.conf.js file that vastly simplifies wdio.conf.js.
- Replaces @wdio/spec-reporter with @wdio/dot-reporter.
- Introduces video recording.

Some part of the new setup seems to influnce they way how resize is applied
to the window. The fix makes sure it works as expected.

Bug: T283597
Change-Id: I20697815591243367b5a8bdd1cd1cc173a1ddc77
2021-05-27 10:17:30 +02: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( 400, 600 );
DiffPage.prepareSimpleTests( 9 );
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'
);
} );
} );