2020-06-22 21:49:14 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-01-21 17:11:13 +00:00
|
|
|
const assert = require( 'assert' ),
|
2020-11-18 13:09:36 +00:00
|
|
|
page = require( '../pageobjects/popups.page' ),
|
|
|
|
UserLoginPage = require( 'wdio-mediawiki/LoginPage' );
|
2019-01-21 17:11:13 +00:00
|
|
|
|
2019-01-29 16:23:51 +00:00
|
|
|
describe( 'Dwelling on a valid reference link', function () {
|
|
|
|
before( function () {
|
2023-06-29 09:11:47 +00:00
|
|
|
page.setupReferencePreviews();
|
2020-11-18 13:09:36 +00:00
|
|
|
// TODO Remove or adjust when not in Beta any more
|
|
|
|
UserLoginPage.loginAdmin();
|
|
|
|
page.shouldUseReferencePopupsBetaFeature( true );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
|
|
|
|
2019-04-02 10:41:22 +00:00
|
|
|
beforeEach( function () {
|
2023-06-29 09:11:47 +00:00
|
|
|
page.openReferencePopupsTest();
|
2019-04-02 10:41:22 +00:00
|
|
|
page.ready();
|
|
|
|
} );
|
|
|
|
|
2019-01-21 17:11:13 +00:00
|
|
|
it( 'I should see a reference preview', function () {
|
|
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
|
|
this.skip();
|
|
|
|
}
|
2019-03-21 10:59:22 +00:00
|
|
|
page.dwellReferenceLink( 1 );
|
2019-01-21 17:11:13 +00:00
|
|
|
assert( page.seeReferencePreview(), 'Reference preview is shown.' );
|
2019-03-21 10:59:22 +00:00
|
|
|
assert( !page.seeScrollableReferencePreview(), 'Reference preview is not scrollable.' );
|
|
|
|
assert( !page.seeFadeoutOnReferenceText(), 'Reference preview has no fading effect' );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'Abandoning link hides reference preview', function () {
|
|
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
|
|
this.skip();
|
|
|
|
}
|
2019-03-21 10:59:22 +00:00
|
|
|
page.dwellReferenceLink( 1 );
|
2019-01-21 17:11:13 +00:00
|
|
|
page.abandonLink();
|
|
|
|
assert( page.doNotSeeReferencePreview(), 'Reference preview is kept hidden.' );
|
|
|
|
} );
|
2019-03-21 10:59:22 +00:00
|
|
|
|
2023-07-12 22:36:25 +00:00
|
|
|
// Skipped due to T341763
|
|
|
|
it.skip( 'References with lots of text are scrollable and fades', function () {
|
2019-03-21 10:59:22 +00:00
|
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
|
|
this.skip();
|
|
|
|
}
|
|
|
|
page.dwellReferenceLink( 2 );
|
2020-11-18 13:09:36 +00:00
|
|
|
assert( page.seeScrollableReferencePreview(), 'Reference preview is scrollable' );
|
2019-03-21 10:59:22 +00:00
|
|
|
assert( page.seeFadeoutOnReferenceText(), 'Reference preview has a fading effect' );
|
|
|
|
} );
|
2019-03-22 17:36:34 +00:00
|
|
|
|
2023-07-14 16:57:28 +00:00
|
|
|
it.skip( 'Dwelling references links inside reference previews does not close the popup ', function () {
|
2019-03-22 17:36:34 +00:00
|
|
|
if ( !page.hasReferencePopupsEnabled() ) {
|
|
|
|
this.skip();
|
|
|
|
}
|
|
|
|
page.dwellReferenceLink( 3 );
|
|
|
|
page.dwellReferenceInceptionLink();
|
|
|
|
assert( page.seeReferenceInceptionPreview(), 'The reference preview is still showing.' );
|
|
|
|
} );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|