2020-06-22 21:49:14 +00:00
|
|
|
'use strict';
|
|
|
|
|
2019-01-21 17:11:13 +00:00
|
|
|
const assert = require( 'assert' ),
|
|
|
|
page = require( '../pageobjects/popups.page' );
|
|
|
|
|
2019-01-29 16:23:51 +00:00
|
|
|
describe( 'Dwelling on a valid page link', function () {
|
2023-07-18 07:34:47 +00:00
|
|
|
before( async function () {
|
|
|
|
await page.setupPagePreviews();
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
beforeEach( async function () {
|
|
|
|
await page.openPagePopupsTest();
|
|
|
|
await page.ready();
|
2019-04-02 10:41:22 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it( 'I should see a page preview', async function () {
|
|
|
|
await page.dwellPageLink();
|
|
|
|
await assert( await page.seePagePreview(), 'Page preview is shown.' );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it( 'I should not see a page preview on hash fragment', async function () {
|
|
|
|
await page.dwellPageFragment();
|
|
|
|
assert( await page.doNotSeePagePreview(), 'Page preview is not shown.' );
|
2023-01-11 16:51:42 +00:00
|
|
|
} );
|
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it( 'Abandoning link hides page preview', async function () {
|
|
|
|
await page.dwellPageLink();
|
|
|
|
await page.abandonLink();
|
|
|
|
assert( await page.doNotSeePagePreview(), 'Page preview is kept hidden.' );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|
2019-04-02 11:04:27 +00:00
|
|
|
|
2023-07-18 07:34:47 +00:00
|
|
|
it( 'Quickly hovering, abandoning and re-hovering a link shows page preview', async function () {
|
|
|
|
await page.hoverPageLink();
|
|
|
|
await page.abandonLink();
|
|
|
|
await page.dwellPageLink();
|
|
|
|
assert( await page.seePagePreview(), 'Page preview is shown.' );
|
2019-04-02 11:04:27 +00:00
|
|
|
} );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|