diff --git a/modules/test/playwright/helpers/json-web-services/JSONWebServicesOSBFaroApiHelper.ts b/modules/test/playwright/helpers/json-web-services/JSONWebServicesOSBFaroApiHelper.ts index 04279615d2fa47..2c4ac4a2e63f53 100644 --- a/modules/test/playwright/helpers/json-web-services/JSONWebServicesOSBFaroApiHelper.ts +++ b/modules/test/playwright/helpers/json-web-services/JSONWebServicesOSBFaroApiHelper.ts @@ -116,6 +116,7 @@ export class JSONWebServicesOSBFaroApiHelper { method: 'DELETE', } ).then((response) => { - return response.json();}); + return response.json(); + }); } } diff --git a/modules/test/playwright/tests/osb-faro-web/emptyStateNotConnectedToDXP.spec.ts b/modules/test/playwright/tests/osb-faro-web/emptyStateNotConnectedToDXP.spec.ts index 336fd4e7a6e86d..c1c9d6a013881f 100644 --- a/modules/test/playwright/tests/osb-faro-web/emptyStateNotConnectedToDXP.spec.ts +++ b/modules/test/playwright/tests/osb-faro-web/emptyStateNotConnectedToDXP.spec.ts @@ -10,20 +10,10 @@ import {dataApiHelpersTest} from '../../fixtures/dataApiHelpersTest'; import {featureFlagsTest} from '../../fixtures/featureFlagsTest'; import {loginAnalyticsCloudTest} from '../../fixtures/loginAnalyticsCloudTest'; import {loginTest} from '../../fixtures/loginTest'; -import {liferayConfig} from '../../liferay.config'; import getRandomString from '../../utils/getRandomString'; -import {syncAnalyticsCloud} from '../analytics-settings-web/utils/analytics-settings'; -import { faroConfig } from './faro.config'; -import { clickOnLink } from './utils/actions'; -import {switchChannel} from './utils/channel'; -import { - ACPage, - navigateTo, - navigateToACPageViaURL, - navigateToACSettingsViaURL, - navigateToACWorkspace, -} from './utils/navigation'; -import {addBreakdownByIndividualAttribute} from './utils/utils'; +import {faroConfig} from './faro.config'; +import {clickOnLink} from './utils/actions'; +import {ACPage, navigateToACSettingsViaURL} from './utils/navigation'; export const test = mergeTests( apiHelpersTest, @@ -40,7 +30,9 @@ let project; const randomString = getRandomString(); test.beforeEach(async ({apiHelpers}) => { - project = await apiHelpers.jsonWebServicesOSBFaro.createProject('My Project ' + randomString) + project = await apiHelpers.jsonWebServicesOSBFaro.createProject( + 'My Project ' + randomString + ); }); test.afterEach(async ({apiHelpers}) => { @@ -74,7 +66,7 @@ test( ).toBeVisible(); await clickOnLink({ - baseUrl:faroConfig.environment.baseUrl, + baseUrl: faroConfig.environment.baseUrl, name: 'Access our documentation to learn more.', page, }); @@ -105,7 +97,7 @@ test( ).toBeVisible(); await clickOnLink({ - baseUrl:faroConfig.environment.baseUrl, + baseUrl: faroConfig.environment.baseUrl, name: 'Access our documentation to learn more.', page, }); @@ -145,25 +137,19 @@ test( projectID: project.groupId, }); - //await clickOnLink({baseUrl:faroConfig.environment.baseUrl, name: 'canonicalUrl', page}); - const tableBodyElement = await page.locator('table tbody'); - await expect( - tableBodyElement - ).toBeVisible(); + await expect(tableBodyElement).toBeVisible(); - const elements = await tableBodyElement.locator('td .table-title a').all(); + const elements = await tableBodyElement + .locator('td .table-title a') + .all(); const href = await elements[0].getAttribute('href'); await page.goto(`${faroConfig.environment.baseUrl}${href}`); - await expect( - page.getByText( - 'No Sample Data Found' - ) - ).toBeVisible(); + await expect(page.getByText('No Sample Data Found')).toBeVisible(); await expect( page.getByText( 'You can come back later and check if there is any data received from your events.Learn more about event tracking' @@ -174,13 +160,13 @@ test( ).toBeVisible(); await clickOnLink({ - baseUrl:faroConfig.environment.baseUrl, + baseUrl: faroConfig.environment.baseUrl, name: 'Learn more about event tracking.', page, }); await expect(page).toHaveTitle('Definitions - Liferay Learn'); - + const header = await page.locator('h2#event-attributes'); await expect(header.getByText('Event Attributes')).toBeVisible(); @@ -204,7 +190,7 @@ test( ).toBeVisible(); await clickOnLink({ - baseUrl:faroConfig.environment.baseUrl, + baseUrl: faroConfig.environment.baseUrl, name: 'Learn how to add custom events on your site.', page, }); @@ -232,7 +218,7 @@ test( ).toBeVisible(); await clickOnLink({ - baseUrl:faroConfig.environment.baseUrl, + baseUrl: faroConfig.environment.baseUrl, name: 'Access our documentation to learn how to manage custom events.', page, }); @@ -276,7 +262,7 @@ test( ).toBeVisible(); await clickOnLink({ - baseUrl:faroConfig.environment.baseUrl, + baseUrl: faroConfig.environment.baseUrl, name: 'Access our documentation to learn more.', page, }); @@ -288,8 +274,7 @@ test( const element = await page.locator('a#data-control-and-privacy'); await expect( - element - .getByText('Data Control and Privacy') + element.getByText('Data Control and Privacy') ).toBeVisible(); }); } diff --git a/modules/test/playwright/tests/osb-faro-web/utils/ab-test.ts b/modules/test/playwright/tests/osb-faro-web/utils/ab-test.ts index ba03d30be71a46..6133d65a44725e 100644 --- a/modules/test/playwright/tests/osb-faro-web/utils/ab-test.ts +++ b/modules/test/playwright/tests/osb-faro-web/utils/ab-test.ts @@ -6,7 +6,7 @@ import {Page, expect} from '@playwright/test'; import {liferayConfig} from '../../../liferay.config'; -import { clickOnLink } from './actions'; +import {clickOnLink} from './actions'; export async function checkEmptyStateOnACSide(page: Page) { await expect(page.getByText('There are no tests found.')).toBeVisible(); diff --git a/modules/test/playwright/tests/osb-faro-web/utils/actions.ts b/modules/test/playwright/tests/osb-faro-web/utils/actions.ts index 48a6306f72b847..d028c0e91315c6 100644 --- a/modules/test/playwright/tests/osb-faro-web/utils/actions.ts +++ b/modules/test/playwright/tests/osb-faro-web/utils/actions.ts @@ -5,18 +5,16 @@ import {Page, expect} from '@playwright/test'; -import {liferayConfig} from '../../../liferay.config'; - export async function checkEmptyStateOnACSide(page: Page) { await expect(page.getByText('There are no tests found.')).toBeVisible(); } export async function clickOnLink({ baseUrl, - name, + name, page, }: { - baseUrl: string; + baseUrl: string; name: string; page: Page; }) { @@ -26,9 +24,5 @@ export async function clickOnLink({ const href = await reviewTagA.getAttribute('href'); - console.log('href', href); - - await page.goto( - href.replace('http://localhost:8080', baseUrl) - ); + await page.goto(href.replace('http://localhost:8080', baseUrl)); } diff --git a/modules/test/playwright/tests/osb-faro-web/utils/project.ts b/modules/test/playwright/tests/osb-faro-web/utils/project.ts index f8e3d5c5cdcbf9..9d58e9786424f3 100644 --- a/modules/test/playwright/tests/osb-faro-web/utils/project.ts +++ b/modules/test/playwright/tests/osb-faro-web/utils/project.ts @@ -6,8 +6,7 @@ import {Page, expect} from '@playwright/test'; import getRandomString from '../../../utils/getRandomString'; -import { faroConfig } from '../faro.config'; - +import {faroConfig} from '../faro.config'; export async function acceptsCookiesBanner(page: Page) { const cookiesBannerButton = page.getByRole('button', {name: 'Accept All'}); @@ -17,11 +16,7 @@ export async function acceptsCookiesBanner(page: Page) { } } -export async function createProject({ - page, -}: { - page: Page; -}) { +export async function createProject({page}: {page: Page}) { await page.goto(faroConfig.environment.baseUrl); await page.getByRole('link', {name: 'Start Free Trial'}).click(); @@ -43,8 +38,6 @@ export async function createProject({ expect(page.getByText('Welcome to Analytics Cloud')).toBeVisible(); expect( - page.getByText( - 'Just a few more steps to set up your workspace.' - ) + page.getByText('Just a few more steps to set up your workspace.') ).toBeVisible(); }