-
Notifications
You must be signed in to change notification settings - Fork 356
Expand file tree
/
Copy pathfooterlinks.browser.js
More file actions
142 lines (108 loc) · 3.1 KB
/
footerlinks.browser.js
File metadata and controls
142 lines (108 loc) · 3.1 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import { $, $$ , expect} from '@wdio/globals';
import PageBrowser from './page.browser';
import { driver } from '@wdio/globals';
class FooterlinksBrowser extends PageBrowser {
constructor () {
super().title = 'Ready to Vote? - WeVote';
}
get avatar () {
return super.avatar;
}
get electionCountDownTitle () {
return $('//*[contains(@id, "electionCountDownTitle")]');
}
get wevoteLogo () {
return $('//*[contains(@id, "HeaderLogoImage")]');
}
get howItWorksLink () {
return $('#footerLinkHowItWorks');
}
get howItWorksTitle () {
//return $('div>h3[class~="gNNNpeadyFinePrintStepTextX"]');
return $('//h3[text()="1. Choose your interests"]');
}
get howItWorksCloseIcon () {
return $('[data-testid = "CloseIcon"] > path');
}
get findPrivacyLink () {
return $('#footerLinkPrivacy');
}
get getTitleSignUpPopUp () {
return $('.u-f3');
}
get elementHowItWorksWindow () {
return $('.sc-dcJsrY');
}
get getHelpLinkElement () {
return $('#footerLinkWeVoteHelp');
}
get getHelpPageTitleElement () {
//return $('section h1');
return $('//h1[normalize-space()="Help Center"]');
}
get getTermsLinkElement () {
return $('#footerLinkTermsOfUse');
}
get getTeamLinkElement () {
return $('#footerLinkTeam');
}
get getTeamPageTitleElement () {
return $("//h1[normalize-space()='About WeVote']");
}
get getCreditsAndThanksElement () {
return $('#footerLinkCredits');
}
get getCreditsAndThanksPageTitleElement () {
return $("//h1[normalize-space()='Credits & Thanks']");
}
get getVolunteeringOpportunitiesElement () {
return $('#footerLinkVolunteer');
}
get getVolunteeringOpportunitiesPageTitleElement () {
return $('h2.page-title-open');
}
get getDonateLinkLocator () {
return $('[href = "/donate"]');
}
get getAboutLinkElement () {
return $('//a[text() = "About & FAQ"]');
}
get getDonatePageContentTitleElement () {
return $('span*=Choose amount');
}
async waitAboutLinkAndClick () {
await this.getAboutLinkElement.waitForDisplayed({ timeout: 15000 });
await this.getAboutLinkElement.click();
}
async load () {
await super.open('/ready');
}
async clickHowItWorksLink () {
await this.howItWorksLink.click();
}
async closeHowItWorksModalWindow () {
await this.howItWorksCloseIcon.click();
}
async getTitleOfHowItWorksWindowAfterBackButton () {
const num = await this.clickNextButtonHowItWorksWindow();
await this.findBackButtonHowItWorksWindow.click();
if (num === 1) {
return '1. Choose your interests';
} else if (num === 2) {
return '2. Follow organizations and people you trust';
} else if (num === 3) {
return '3. See who endorsed each choice on your ballot';
} else {
return '4. Complete your ballot with confidence';
}
}
async clickGetStartedButton () {
await this.getStartedButton.click();
}
async clickNextButtonFourTimes () {
for (let i = 1; i <= 4; i++) {
this.findNextButtonHowItWorksWindow.click();
}
}
}
export default new FooterlinksBrowser();