-
Notifications
You must be signed in to change notification settings - Fork 4
/
home.po.ts
56 lines (46 loc) · 1.43 KB
/
home.po.ts
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { BasePO } from 'cucumber-testcafe'
import { testController } from 'cucumber-testcafe/dist/lib/world'
export default class HomePO extends BasePO {
static pageName = 'home'
async assertCookies() {
const cookies = await this.select('.thor-cookies-popup__button')
if (cookies.exists) {
await testController.click(cookies)
}
return Promise.resolve()
}
tariffList() {
return this.select('.tariff-cards__wrapper')
}
async horizontalMenu(menuOption) {
switch (menuOption) {
case 'fibra+movil':
return testController.click(
this.selectByDataHook('link-home-menu-convergent')
)
case 'tarifas movil':
return testController.click(
this.selectByDataHook('link-home-menu-mobileonly')
)
case 'móviles y más':
return testController.click(
this.selectByDataHook('link-home-menu-terminals')
)
case 'sólo fibra':
return testController.click(
this.selectByDataHook('link-home-menu-fixed')
)
case 'tv a lo yoigo':
return testController.click(this.selectByDataHook('link-home-menu-tv'))
default:
return testController
.expect(true)
.eql(false, `Case ${menuOption} not recognized`)
}
}
async mobileTariffDisplayed() {
return testController
.expect(this.tariffList().visible)
.ok('tariffs are not displayed or visible')
}
}