2020-06-22 21:49:14 +00:00
|
|
|
'use strict';
|
|
|
|
|
2024-11-21 13:41:05 +00:00
|
|
|
const page = require( '../pageobjects/popups.page' );
|
2019-01-21 17:11:13 +00:00
|
|
|
|
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();
|
2024-11-21 13:41:05 +00:00
|
|
|
await expect( await page.pagePopupsSelector ).toBeDisplayed( { message: '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();
|
2024-11-21 13:41:05 +00:00
|
|
|
await expect( await page.pagePopupsSelector ).not.toBeDisplayed( { message: '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();
|
2024-11-21 13:41:05 +00:00
|
|
|
await expect( await page.pagePopupsSelector ).not.toBeDisplayed( { message: '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();
|
2024-11-21 13:41:05 +00:00
|
|
|
await expect( await page.pagePopupsSelector ).toBeDisplayed( { message: 'Page preview is shown.' } );
|
2019-04-02 11:04:27 +00:00
|
|
|
} );
|
2019-01-21 17:11:13 +00:00
|
|
|
} );
|