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 () {
|
2023-07-18 07:34:47 +00:00
|
|
|
before( async function () {
|
|
|
|
await page.setupReferencePreviews();
|
2020-11-18 13:09:36 +00:00
|
|
|
// TODO Remove or adjust when not in Beta any more
|
2023-07-18 07:34:47 +00:00
|
|
|
await UserLoginPage.loginAdmin();
|
|
|
|
await page.shouldUseReferencePopupsBetaFeature();
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
beforeEach( async function () {
|
|
|
|
await page.openReferencePopupsTest();
|
|
|
|
await page.ready();
|
2019-04-02 10:41:22 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it( 'I should see a reference preview', async function () {
|
|
|
|
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
2019-01-21 17:11:13 +00:00
|
|
|
this.skip();
|
|
|
|
}
|
2023-07-18 07:34:47 +00:00
|
|
|
await page.dwellReferenceLink( 1 );
|
|
|
|
assert( await page.seeReferencePreview(), 'Reference preview is shown.' );
|
|
|
|
assert( !( await page.seeScrollableReferencePreview() ), 'Reference preview is not scrollable.' );
|
|
|
|
assert( !( await page.seeFadeoutOnReferenceText() ), 'Reference preview has no fading effect' );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it( 'Abandoning link hides reference preview', async function () {
|
|
|
|
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
2019-01-21 17:11:13 +00:00
|
|
|
this.skip();
|
|
|
|
}
|
2023-07-18 07:34:47 +00:00
|
|
|
await page.dwellReferenceLink( 1 );
|
|
|
|
await page.abandonLink();
|
|
|
|
assert( await page.doNotSeeReferencePreview(), 'Reference preview is kept hidden.' );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
2019-03-21 10:59:22 +00:00
|
|
|
|
2023-07-12 22:36:25 +00:00
|
|
|
// Skipped due to T341763
|
2023-07-18 07:34:47 +00:00
|
|
|
it.skip( 'References with lots of text are scrollable and fades', async function () {
|
|
|
|
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
2019-03-21 10:59:22 +00:00
|
|
|
this.skip();
|
|
|
|
}
|
2023-07-18 07:34:47 +00:00
|
|
|
await page.dwellReferenceLink( 2 );
|
|
|
|
assert( await page.seeScrollableReferencePreview(), 'Reference preview is scrollable' );
|
|
|
|
assert( await page.seeFadeoutOnReferenceText(), 'Reference preview has a fading effect' );
|
2019-03-21 10:59:22 +00:00
|
|
|
} );
|
2019-03-22 17:36:34 +00:00
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it.skip( 'Dwelling references links inside reference previews does not close the popup ', async function () {
|
|
|
|
if ( !( await page.hasReferencePopupsEnabled() ) ) {
|
2019-03-22 17:36:34 +00:00
|
|
|
this.skip();
|
|
|
|
}
|
2023-07-18 07:34:47 +00:00
|
|
|
await page.dwellReferenceLink( 3 );
|
|
|
|
await page.dwellReferenceInceptionLink();
|
|
|
|
assert( await page.seeReferenceInceptionPreview(), 'The reference preview is still showing.' );
|
2019-03-22 17:36:34 +00:00
|
|
|
} );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|