-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.yml
39 lines (39 loc) · 1.11 KB
/
home.yml
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
35
36
37
38
39
use:
baseURL: ${_env.BASE_ENDPOINT}
hook:
beforeEach:
- fixtures:
- page
raw: await page.goto("/")
scenarios:
- name: Validate Homepage
fixtures:
- page
steps:
- description: Check product list is shown
arrange:
- expectToBeVisible: "[data-cy=home-page]"
assert:
- expectToHaveCount:
selector: "[data-cy=product-list] [data-cy=product-card]"
count: 10
- description: Check session is set
variable:
session: ${await getSession(page)}
assert:
- expectToContainText:
selector: "[data-cy=session-id]"
expected: ${session.userId}
- name: Homepage can change currency
fixtures:
- page
steps:
- description: Change currency to EUR
arrange:
- expectToBeVisible: "[data-cy=home-page]"
act:
raw: await page.locator("[data-cy=currency-switcher]").selectOption("EUR");
assert:
- expectToContainText:
selector: "[data-cy=product-card]:first-child"
expected: "€"