Always scroll down unit tests on Sauce Labs

This commit is contained in:
Daniel Huigens 2018-07-26 18:29:22 +02:00
parent 8c7e4386af
commit 68016b22a5
2 changed files with 3 additions and 2 deletions

View File

@ -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],

View File

@ -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);
}
});