From 10af614d077339ed66c35a66e743a45bb96ca5a4 Mon Sep 17 00:00:00 2001 From: Calvin Liang Date: Thu, 14 May 2020 15:20:43 -0700 Subject: [PATCH 1/3] refactor(scroll-behavior): clean up scroll-behavior tests --- test/e2e/specs/scroll-behavior.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/e2e/specs/scroll-behavior.js b/test/e2e/specs/scroll-behavior.js index 6cc371fee..d99b2ae6e 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) @@ -97,7 +93,6 @@ module.exports = { null, 'scroll to top on new entry' ) - .click('li:nth-child(4) a') .assert.evaluate( function () { @@ -106,10 +101,7 @@ module.exports = { null, '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 +109,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 From cc2f09c814dd6c35502d7ea55f11c12c881a0e37 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sat, 16 May 2020 11:02:41 +0200 Subject: [PATCH 2/3] Update test/e2e/specs/scroll-behavior.js [skip ci] --- test/e2e/specs/scroll-behavior.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/specs/scroll-behavior.js b/test/e2e/specs/scroll-behavior.js index d99b2ae6e..38bc46ae2 100644 --- a/test/e2e/specs/scroll-behavior.js +++ b/test/e2e/specs/scroll-behavior.js @@ -93,6 +93,7 @@ module.exports = { null, 'scroll to top on new entry' ) + .click('li:nth-child(4) a') .assert.evaluate( function () { From f0ea11fcd072409aa9e41d15a354046c12bcbd9f Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Sat, 16 May 2020 11:03:39 +0200 Subject: [PATCH 3/3] Update test/e2e/specs/scroll-behavior.js [skip ci] --- test/e2e/specs/scroll-behavior.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/specs/scroll-behavior.js b/test/e2e/specs/scroll-behavior.js index 38bc46ae2..12119ed0b 100644 --- a/test/e2e/specs/scroll-behavior.js +++ b/test/e2e/specs/scroll-behavior.js @@ -102,6 +102,7 @@ module.exports = { null, 'scroll to anchor' ) + .click('li:nth-child(5) a') .assert.evaluate( function () {