-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d5f41c
commit d81f9ed
Showing
4 changed files
with
137 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
modules/test/playwright/tests/osb-faro-web/utils/actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* SPDX-FileCopyrightText: (c) 2024 Liferay, Inc. https://liferay.com | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 | ||
*/ | ||
|
||
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, | ||
page, | ||
}: { | ||
baseUrl: string; | ||
name: string; | ||
page: Page; | ||
}) { | ||
const reviewTagA = await page.locator( | ||
`xpath=//a[contains(text(),"${name}")]` | ||
); | ||
|
||
const href = await reviewTagA.getAttribute('href'); | ||
|
||
console.log('href', href); | ||
|
||
await page.goto( | ||
href.replace('http://localhost:8080', baseUrl) | ||
); | ||
} |
50 changes: 50 additions & 0 deletions
50
modules/test/playwright/tests/osb-faro-web/utils/project.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* SPDX-FileCopyrightText: (c) 2024 Liferay, Inc. https://liferay.com | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 | ||
*/ | ||
|
||
import {Page, expect} from '@playwright/test'; | ||
|
||
import getRandomString from '../../../utils/getRandomString'; | ||
import { faroConfig } from '../faro.config'; | ||
|
||
|
||
export async function acceptsCookiesBanner(page: Page) { | ||
const cookiesBannerButton = page.getByRole('button', {name: 'Accept All'}); | ||
|
||
if (await cookiesBannerButton.isVisible()) { | ||
await cookiesBannerButton.click(); | ||
} | ||
} | ||
|
||
export async function createProject({ | ||
page, | ||
}: { | ||
page: Page; | ||
}) { | ||
await page.goto(faroConfig.environment.baseUrl); | ||
|
||
await page.getByRole('link', {name: 'Start Free Trial'}).click(); | ||
|
||
const workspaceName = 'Workspace ' + getRandomString(); | ||
|
||
await page.getByLabel('Workspace Name').fill(workspaceName); | ||
|
||
await page.getByRole('textbox').nth(4).fill('test@liferay.com'); | ||
|
||
await page.getByLabel('I Agree').check(); | ||
|
||
await page.getByRole('button', {name: 'Finish Setup'}).click(); | ||
|
||
await expect(page.getByText('Success:Success')).toBeVisible(); | ||
|
||
await page.waitForTimeout(1000); | ||
|
||
expect(page.getByText('Welcome to Analytics Cloud')).toBeVisible(); | ||
|
||
expect( | ||
page.getByText( | ||
'Just a few more steps to set up your workspace.' | ||
) | ||
).toBeVisible(); | ||
} |