forked from wevote/WebApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprivacy.page.js
75 lines (58 loc) · 1.6 KB
/
privacy.page.js
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
import { $, $$ } from '@wdio/globals';
import Page from './page';
class PrivacyPage extends Page {
constructor () {
super().title = 'Privacy Policy - We Vote';
}
async load () {
await super.open('/more/privacy');
await super.maximizeWindow();
await super.rerender();
}
get weVoteUSLink () {
return $('#wevote');
}
get campaignsWeVoteUSLink () {
return $('#weVoteCampaigns');
}
get helpCenterLink () {
return $('#wevotePrivacy');
}
get findSubmittingRequestHereLink () {
return $('#weVoteContactUsPage');
}
get deleteYourAccountLink () {
return $('#deleteAllAccountDataLink');
}
get googleApiUserDataPolicyLink () {
return $('#googleLimitedUse');
}
get googleAnalyticsLink () {
return $('#googleAnalytics');
}
get openReplayPrivacyLink () {
return $('#openReplayPrivacy');
}
get elementOfCampaignPage () {
return $('//div/h1[text() = "Helping the best candidates win votes"]');
}
get emailLink () {
return $$('//a[text() = "[email protected]"]');
}
get deleteYourAccountButton () {
return $('#deleteAllAccountDataButton');
}
get cancelOfDeleteYourAccountButton () {
return $('#deleteAllAccountDataCancelButton');
}
async getTextFromEmailLinks () {
const selectorToGetElements = '//a[text() = "[email protected]"]';
const arrOfElements = [];
for (let i = 1; i <= $$(selectorToGetElements).length; i++) {
const textFromElement = $(`(${selectorToGetElements})[${i}]`).getText();
arrOfElements.push(textFromElement);
}
return arrOfElements;
}
}
export default new PrivacyPage();