From fff1eae50cf5547db501ce23fcc128ff1c2ffe52 Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Wed, 12 Sep 2018 09:48:32 -0400 Subject: [PATCH 1/8] Fix unit tests --- test/server/cli-argument-parser-test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/server/cli-argument-parser-test.js b/test/server/cli-argument-parser-test.js index 77593bce..6e23747f 100644 --- a/test/server/cli-argument-parser-test.js +++ b/test/server/cli-argument-parser-test.js @@ -386,7 +386,7 @@ describe('CLI argument parser', function () { }); it('Should parse command line arguments', function () { - return parse('-r list -S -q -e --hostname myhost --proxy localhost:1234 --proxy-bypass localhost:5678 --qr-code --app run-app --speed 0.5 --debug-on-fail --disable-page-reloads ie test/server/data/file-list/file-1.js') + return parse('-r list -S -q -e --hostname myhost --proxy localhost:1234 --proxy-bypass localhost:5678 --qr-code --app run-app --speed 0.5 --debug-on-fail --disable-page-reloads ie test/server/data/file-list/file-1.js --record-screen-capture') .then(function (parser) { expect(parser.browsers).eql(['ie']); expect(parser.src).eql([path.resolve(process.cwd(), 'test/server/data/file-list/file-1.js')]); @@ -403,6 +403,7 @@ describe('CLI argument parser', function () { expect(parser.opts.proxy).to.be.ok; expect(parser.opts.proxyBypass).to.be.ok; expect(parser.opts.debugOnFail).to.be.ok; + expect(parser.opts.recordScreenCapture).to.be.ok; }); }); @@ -437,7 +438,8 @@ describe('CLI argument parser', function () { { long: '--ssl' }, { long: '--qr-code' }, { long: '--color' }, - { long: '--no-color' } + { long: '--no-color' }, + { long: '--record-screen-capture' } ]; var parser = new CliArgumentParser(''); @@ -449,4 +451,3 @@ describe('CLI argument parser', function () { expect(find(options, EXPECTED_OPTIONS[i])).not.eql(void 0, WARNING); }); }); - From 777a9c11314e0a13727aeefac7b29100172319a6 Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Tue, 23 Oct 2018 09:52:41 -0400 Subject: [PATCH 2/8] Reduce requested browser to 1 for MVP --- test/functional/config.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/test/functional/config.js b/test/functional/config.js index f6015ee5..84d3eac3 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -30,30 +30,30 @@ testingEnvironments[testingEnvironmentNames.osXDesktopAndMSEdgeBrowsers] = { }, browsers: [ - { - os: 'OS X', - osVersion: 'Sierra', - name: 'safari', - alias: 'safari' - }, + // { + // os: 'OS X', + // osVersion: 'Sierra', + // name: 'safari', + // alias: 'safari' + // }, { os: 'OS X', osVersion: 'Sierra', name: 'chrome', alias: 'chrome-osx' - }, - { - os: 'OS X', - osVersion: 'Sierra', - name: 'firefox', - alias: 'firefox-osx' - }, - { - os: 'Windows', - osVersion: '10', - name: 'edge', - alias: 'edge', - } + }//, + // { + // os: 'OS X', + // osVersion: 'Sierra', + // name: 'firefox', + // alias: 'firefox-osx' + // }, + // { + // os: 'Windows', + // osVersion: '10', + // name: 'edge', + // alias: 'edge', + // } ] }; From dfabf47ca5932c2240d3c1da919e4225af50470a Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Wed, 24 Oct 2018 09:44:23 -0400 Subject: [PATCH 3/8] For science! --- test/functional/config.js | 38 +++++++++++++++++++------------------- test/functional/setup.js | 9 ++++----- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/test/functional/config.js b/test/functional/config.js index 84d3eac3..f6015ee5 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -30,30 +30,30 @@ testingEnvironments[testingEnvironmentNames.osXDesktopAndMSEdgeBrowsers] = { }, browsers: [ - // { - // os: 'OS X', - // osVersion: 'Sierra', - // name: 'safari', - // alias: 'safari' - // }, + { + os: 'OS X', + osVersion: 'Sierra', + name: 'safari', + alias: 'safari' + }, { os: 'OS X', osVersion: 'Sierra', name: 'chrome', alias: 'chrome-osx' - }//, - // { - // os: 'OS X', - // osVersion: 'Sierra', - // name: 'firefox', - // alias: 'firefox-osx' - // }, - // { - // os: 'Windows', - // osVersion: '10', - // name: 'edge', - // alias: 'edge', - // } + }, + { + os: 'OS X', + osVersion: 'Sierra', + name: 'firefox', + alias: 'firefox-osx' + }, + { + os: 'Windows', + osVersion: '10', + name: 'edge', + alias: 'edge', + } ] }; diff --git a/test/functional/setup.js b/test/functional/setup.js index 7b0a48ef..ebac107d 100644 --- a/test/functional/setup.js +++ b/test/functional/setup.js @@ -69,10 +69,10 @@ function openRemoteBrowsers () { return connector .connect() - .then(function () { - return connector.waitForFreeMachines(REQUESTED_MACHINES_COUNT, - WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL, WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT); - }) + // .then(function () { + // return connector.waitForFreeMachines(REQUESTED_MACHINES_COUNT, + // WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL, WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT); + // }) .then(function () { var buildInfo = { jobName: environment.jobName, @@ -272,4 +272,3 @@ if (config.useLocalBrowsers && !config.isLegacyEnvironment) { require('./fixtures/api/es-next/take-screenshot/test'); require('./fixtures/screenshots-on-fails/test'); } - From b28f88238f12a8c9b8c06905db5bb984e9a6b9a7 Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Wed, 24 Oct 2018 16:15:44 -0400 Subject: [PATCH 4/8] Take 2 --- test/functional/setup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/setup.js b/test/functional/setup.js index ebac107d..4b7601fe 100644 --- a/test/functional/setup.js +++ b/test/functional/setup.js @@ -17,8 +17,8 @@ var browsersInfo = null; var connector = null; var browserInstances = null; -const WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL = 60000; -const WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT = 60; +// const WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL = 60000; +// const WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT = 60; const BROWSER_OPENING_TIMEOUT = 90000; @@ -32,7 +32,7 @@ var isBrowserStack = browserProvider === config.browserProviderNames.browsersta config.browsers = environment.browsers; -const REQUESTED_MACHINES_COUNT = environment.browsers.length; +// const REQUESTED_MACHINES_COUNT = environment.browsers.length; function getBrowserInfo (settings) { return Promise From 005e5366c4b6684c058eeda39dab39f909b8c16f Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Thu, 25 Oct 2018 09:54:14 -0400 Subject: [PATCH 5/8] cheat the system? --- test/functional/setup.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/functional/setup.js b/test/functional/setup.js index 4b7601fe..14bdc4f9 100644 --- a/test/functional/setup.js +++ b/test/functional/setup.js @@ -17,8 +17,8 @@ var browsersInfo = null; var connector = null; var browserInstances = null; -// const WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL = 60000; -// const WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT = 60; +const WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL = 60000; +const WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT = 60; const BROWSER_OPENING_TIMEOUT = 90000; @@ -69,10 +69,10 @@ function openRemoteBrowsers () { return connector .connect() - // .then(function () { - // return connector.waitForFreeMachines(REQUESTED_MACHINES_COUNT, - // WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL, WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT); - // }) + .then(function () { + return connector.waitForFreeMachines(1,//REQUESTED_MACHINES_COUNT, + WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL, WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT); + }) .then(function () { var buildInfo = { jobName: environment.jobName, From 211d0ff3c212b295c801233af2943920cdcdb7e6 Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Thu, 25 Oct 2018 09:56:22 -0400 Subject: [PATCH 6/8] linters sucks --- test/functional/setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/setup.js b/test/functional/setup.js index 14bdc4f9..cda68283 100644 --- a/test/functional/setup.js +++ b/test/functional/setup.js @@ -70,7 +70,7 @@ function openRemoteBrowsers () { return connector .connect() .then(function () { - return connector.waitForFreeMachines(1,//REQUESTED_MACHINES_COUNT, + return connector.waitForFreeMachines(1, //REQUESTED_MACHINES_COUNT, WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL, WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT); }) .then(function () { From 461545e0031a8e5b9cb5c5afbaa496fb1119d95e Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Tue, 30 Oct 2018 09:47:49 -0400 Subject: [PATCH 7/8] Brute Force! --- Gulpfile.js | 18 ++++++++ test/functional/config.js | 96 ++++++++++++++++++++++++++++++++++++++- test/functional/setup.js | 4 +- 3 files changed, 115 insertions(+), 3 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index cc7eea1a..71fc8b0b 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -635,6 +635,24 @@ gulp.step('test-functional-travis-desktop-osx-and-ms-edge-run', function () { gulp.task('test-functional-travis-desktop-osx-and-ms-edge', gulp.series('build', 'test-functional-travis-desktop-osx-and-ms-edge-run')); +gulp.step('test-functional-osx-safari', function () { + return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.osXDesktopSafari, functionalTestConfig.browserProviderNames.browserstack); +}); + +gulp.step('test-functional-osx-chrome', function () { + return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.osXDesktopChrome, functionalTestConfig.browserProviderNames.browserstack); +}); + +gulp.step('test-functional-osx-firefox', function () { + return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.osXDesktopFirefox, functionalTestConfig.browserProviderNames.browserstack); +}); + +gulp.step('test-functional-ms-edge', function () { + return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.MSEdge, functionalTestConfig.browserProviderNames.browserstack); +}); + +gulp.task('test-functional-prodperfect-desktop-osx-and-ms-edge', gulp.series('build', 'test-functional-osx-safari', 'test-functional-osx-chrome', 'test-functional-osx-firefox', 'test-functional-ms-edge')); + gulp.step('test-functional-travis-mobile-run', function () { return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.mobileBrowsers, functionalTestConfig.browserProviderNames.browserstack); }); diff --git a/test/functional/config.js b/test/functional/config.js index f6015ee5..f0470490 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -16,7 +16,11 @@ var testingEnvironmentNames = { localBrowsers: 'local-browsers', localHeadlessBrowsers: 'local-headless-browsers', oldBrowsers: 'old-browsers', - legacy: 'legacy' + legacy: 'legacy', + osXDesktopSafari: 'osx-desktop-safari', + osXDesktopChrome: 'osx-desktop-chrome', + osXDesktopFirefox: 'osx-desktop-firefox', + msEdge: 'ms-edge' }; var testingEnvironments = {}; @@ -57,6 +61,96 @@ testingEnvironments[testingEnvironmentNames.osXDesktopAndMSEdgeBrowsers] = { ] }; +testingEnvironments[testingEnvironmentNames.osXDesktopSafari] = { + jobName: 'functional tests - OS X desktop Safari', + + browserstack: { + username: process.env.BROWSER_STACK_USERNAME, + accessKey: process.env.BROWSER_STACK_ACCESS_KEY + }, + + browsers: [ + { + os: 'OS X', + osVersion: 'Sierra', + name: 'safari', + alias: 'safari' + } + ] +}; + +testingEnvironments[testingEnvironmentNames.osXDesktopChrome] = { + jobName: 'functional tests - OS X desktop Chrome', + + browserstack: { + username: process.env.BROWSER_STACK_USERNAME, + accessKey: process.env.BROWSER_STACK_ACCESS_KEY + }, + + browsers: [ + { + os: 'OS X', + osVersion: 'Sierra', + name: 'chrome', + alias: 'chrome-osx' + } + ] +}; + +testingEnvironments[testingEnvironmentNames.osXDesktopFirefox] = { + jobName: 'functional tests - OS X desktop Firefox', + + browserstack: { + username: process.env.BROWSER_STACK_USERNAME, + accessKey: process.env.BROWSER_STACK_ACCESS_KEY + }, + + browsers: [ + { + os: 'OS X', + osVersion: 'Sierra', + name: 'safari', + alias: 'safari' + }, + { + os: 'OS X', + osVersion: 'Sierra', + name: 'chrome', + alias: 'chrome-osx' + }, + { + os: 'OS X', + osVersion: 'Sierra', + name: 'firefox', + alias: 'firefox-osx' + }, + { + os: 'Windows', + osVersion: '10', + name: 'edge', + alias: 'edge', + } + ] +}; + +testingEnvironments[testingEnvironmentNames.MSEdge] = { + jobName: 'functional tests - MS edge', + + browserstack: { + username: process.env.BROWSER_STACK_USERNAME, + accessKey: process.env.BROWSER_STACK_ACCESS_KEY + }, + + browsers: [ + { + os: 'Windows', + osVersion: '10', + name: 'edge', + alias: 'edge', + } + ] +}; + testingEnvironments[testingEnvironmentNames.mobileBrowsers] = { jobName: 'functional tests - mobile browsers', diff --git a/test/functional/setup.js b/test/functional/setup.js index cda68283..68b7f20f 100644 --- a/test/functional/setup.js +++ b/test/functional/setup.js @@ -32,7 +32,7 @@ var isBrowserStack = browserProvider === config.browserProviderNames.browsersta config.browsers = environment.browsers; -// const REQUESTED_MACHINES_COUNT = environment.browsers.length; +const REQUESTED_MACHINES_COUNT = environment.browsers.length; function getBrowserInfo (settings) { return Promise @@ -70,7 +70,7 @@ function openRemoteBrowsers () { return connector .connect() .then(function () { - return connector.waitForFreeMachines(1, //REQUESTED_MACHINES_COUNT, + return connector.waitForFreeMachines(REQUESTED_MACHINES_COUNT, WAIT_FOR_FREE_MACHINES_REQUEST_INTERVAL, WAIT_FOR_FREE_MACHINES_MAX_ATTEMPT_COUNT); }) .then(function () { From b1b0d39bfd1c7cf63c094811dce3dd6b8c2e7f80 Mon Sep 17 00:00:00 2001 From: Corey Hanson Date: Thu, 29 Nov 2018 09:31:12 -0500 Subject: [PATCH 8/8] Slimmer tests; add local chrome only --- Gulpfile.js | 8 +++++++- test/functional/config.js | 32 ++++++++++++++------------------ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/Gulpfile.js b/Gulpfile.js index 71fc8b0b..7a6dcee1 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -651,7 +651,7 @@ gulp.step('test-functional-ms-edge', function () { return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.MSEdge, functionalTestConfig.browserProviderNames.browserstack); }); -gulp.task('test-functional-prodperfect-desktop-osx-and-ms-edge', gulp.series('build', 'test-functional-osx-safari', 'test-functional-osx-chrome', 'test-functional-osx-firefox', 'test-functional-ms-edge')); +gulp.task('test-functional-prodperfect-desktop-osx-and-ms-edge', gulp.series('build', 'test-functional-osx-chrome')); gulp.step('test-functional-travis-mobile-run', function () { return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.mobileBrowsers, functionalTestConfig.browserProviderNames.browserstack); @@ -665,6 +665,12 @@ gulp.step('test-functional-local-run', function () { gulp.task('test-functional-local', gulp.series('build', 'test-functional-local-run')); +gulp.step('test-functional-local-headless-chrome-run', function () { + return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.localHeadlessChrome); +}); + +gulp.task('test-functional-local-headless-chrome', gulp.series('build', 'test-functional-local-headless-chrome-run')); + gulp.step('test-functional-local-ie-run', function () { return testFunctional('test/functional/fixtures', functionalTestConfig.testingEnvironmentNames.localBrowsersIE); }); diff --git a/test/functional/config.js b/test/functional/config.js index f0470490..bcb090d2 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -14,6 +14,7 @@ var testingEnvironmentNames = { localBrowsersIE: 'local-browsers-ie', localBrowsersChromeFirefox: 'local-browsers-chrome-firefox', localBrowsers: 'local-browsers', + localHeadlessChrome: 'local-headless-chrome', localHeadlessBrowsers: 'local-headless-browsers', oldBrowsers: 'old-browsers', legacy: 'legacy', @@ -106,29 +107,11 @@ testingEnvironments[testingEnvironmentNames.osXDesktopFirefox] = { }, browsers: [ - { - os: 'OS X', - osVersion: 'Sierra', - name: 'safari', - alias: 'safari' - }, - { - os: 'OS X', - osVersion: 'Sierra', - name: 'chrome', - alias: 'chrome-osx' - }, { os: 'OS X', osVersion: 'Sierra', name: 'firefox', alias: 'firefox-osx' - }, - { - os: 'Windows', - osVersion: '10', - name: 'edge', - alias: 'edge', } ] }; @@ -258,6 +241,19 @@ testingEnvironments[testingEnvironmentNames.localHeadlessBrowsers] = { ] }; +testingEnvironments[testingEnvironmentNames.localHeadlessChrome] = { + isLocalBrowsers: true, + + browsers: [ + { + platform: 'Windows 10', + browserName: 'chrome:headless --no-sandbox', + userAgent: 'headlesschrome', + alias: 'chrome' + } + ] +}; + testingEnvironments[testingEnvironmentNames.oldBrowsers] = { jobName: 'functional tests - ms desktop browsers',