-
-
Notifications
You must be signed in to change notification settings - Fork 5k
/
Copy pathnested-router.js
34 lines (27 loc) · 1.01 KB
/
nested-router.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
const bsStatus = require('../browserstack-send-status')
module.exports = {
...bsStatus(),
'@tags': ['history'],
basic: function (browser) {
browser
.url('http://localhost:8080/nested-router/')
.waitForElementVisible('#app', 1000)
.assert.count('li a', 3)
.click('li:nth-child(1) a')
.assert.urlEquals('http://localhost:8080/nested-router/nested-router')
.assert.containsText('.child', 'Child router path: /')
.assert.count('li a', 5)
.click('.child li:nth-child(1) a')
.assert.containsText('.child', 'Child router path: /foo')
.assert.containsText('.child .foo', 'foo')
.click('.child li:nth-child(2) a')
.assert.containsText('.child', 'Child router path: /bar')
.assert.containsText('.child .bar', 'bar')
.click('li:nth-child(2) a')
.assert.urlEquals('http://localhost:8080/nested-router/foo')
.assert.elementNotPresent('.child')
.assert.containsText('#app', 'foo')
.assert.count('li a', 3)
.end()
}
}