forked from vuejs/vue-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestart-app.js
45 lines (37 loc) · 1.34 KB
/
restart-app.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
const bsStatus = require('../browserstack-send-status')
module.exports = {
...bsStatus(),
'@tags': ['history'],
basic: function (browser) {
browser
.url('http://localhost:8080/restart-app/')
.waitForElementVisible('#mount', 1000)
.assert.containsText('#beforeEach', '0')
.assert.containsText('#beforeResolve', '0')
.assert.containsText('#afterEach', '0')
// Mounting will trigger hooks
.click('#mount')
.waitForElementVisible('#app > *', 1000)
.assert.containsText('#beforeEach', '1')
.assert.containsText('#beforeResolve', '1')
.assert.containsText('#afterEach', '1')
.assert.containsText('#view', 'home')
// Navigate to foo route will trigger hooks
.click('#app li:nth-child(2) a')
.assert.containsText('#beforeEach', '2')
.assert.containsText('#beforeResolve', '2')
.assert.containsText('#afterEach', '2')
.assert.containsText('#view', 'foo')
// Unmount
.click('#unmount')
.assert.containsText('#app', '')
// Second mounting will trigger hooks
.click('#mount')
.waitForElementVisible('#app > *', 1000)
.assert.containsText('#beforeEach', '3')
.assert.containsText('#beforeResolve', '3')
.assert.containsText('#afterEach', '3')
.assert.containsText('#view', 'foo')
.end()
}
}