Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Improve Browserstack config and make logs less noisy

Josiah Sprague262e71b41ab4
diff --git a/e2e/browserstack.js b/e2e/browserstack.js
index 1ecb4398c..7d0e68a7b 100644
--- a/e2e/browserstack.js
+++ b/e2e/browserstack.js
@@ -5,15 +5,16 @@ var browserstack = require('browserstack-local');
var bs_local;
try {
- process.mainModule.filename = "./node_modules/.bin/nightwatch"
+ process.mainModule.filename = './node_modules/.bin/nightwatch'
// Code to start browserstack local before start of test
- console.log("Connecting local");
+ console.log('Connecting localhost to Browserstack...');
Nightwatch.bs_local = bs_local = new browserstack.Local();
bs_local.start({'key': process.env.BROWSERSTACK_ACCESS_KEY }, function(error) {
if (error) throw error;
- console.log('Connected. Now testing...');
+ console.log('Connected. Running tests...');
+ console.log('Go to https://www.browserstack.com/automate to view tests in progress.');
Nightwatch.cli(function(argv) {
Nightwatch.CliRunner(argv)
.setup(null, function(){
diff --git a/e2e/nightwatch-browserstack.conf.js b/e2e/nightwatch-browserstack.conf.js
index 23a36bdf0..d6a14f28c 100644
--- a/e2e/nightwatch-browserstack.conf.js
+++ b/e2e/nightwatch-browserstack.conf.js
@@ -3,6 +3,7 @@ const chromedriver = require('chromedriver');
const geckodriver = require('geckodriver');
require('nightwatch-cucumber')({
+ nightwatchOutput: false,
cucumberArgs: [
'--compiler', 'js:babel-core/register',
'--require', 'e2e/step_definitions',
@@ -11,7 +12,7 @@ require('nightwatch-cucumber')({
]
});
-module.exports = {
+var nightwatch_config = {
output_folder: 'e2e/reports',
globals_path: 'e2e/globals.js',
selenium: {
@@ -19,20 +20,51 @@ module.exports = {
host: 'hub-cloud.browserstack.com',
port: 80
},
+ common_capabilities: {
+ 'browserstack.user': process.env.BROWSERSTACK_USER,
+ 'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY,
+ 'browserstack.local': true,
+ applicationCacheEnabled: false,
+ webStorageEnabled: false
+ },
test_settings: {
- default: {
- selenium_host: 'hub-cloud.browserstack.com',
- selenium_port: 80,
+ default: {},
+ chrome: {
desiredCapabilities: {
- 'browserstack.user': process.env.BROWSERSTACK_USER,
- 'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY,
- 'browserstack.local': true,
os: 'OS X',
os_version: 'El Capitan',
browser: 'Chrome',
browser_version: '61.0',
resolution: '1920x1080'
}
+ },
+ firefox: {
+ desiredCapabilities: {
+ browser: "firefox"
+ }
+ },
+ safari: {
+ desiredCapabilities: {
+ browser: "safari"
+ }
+ },
+ ie: {
+ desiredCapabilities: {
+ browser: "internet explorer"
+ }
}
}
};
+
+// Merge common_capabilities with each test_settings key
+for(var i in nightwatch_config.test_settings){
+ var config = nightwatch_config.test_settings[i];
+ config['selenium_host'] = nightwatch_config.selenium.host;
+ config['selenium_port'] = nightwatch_config.selenium.port;
+ config['desiredCapabilities'] = config['desiredCapabilities'] || {};
+ for(var j in nightwatch_config.common_capabilities){
+ config['desiredCapabilities'][j] = config['desiredCapabilities'][j] || nightwatch_config.common_capabilities[j];
+ }
+}
+
+module.exports = nightwatch_config;
diff --git a/nightwatch.conf.js b/nightwatch.conf.js
index 657853bf0..3e309457b 100644
--- a/nightwatch.conf.js
+++ b/nightwatch.conf.js
@@ -3,10 +3,12 @@ const chromedriver = require('chromedriver');
const geckodriver = require('geckodriver');
require('nightwatch-cucumber')({
+ nightwatchOutput: false,
cucumberArgs: [
'--compiler', 'js:babel-core/register',
'--require', 'e2e/step_definitions',
'--format', `json:e2e/reports/cucumber-${process.argv[3]}.json`,
+ '--format', 'progress-bar',
'e2e/features'
]
});
@@ -14,7 +16,6 @@ require('nightwatch-cucumber')({
module.exports = {
output_folder: 'e2e/reports',
globals_path: 'e2e/globals.js',
- live_output: false,
selenium: {
start_process: true,
server_path: seleniumServer.path,
@@ -31,7 +32,6 @@ module.exports = {
launch_url: 'http://localhost',
selenium_port: 4444,
selenium_host: 'localhost',
- silent: true,
desiredCapabilities: {
browserName: 'chrome',
marionette: true
diff --git a/package.json b/package.json
index b50e17a2b..ed6ac9b87 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"e2e:firefox": "run-s --continue-on-error --silent e2e:firefox:*",
"e2e:firefox:test": "nightwatch -e firefox --skiptags hover",
"e2e:firefox:report": "node e2e/create-report.js firefox",
- "e2e:browserstack": "node e2e/browserstack.js -c e2e/nightwatch-browserstack.conf.js"
+ "e2e:browserstack": "node e2e/browserstack.js -c e2e/nightwatch-browserstack.conf.js -e chrome,firefox,safari,ie"
},
"devDependencies": {
"autoprefixer": "7.1.1",