Skip to content

Commit 381187e

Browse files
marcosapmfbrianchandotcom
authored andcommitted
LPD-41705 SF
1 parent d81f9ed commit 381187e

File tree

5 files changed

+28
-55
lines changed

5 files changed

+28
-55
lines changed

modules/test/playwright/helpers/json-web-services/JSONWebServicesOSBFaroApiHelper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export class JSONWebServicesOSBFaroApiHelper {
116116
method: 'DELETE',
117117
}
118118
).then((response) => {
119-
return response.json();});
119+
return response.json();
120+
});
120121
}
121122
}

modules/test/playwright/tests/osb-faro-web/emptyStateNotConnectedToDXP.spec.ts

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,10 @@ import {dataApiHelpersTest} from '../../fixtures/dataApiHelpersTest';
1010
import {featureFlagsTest} from '../../fixtures/featureFlagsTest';
1111
import {loginAnalyticsCloudTest} from '../../fixtures/loginAnalyticsCloudTest';
1212
import {loginTest} from '../../fixtures/loginTest';
13-
import {liferayConfig} from '../../liferay.config';
1413
import getRandomString from '../../utils/getRandomString';
15-
import {syncAnalyticsCloud} from '../analytics-settings-web/utils/analytics-settings';
16-
import { faroConfig } from './faro.config';
17-
import { clickOnLink } from './utils/actions';
18-
import {switchChannel} from './utils/channel';
19-
import {
20-
ACPage,
21-
navigateTo,
22-
navigateToACPageViaURL,
23-
navigateToACSettingsViaURL,
24-
navigateToACWorkspace,
25-
} from './utils/navigation';
26-
import {addBreakdownByIndividualAttribute} from './utils/utils';
14+
import {faroConfig} from './faro.config';
15+
import {clickOnLink} from './utils/actions';
16+
import {ACPage, navigateToACSettingsViaURL} from './utils/navigation';
2717

2818
export const test = mergeTests(
2919
apiHelpersTest,
@@ -40,7 +30,9 @@ let project;
4030
const randomString = getRandomString();
4131

4232
test.beforeEach(async ({apiHelpers}) => {
43-
project = await apiHelpers.jsonWebServicesOSBFaro.createProject('My Project ' + randomString)
33+
project = await apiHelpers.jsonWebServicesOSBFaro.createProject(
34+
'My Project ' + randomString
35+
);
4436
});
4537

4638
test.afterEach(async ({apiHelpers}) => {
@@ -74,7 +66,7 @@ test(
7466
).toBeVisible();
7567

7668
await clickOnLink({
77-
baseUrl:faroConfig.environment.baseUrl,
69+
baseUrl: faroConfig.environment.baseUrl,
7870
name: 'Access our documentation to learn more.',
7971
page,
8072
});
@@ -105,7 +97,7 @@ test(
10597
).toBeVisible();
10698

10799
await clickOnLink({
108-
baseUrl:faroConfig.environment.baseUrl,
100+
baseUrl: faroConfig.environment.baseUrl,
109101
name: 'Access our documentation to learn more.',
110102
page,
111103
});
@@ -145,25 +137,19 @@ test(
145137
projectID: project.groupId,
146138
});
147139

148-
//await clickOnLink({baseUrl:faroConfig.environment.baseUrl, name: 'canonicalUrl', page});
149-
150140
const tableBodyElement = await page.locator('table tbody');
151141

152-
await expect(
153-
tableBodyElement
154-
).toBeVisible();
142+
await expect(tableBodyElement).toBeVisible();
155143

156-
const elements = await tableBodyElement.locator('td .table-title a').all();
144+
const elements = await tableBodyElement
145+
.locator('td .table-title a')
146+
.all();
157147

158148
const href = await elements[0].getAttribute('href');
159149

160150
await page.goto(`${faroConfig.environment.baseUrl}${href}`);
161151

162-
await expect(
163-
page.getByText(
164-
'No Sample Data Found'
165-
)
166-
).toBeVisible();
152+
await expect(page.getByText('No Sample Data Found')).toBeVisible();
167153
await expect(
168154
page.getByText(
169155
'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(
174160
).toBeVisible();
175161

176162
await clickOnLink({
177-
baseUrl:faroConfig.environment.baseUrl,
163+
baseUrl: faroConfig.environment.baseUrl,
178164
name: 'Learn more about event tracking.',
179165
page,
180166
});
181167

182168
await expect(page).toHaveTitle('Definitions - Liferay Learn');
183-
169+
184170
const header = await page.locator('h2#event-attributes');
185171

186172
await expect(header.getByText('Event Attributes')).toBeVisible();
@@ -204,7 +190,7 @@ test(
204190
).toBeVisible();
205191

206192
await clickOnLink({
207-
baseUrl:faroConfig.environment.baseUrl,
193+
baseUrl: faroConfig.environment.baseUrl,
208194
name: 'Learn how to add custom events on your site.',
209195
page,
210196
});
@@ -232,7 +218,7 @@ test(
232218
).toBeVisible();
233219

234220
await clickOnLink({
235-
baseUrl:faroConfig.environment.baseUrl,
221+
baseUrl: faroConfig.environment.baseUrl,
236222
name: 'Access our documentation to learn how to manage custom events.',
237223
page,
238224
});
@@ -276,7 +262,7 @@ test(
276262
).toBeVisible();
277263

278264
await clickOnLink({
279-
baseUrl:faroConfig.environment.baseUrl,
265+
baseUrl: faroConfig.environment.baseUrl,
280266
name: 'Access our documentation to learn more.',
281267
page,
282268
});
@@ -288,8 +274,7 @@ test(
288274
const element = await page.locator('a#data-control-and-privacy');
289275

290276
await expect(
291-
element
292-
.getByText('Data Control and Privacy')
277+
element.getByText('Data Control and Privacy')
293278
).toBeVisible();
294279
});
295280
}

modules/test/playwright/tests/osb-faro-web/utils/ab-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import {Page, expect} from '@playwright/test';
77

88
import {liferayConfig} from '../../../liferay.config';
9-
import { clickOnLink } from './actions';
9+
import {clickOnLink} from './actions';
1010

1111
export async function checkEmptyStateOnACSide(page: Page) {
1212
await expect(page.getByText('There are no tests found.')).toBeVisible();

modules/test/playwright/tests/osb-faro-web/utils/actions.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,16 @@
55

66
import {Page, expect} from '@playwright/test';
77

8-
import {liferayConfig} from '../../../liferay.config';
9-
108
export async function checkEmptyStateOnACSide(page: Page) {
119
await expect(page.getByText('There are no tests found.')).toBeVisible();
1210
}
1311

1412
export async function clickOnLink({
1513
baseUrl,
16-
name,
14+
name,
1715
page,
1816
}: {
19-
baseUrl: string;
17+
baseUrl: string;
2018
name: string;
2119
page: Page;
2220
}) {
@@ -26,9 +24,5 @@ export async function clickOnLink({
2624

2725
const href = await reviewTagA.getAttribute('href');
2826

29-
console.log('href', href);
30-
31-
await page.goto(
32-
href.replace('http://localhost:8080', baseUrl)
33-
);
27+
await page.goto(href.replace('http://localhost:8080', baseUrl));
3428
}

modules/test/playwright/tests/osb-faro-web/utils/project.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
import {Page, expect} from '@playwright/test';
77

88
import getRandomString from '../../../utils/getRandomString';
9-
import { faroConfig } from '../faro.config';
10-
9+
import {faroConfig} from '../faro.config';
1110

1211
export async function acceptsCookiesBanner(page: Page) {
1312
const cookiesBannerButton = page.getByRole('button', {name: 'Accept All'});
@@ -17,11 +16,7 @@ export async function acceptsCookiesBanner(page: Page) {
1716
}
1817
}
1918

20-
export async function createProject({
21-
page,
22-
}: {
23-
page: Page;
24-
}) {
19+
export async function createProject({page}: {page: Page}) {
2520
await page.goto(faroConfig.environment.baseUrl);
2621

2722
await page.getByRole('link', {name: 'Start Free Trial'}).click();
@@ -43,8 +38,6 @@ export async function createProject({
4338
expect(page.getByText('Welcome to Analytics Cloud')).toBeVisible();
4439

4540
expect(
46-
page.getByText(
47-
'Just a few more steps to set up your workspace.'
48-
)
41+
page.getByText('Just a few more steps to set up your workspace.')
4942
).toBeVisible();
5043
}

0 commit comments

Comments
 (0)