From 00c39f00aa961dec83c8c4afb62e686ceda2fbf5 Mon Sep 17 00:00:00 2001 From: Calvin Liang Date: Sat, 16 May 2020 02:04:26 -0700 Subject: [PATCH] refactor(e2e): clean up scroll-behavior tests (#3200) Co-authored-by: Eduardo San Martin Morote --- test/e2e/specs/scroll-behavior.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/e2e/specs/scroll-behavior.js b/test/e2e/specs/scroll-behavior.js index 6cc371fee..12119ed0b 100644 --- a/test/e2e/specs/scroll-behavior.js +++ b/test/e2e/specs/scroll-behavior.js @@ -33,12 +33,8 @@ module.exports = { null, 'restore scroll position on back' ) - - // with manual scroll restoration - // https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration .execute(function () { window.scrollTo(0, 100) - history.scrollRestoration = 'manual' }) .click('li:nth-child(2) a') .waitForElementPresent('.view.foo', TIMEOUT) @@ -107,9 +103,7 @@ module.exports = { 'scroll to anchor' ) - .execute(function () { - document.querySelector('li:nth-child(5) a').click() - }) + .click('li:nth-child(5) a') .assert.evaluate( function () { return document.getElementById('anchor2').getBoundingClientRect().top < 101 @@ -117,9 +111,7 @@ module.exports = { null, 'scroll to anchor with offset' ) - .execute(function () { - document.querySelector('li:nth-child(6) a').click() - }) + .click('li:nth-child(6) a') .assert.evaluate( function () { return document.getElementById('1number').getBoundingClientRect().top < 1