mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-18 10:10:48 +00:00
b3a58a6dd3
- test page loading and waiting for the scripts moved to beforeEach - removed unnecessary abondonLink call - removed unnecessary browser.pause() Change-Id: I28eb7b9b48f105315bf41f7a41e5a1e6ec21cb2b
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
const assert = require( 'assert' ),
|
|
page = require( '../pageobjects/popups.page' );
|
|
|
|
describe( 'Dwelling on a valid reference link', function () {
|
|
before( function () {
|
|
page.setup();
|
|
} );
|
|
|
|
beforeEach( function () {
|
|
page.open();
|
|
page.ready();
|
|
} );
|
|
|
|
it( 'I should see a reference preview', function () {
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
this.skip();
|
|
}
|
|
page.dwellReferenceLink( 1 );
|
|
assert( page.seeReferencePreview(), 'Reference preview is shown.' );
|
|
assert( !page.seeScrollableReferencePreview(), 'Reference preview is not scrollable.' );
|
|
assert( !page.seeFadeoutOnReferenceText(), 'Reference preview has no fading effect' );
|
|
} );
|
|
|
|
it( 'Abandoning link hides reference preview', function () {
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
this.skip();
|
|
}
|
|
page.dwellReferenceLink( 1 );
|
|
page.abandonLink();
|
|
assert( page.doNotSeeReferencePreview(), 'Reference preview is kept hidden.' );
|
|
} );
|
|
|
|
it( 'References with lots of text are scrollable and fades', function () {
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
this.skip();
|
|
}
|
|
page.dwellReferenceLink( 2 );
|
|
assert( page.seeScrollableReferencePreview(), 'Reference preview has a fading effect' );
|
|
assert( page.seeFadeoutOnReferenceText(), 'Reference preview has a fading effect' );
|
|
} );
|
|
|
|
it( 'Dwelling references links inside reference previews does not close the popup ', function () {
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
this.skip();
|
|
}
|
|
page.dwellReferenceLink( 3 );
|
|
page.dwellReferenceInceptionLink();
|
|
assert( page.seeReferenceInceptionPreview(), 'The reference preview is still showing.' );
|
|
} );
|
|
} );
|