mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-24 12:43:32 +00:00
5a8f3bce94
The numbering in the content of the test revisions was slightly changed to fit the data-pos attribute numbering in the revision tags. Note that this is not completely cleaning up the step_definitions from the Ruby tests. This will be done in a follow up after all tests are ported. Bug: T267201 Change-Id: Ifa25b881c6aa1e94a934532606c944a33f5648dd
84 lines
1.9 KiB
JavaScript
84 lines
1.9 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require( 'assert' ),
|
|
DiffPage = require( '../pageobjects/diff.page' );
|
|
|
|
describe( 'RevisionSlider expand', function () {
|
|
|
|
before( function () {
|
|
DiffPage.prepareSimpleTests( 2 );
|
|
} );
|
|
|
|
beforeEach( function () {
|
|
DiffPage.ready();
|
|
} );
|
|
|
|
afterEach( function () {
|
|
DiffPage.resetAutoExpand();
|
|
browser.refresh();
|
|
} );
|
|
|
|
it( ' does not automatically expand by default', function () {
|
|
assert(
|
|
DiffPage.rsToggleButton.isDisplayed(),
|
|
'there should be a RevisionSlider expand button'
|
|
);
|
|
assert(
|
|
!DiffPage.rsMain.isDisplayed(),
|
|
'the RevisionSlider wrapper should be hidden'
|
|
);
|
|
} );
|
|
|
|
it( ' expands automatically when auto expand is on', function () {
|
|
DiffPage.openSlider();
|
|
DiffPage.rsAutoExpandButton.click();
|
|
|
|
browser.refresh();
|
|
DiffPage.ready();
|
|
|
|
DiffPage.rsMain.waitForDisplayed( { timeout: 10000 } );
|
|
|
|
assert(
|
|
DiffPage.rsAutoExpandButton.getAttribute( 'class' )
|
|
.indexOf( 'oo-ui-toggleWidget-on' ) !== -1,
|
|
'the auto expand button should be on'
|
|
);
|
|
assert(
|
|
DiffPage.rsMain.isDisplayed(),
|
|
'the RevisionSlider wrapper should be visible'
|
|
);
|
|
} );
|
|
|
|
it( ' does not expand automatically when auto expand is off', function () {
|
|
DiffPage.openSlider();
|
|
DiffPage.rsAutoExpandButton.click();
|
|
DiffPage.rsAutoExpandButton.click();
|
|
|
|
browser.refresh();
|
|
DiffPage.ready();
|
|
|
|
// this includes clicking the toggle button
|
|
// an auto-expanded slider would be closed then
|
|
DiffPage.openSlider();
|
|
assert(
|
|
DiffPage.rsMain.isDisplayed(),
|
|
'the RevisionSlider wrapper should be visible'
|
|
);
|
|
assert(
|
|
DiffPage.rsAutoExpandButton.getAttribute( 'class' )
|
|
.indexOf( 'oo-ui-toggleWidget-on' ) === -1,
|
|
'the auto expand button should be off'
|
|
);
|
|
} );
|
|
|
|
it( ' hides when collapsed manually', function () {
|
|
DiffPage.openSlider();
|
|
DiffPage.rsToggleButton.click();
|
|
|
|
assert(
|
|
!DiffPage.rsMain.isDisplayed(),
|
|
'the RevisionSlider wrapper should be hidden'
|
|
);
|
|
} );
|
|
} );
|