Skip to content

Commit 957cae3

Browse files
committed
fix e2e tests
1 parent 1918aa0 commit 957cae3

File tree

6 files changed

+8
-15
lines changed

6 files changed

+8
-15
lines changed

example/components/inbox/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ module.exports = {
3131
3232
activate: function (transition) {
3333
console.log('activating inbox...')
34-
setTimeout(function () {
35-
transition.next()
36-
}, 500)
34+
transition.next()
3735
},
3836
3937
// for doing cleanups

example/route-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module.exports = function (router) {
7575
router.app.authenticating = false
7676
alert('this route is forbidden by a global before hook')
7777
transition.abort()
78-
}, 500)
78+
}, 1500)
7979
} else {
8080
transition.next()
8181
}

example/services/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
id: params.id,
77
text: 'Hello this is a message'
88
})
9-
}, 1000)
9+
}, 1500)
1010
}
1111
}

src/router/internal.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ module.exports = function (Vue, Router) {
210210
})
211211
}
212212

213-
this._currentRoute = route
214-
215213
// handle scroll positions
216214
// saved scroll positions take priority
217215
// then we check if the path has an anchor

src/transition.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ p.start = function (cb) {
123123
transition.runQueue(daq, pipeline.canDeactivate, function canActivatePhase () {
124124
transition.runQueue(aq, pipeline.canActivate, function deactivatePhase () {
125125
transition.runQueue(daq, pipeline.deactivate, function activatePhase () {
126+
// validation complete. change the current route.
127+
transition.router._currentRoute = transition.to
126128
// trigger reuse for all reused views
127129
reuseQueue && reuseQueue.forEach(function (view) {
128130
pipeline.reuse(view, transition)

test/e2e/test.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,14 @@ module.exports = {
5454
// inbox
5555
.url(base + '/inbox')
5656
.waitForElementVisible('h1', 1000)
57-
.assert.elementNotPresent('.view h2')
58-
// wait for inbox's activation hook
59-
.pause(600)
6057
.assert.containsText('.view h2', 'inbox!')
6158
.assert.containsText('.view', 'default yo')
6259

6360
.url(base + '/inbox/message/123')
6461
.waitForElementVisible('h1', 1000)
65-
.assert.elementNotPresent('.view h2')
66-
.pause(600)
67-
.assert.containsText('.view h2', 'inbox!')
6862
.assert.containsText('.view div', 'Loading data')
69-
.pause(600)
63+
.assert.containsText('.view h2', 'inbox!')
64+
.pause(1500)
7065
.assert.containsText('.view div', 'message #123: Hello this is a message')
7166
// confirm navigation
7267
.click('a[href^="/user"]')
@@ -91,7 +86,7 @@ module.exports = {
9186
.waitForElementVisible('h1', 1000)
9287
.assert.visible('#app > p')
9388
.assert.containsText('#app > p', 'Authenticating')
94-
.pause(600)
89+
.pause(1500)
9590
.getAlertText(function (text) {
9691
this.assert.ok(/forbidden by a global before hook/.test(text.value))
9792
})

0 commit comments

Comments
 (0)