mediawiki-extensions-Popups/tests/selenium/specs/page_previews.js
WMDE-Fisch 606475f80e selenium: run tests concurrently
Includes a bit untangling of the reference and page previews tests
and simplifies the setup.

Bug: T337862
Change-Id: Ia92cccb90fd79d10c5b33744520cb963a65db046
2023-06-30 08:52:47 +02:00

39 lines
1 KiB
JavaScript

'use strict';
const assert = require( 'assert' ),
page = require( '../pageobjects/popups.page' );
describe( 'Dwelling on a valid page link', function () {
before( function () {
page.setupPagePreviews();
} );
beforeEach( function () {
page.openPagePopupsTest();
page.ready();
} );
it( 'I should see a page preview', function () {
page.dwellPageLink();
assert( page.seePagePreview(), 'Page preview is shown.' );
} );
it( 'I should not see a page preview on hash fragment', function () {
page.dwellPageFragment();
assert( page.doNotSeePagePreview(), 'Page preview is not shown.' );
} );
it( 'Abandoning link hides page preview', function () {
page.dwellPageLink();
page.abandonLink();
assert( page.doNotSeePagePreview(), 'Page preview is kept hidden.' );
} );
it( 'Quickly hovering, abandoning and re-hovering a link shows page preview', function () {
page.hoverPageLink();
page.abandonLink();
page.dwellPageLink();
assert( page.seePagePreview(), 'Page preview is shown.' );
} );
} );