forked from vuejs/vue-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeepalive-view.js
49 lines (39 loc) · 1.46 KB
/
keepalive-view.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
const bsStatus = require('../browserstack-send-status')
module.exports = {
...bsStatus(),
'@tags': [],
'keepalive view': function (browser) {
browser
.url('http://localhost:8080/keepalive-view/')
.waitForElementVisible('#app', 1000)
.assert.count('li a', 7)
.click('li:nth-child(1) a')
.assert.containsText('.view', 'index child1')
.click('li:nth-child(2) a')
.assert.containsText('.view', 'index child2')
.click('li:nth-child(3) a')
.assert.containsText('.view', 'home')
// back to index child1 and check it
.click('li:nth-child(1) a')
.assert.containsText('.view', 'index child1')
// beforeRouteEnter guard with keep alive
// https://github.com/vuejs/vue-router/issues/2561
.click('li:nth-child(4) a')
.assert.containsText('.view', 'with-guard1: 1')
.click('li:nth-child(3) a')
.assert.containsText('.view', 'home')
.click('li:nth-child(5) a')
.assert.containsText('.view', 'with-guard2: 2')
.click('li:nth-child(4) a')
.assert.containsText('.view', 'with-guard1: 3')
// keep-alive deeply nested router-views
// https://github.com/vuejs/vue-router/issues/2923
.click('li:nth-child(6) a')
.assert.containsText('.view', 'index child1')
.click('li:nth-child(3) a')
.assert.containsText('.view', 'home')
.click('li:nth-child(7) a')
.assert.containsText('.view', 'index child2')
.end()
}
}