'restores scroll position when reloading'
)
+ // going to an anchor entry, scrolling, then back then forward restores the position
+ .click('li:nth-child(4) a')
+ .waitForElementPresent('.view.bar', TIMEOUT)
+ // at this point we scrolled to the anchor, scroll again somewhere else
+ // and then go back
+ .execute(function () {
+ window.scrollTo(0, 100)
+ window.history.back()
+ })
+ .waitForElementPresent('.view.foo', TIMEOUT)
+ .execute(function () {
+ window.history.forward()
+ })
+ .waitForElementPresent('.view.bar', TIMEOUT)
+ .assert.evaluate(
+ function () {
+ return window.pageYOffset === 100
+ },
+ null,
+ 'scroll to stored position over anchor'
+ )
+
// going again to a popped entry should not restore the saved position
.click('li:nth-child(1) a')
.waitForElementPresent('.view.home', TIMEOUT)