mediawiki-extensions-Popups/tests/selenium/specs/reference_previews.js
WMDE-Fisch c2413c858b selenium: Refactor WebdriverIO tests from sync to async mode
I also removed the bool on the shouldUseReferencePopupsBetaFeature
method. It was always just used with `true`

Bug: T293072
Change-Id: I1a2d6f912fcac2ac77539581897e0feab489edf0
2023-07-18 09:34:47 +02:00

58 lines
2 KiB
JavaScript

'use strict';
const assert = require( 'assert' ),
page = require( '../pageobjects/popups.page' ),
UserLoginPage = require( 'wdio-mediawiki/LoginPage' );
describe( 'Dwelling on a valid reference link', function () {
before( async function () {
await page.setupReferencePreviews();
// TODO Remove or adjust when not in Beta any more
await UserLoginPage.loginAdmin();
await page.shouldUseReferencePopupsBetaFeature();
} );
beforeEach( async function () {
await page.openReferencePopupsTest();
await page.ready();
} );
it( 'I should see a reference preview', async function () {
if ( !( await page.hasReferencePopupsEnabled() ) ) {
this.skip();
}
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' );
} );
it( 'Abandoning link hides reference preview', async function () {
if ( !( await page.hasReferencePopupsEnabled() ) ) {
this.skip();
}
await page.dwellReferenceLink( 1 );
await page.abandonLink();
assert( await page.doNotSeeReferencePreview(), 'Reference preview is kept hidden.' );
} );
// Skipped due to T341763
it.skip( 'References with lots of text are scrollable and fades', async function () {
if ( !( await page.hasReferencePopupsEnabled() ) ) {
this.skip();
}
await page.dwellReferenceLink( 2 );
assert( await page.seeScrollableReferencePreview(), 'Reference preview is scrollable' );
assert( await page.seeFadeoutOnReferenceText(), 'Reference preview has a fading effect' );
} );
it.skip( 'Dwelling references links inside reference previews does not close the popup ', async function () {
if ( !( await page.hasReferencePopupsEnabled() ) ) {
this.skip();
}
await page.dwellReferenceLink( 3 );
await page.dwellReferenceInceptionLink();
assert( await page.seeReferenceInceptionPreview(), 'The reference preview is still showing.' );
} );
} );