From 68016b22a57eb8b84364014b19a17b0dc7f1d521 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Thu, 26 Jul 2018 18:29:22 +0200 Subject: [PATCH] Always scroll down unit tests on Sauce Labs --- Gruntfile.js | 2 +- test/unittests.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 6ad3da11..39f2f21b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -229,7 +229,7 @@ module.exports = function(grunt) { options: { username: 'openpgpjs', key: getSauceKey, - urls: ['http://127.0.0.1:3000/test/unittests.html'], + urls: ['http://127.0.0.1:3000/test/unittests.html?saucelabs=true'], build: process.env.TRAVIS_BUILD_ID, testname: 'Sauce Unit Test for openpgpjs', browsers: [browser_capabilities], diff --git a/test/unittests.js b/test/unittests.js index 9359c60b..bb2f53d9 100644 --- a/test/unittests.js +++ b/test/unittests.js @@ -37,7 +37,8 @@ describe('Unit Tests', function () { if (typeof window !== 'undefined') { afterEach(function () { - if (window.scrollY >= document.body.scrollHeight - window.innerHeight - 100) { + if (window.scrollY >= document.body.scrollHeight - window.innerHeight - 100 + || openpgp.config.saucelabs) { window.scrollTo(0, document.body.scrollHeight); } });