-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathhomepage.spec.js
More file actions
34 lines (27 loc) · 1.19 KB
/
homepage.spec.js
File metadata and controls
34 lines (27 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (c) 2023, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
const {test, expect} = require('@playwright/test')
const config = require('../config')
const {answerConsentTrackingForm} = require('../scripts/pageHelpers.js')
test.describe('Retail app home page loads', () => {
test.beforeEach(async ({page}) => {
await page.goto(config.RETAIL_APP_HOME)
await answerConsentTrackingForm(page)
})
test('has title', async ({page}) => {
await expect(page).toHaveTitle(/Home Page/)
})
test('get started link', async ({page}) => {
const getStartedLink = page.getByRole('link', {name: 'Get started'})
await expect(getStartedLink).toBeVisible()
const popupPromise = page.waitForEvent('popup', { timeout: 30000 })
await getStartedLink.click()
const getStartedPage = await popupPromise
await expect(getStartedPage).toHaveURL(/.*getting-started/, { timeout: 15000 })
await expect(getStartedPage.getByRole('heading').first()).toBeVisible({ timeout: 10000 })
})
})