Skip to content

Commit 006edce

Browse files
committed
test: fix e2e tests
1 parent 4e95bd8 commit 006edce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: test/e2e/specs/hash-scroll-behavior.js

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ module.exports = {
4848
return document.getElementById('anchor').getBoundingClientRect().top < 1
4949
}, null, 'scroll to anchor')
5050

51+
// scroll back to top so we can click the butotn
52+
.execute(function () {
53+
window.scrollTo(0, 0)
54+
})
5155
.click('li:nth-child(5) a')
5256
.assert.evaluate(function () {
5357
return document.getElementById('anchor2').getBoundingClientRect().top < 101

Diff for: test/e2e/specs/scroll-behavior.js

+2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ module.exports = {
3131
history.scrollRestoration = 'manual'
3232
})
3333
.click('li:nth-child(2) a')
34+
.waitForElementPresent('.view.foo', TIMEOUT)
3435
.assert.containsText('.view', 'foo')
3536
.execute(function () {
3637
window.scrollTo(0, 200)
3738
window.history.back()
3839
})
40+
.waitForElementPresent('.view.home', TIMEOUT)
3941
.assert.containsText('.view', 'home')
4042
.assert.evaluate(function () {
4143
return window.pageYOffset === 100

0 commit comments

Comments
 (0)