forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
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
85fbecb
commit 38072c8
Showing
1 changed file
with
88 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ import {dataApiHelpersTest} from '../../fixtures/dataApiHelpersTest'; | |
import {featureFlagsTest} from '../../fixtures/featureFlagsTest'; | ||
import {loginAnalyticsCloudTest} from '../../fixtures/loginAnalyticsCloudTest'; | ||
import {loginTest} from '../../fixtures/loginTest'; | ||
import { faroConfig } from './faro.config'; | ||
import getRandomString from '../../utils/getRandomString'; | ||
import {faroConfig} from './faro.config'; | ||
|
||
export const test = mergeTests( | ||
apiHelpersTest, | ||
|
@@ -30,91 +30,113 @@ test( | |
}, | ||
|
||
async ({page}) => { | ||
await test.step('Create a new workspace', async () => { | ||
await page.goto(faroConfig.environment.baseUrl); | ||
await test.step('Create a new workspace', async () => { | ||
await page.goto(faroConfig.environment.baseUrl); | ||
|
||
await page.getByRole('link', { name: 'Start Free Trial' }).click(); | ||
await page.getByRole('link', {name: 'Start Free Trial'}).click(); | ||
|
||
const workspaceName = 'Workspace ' + getRandomString(); | ||
const workspaceName = 'Workspace ' + getRandomString(); | ||
|
||
await page.getByLabel('Workspace Name').fill(workspaceName); | ||
await page.getByLabel('Workspace Name').fill(workspaceName); | ||
|
||
await page.getByRole('textbox').nth(4).fill('[email protected]'); | ||
await page.getByRole('textbox').nth(4).fill('[email protected]'); | ||
|
||
await page.getByLabel('I Agree').check(); | ||
await page.getByLabel('I Agree').check(); | ||
|
||
await page.getByRole('button', { name: 'Finish Setup' }).click(); | ||
await page.getByRole('button', {name: 'Finish Setup'}).click(); | ||
|
||
await expect(page.getByText('Success:Success')).toBeVisible(); | ||
}); | ||
await expect(page.getByText('Success:Success')).toBeVisible(); | ||
}); | ||
|
||
await test.step('Check the first screen of the onboarding modal', async () => { | ||
await page.waitForTimeout(1000); | ||
await test.step('Check the first screen of the onboarding modal', async () => { | ||
await page.waitForTimeout(1000); | ||
|
||
expect(page.getByText('Welcome to Analytics Cloud')).toBeVisible(); | ||
expect(page.getByText('Welcome to Analytics Cloud')).toBeVisible(); | ||
|
||
expect(page.getByText('Just a few more steps to set up your workspace.')).toBeVisible(); | ||
}); | ||
|
||
await test.step('Navigate to next page', async () => { | ||
await page.getByRole('button', { name: 'Next' }).click(); | ||
}); | ||
|
||
await test.step('Check the onboarding connection modal information', async () => { | ||
expect(page.getByText('Connect Your DXP Analytics')).toBeVisible(); | ||
expect(page.getByText('Copy this token to your DXP instance.')).toBeVisible(); | ||
expect(page | ||
.locator('.modal-container') | ||
.getByText('DXP Requirements')).toBeVisible(); | ||
expect( | ||
page.getByText( | ||
'Just a few more steps to set up your workspace.' | ||
) | ||
).toBeVisible(); | ||
}); | ||
|
||
await page.getByRole('combobox').click(); | ||
await test.step('Navigate to next page', async () => { | ||
await page.getByRole('button', {name: 'Next'}).click(); | ||
}); | ||
|
||
expect(page.getByRole('option', {name: 'DXP 2024.Q1.1 Quarterly Release'})).toBeHidden(); | ||
expect(page.getByRole('option', {name: 'DXP Version 7.3 U30 + and above with hotfix'})).toBeHidden(); | ||
expect(page.getByRole('link', {name: 'Download'})).toBeVisible(); | ||
}); | ||
await test.step('Check the onboarding connection modal information', async () => { | ||
expect(page.getByText('Connect Your DXP Analytics')).toBeVisible(); | ||
expect( | ||
page.getByText('Copy this token to your DXP instance.') | ||
).toBeVisible(); | ||
expect( | ||
page.locator('.modal-container').getByText('DXP Requirements') | ||
).toBeVisible(); | ||
|
||
await test.step('Click on "click here" and check if a new tab with connection documentation appears', async () => { | ||
await page | ||
.getByRole('link', {name: 'Click here'}) | ||
.click(); | ||
await page.getByRole('combobox').click(); | ||
|
||
expect( | ||
page.getByRole('option', { | ||
name: 'DXP 2024.Q1.1 Quarterly Release', | ||
}) | ||
).toBeHidden(); | ||
expect( | ||
page.getByRole('option', { | ||
name: 'DXP Version 7.3 U30 + and above with hotfix', | ||
}) | ||
).toBeHidden(); | ||
expect(page.getByRole('link', {name: 'Download'})).toBeVisible(); | ||
}); | ||
|
||
await test.step('Click on "click here" and check if a new tab with connection documentation appears', async () => { | ||
await page.getByRole('link', {name: 'Click here'}).click(); | ||
|
||
const newPage = await page.waitForEvent('popup'); | ||
|
||
const href = newPage.url(); | ||
|
||
await expect(href).toContain('learn.liferay.com'); | ||
await expect(href).toContain('/getting-started/connecting-liferay-dxp-to-analytics-cloud'); | ||
await expect(href).toContain( | ||
'/getting-started/connecting-liferay-dxp-to-analytics-cloud' | ||
); | ||
|
||
await newPage.close(); | ||
}); | ||
|
||
await test.step('Navigate to next page', async () => { | ||
await page.getByRole('link', { name: 'Next' }).click(); | ||
|
||
await page.getByRole('button', { name: 'Skip' }).click(); | ||
}); | ||
|
||
await test.step('Create a new data source', async () => { | ||
await page | ||
.getByRole('link', {name: 'Add Data Source'}) | ||
.click(); | ||
|
||
await page.getByRole('button', {name: 'Liferay DXP'}).click(); | ||
}); | ||
|
||
await test.step('Check the data source connection modal information', async () => { | ||
expect(page.getByText('Connect Your DXP Analytics')).toBeVisible(); | ||
expect(page.getByText('Copy this token to your DXP instance.')).toBeVisible(); | ||
expect(page | ||
.locator('.modal-container') | ||
.getByText('DXP Requirements')).toBeVisible(); | ||
|
||
await page.getByRole('combobox').click(); | ||
|
||
expect(page.getByRole('option', {name: 'DXP 2024.Q1.1 Quarterly Release'})).toBeHidden(); | ||
expect(page.getByRole('option', {name: 'DXP Version 7.3 U30 + and above with hotfix'})).toBeHidden(); | ||
expect(page.getByRole('link', {name: 'Download'})).toBeVisible(); | ||
}); | ||
}); | ||
|
||
await test.step('Navigate to next page', async () => { | ||
await page.getByRole('link', {name: 'Next'}).click(); | ||
|
||
await page.getByRole('button', {name: 'Skip'}).click(); | ||
}); | ||
|
||
await test.step('Create a new data source', async () => { | ||
await page.getByRole('link', {name: 'Add Data Source'}).click(); | ||
|
||
await page.getByRole('button', {name: 'Liferay DXP'}).click(); | ||
}); | ||
|
||
await test.step('Check the data source connection modal information', async () => { | ||
expect(page.getByText('Connect Your DXP Analytics')).toBeVisible(); | ||
expect( | ||
page.getByText('Copy this token to your DXP instance.') | ||
).toBeVisible(); | ||
expect( | ||
page.locator('.modal-container').getByText('DXP Requirements') | ||
).toBeVisible(); | ||
|
||
await page.getByRole('combobox').click(); | ||
|
||
expect( | ||
page.getByRole('option', { | ||
name: 'DXP 2024.Q1.1 Quarterly Release', | ||
}) | ||
).toBeHidden(); | ||
expect( | ||
page.getByRole('option', { | ||
name: 'DXP Version 7.3 U30 + and above with hotfix', | ||
}) | ||
).toBeHidden(); | ||
expect(page.getByRole('link', {name: 'Download'})).toBeVisible(); | ||
}); | ||
} | ||
); |