forked from honestbleeps/Reddit-Enhancement-Suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemporaryDropdownLinks.js
32 lines (28 loc) · 1.02 KB
/
temporaryDropdownLinks.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
module.exports = {
'basic functionality': browser => {
if (browser.options.desiredCapabilities.browserName === 'firefox') {
// geckodriver doesn't support moveto https://github.com/mozilla/geckodriver/issues/159
browser.end();
return;
}
const dropdown = '.menuarea .dropdown .selected';
const firstChoice = '.menuarea .drop-choices .choice';
// can't properly test without logging in,
// so just make sure it doesn't break anything existing
browser
.url('https://en.reddit.com/r/RESIntegrationTests/top/')
.waitForElementVisible(dropdown)
.click(dropdown)
.moveToElement(firstChoice, 0, 0)
.assert.containsText(`${firstChoice} a`, '(temporarily?)')
.click(`${firstChoice} a`)
.assert.urlContains('/r/RESIntegrationTests/top/?t=hour')
.url('https://en.reddit.com/r/RESIntegrationTests/top/')
.waitForElementVisible(dropdown)
.click(dropdown)
.waitForElementVisible(firstChoice)
.click(firstChoice)
.assert.urlContains('/r/RESIntegrationTests/top/?t=hour')
.end();
},
};