yarn e2e-local is now e2e, add new yarn e2e-browserstack

This commit is contained in:
Chi Vinh Le
2017-10-17 19:34:55 +07:00
parent 3a58088420
commit 1542888080
5 changed files with 78 additions and 79 deletions
+39
View File
@@ -0,0 +1,39 @@
const {
ROOT_URL
} = require('./config');
const nightwatch_config = {
src_folders: './test/e2e/specs/',
output_folder: './test/e2e/reports',
page_objects_path: './test/e2e/page_objects',
globals_path: './test/e2e/globals',
selenium : {
start_process: false,
host: 'hub-cloud.browserstack.com',
port: 80
},
test_settings: {
default: {
launch_url: ROOT_URL,
desiredCapabilities: {
'browserstack.user': process.env.BROWSERSTACK_USER || 'coralproject2',
'browserstack.key': process.env.BROWSERSTACK_KEY,
'browserstack.local': true,
'browserstack.debug': true,
'browserstack.networkLogs': true,
'browser': 'chrome',
}
}
}
};
// Code to copy seleniumhost/port into test settings
for(const i in nightwatch_config.test_settings){
const config = nightwatch_config.test_settings[i];
config['selenium_host'] = nightwatch_config.selenium.host;
config['selenium_port'] = nightwatch_config.selenium.port;
}
module.exports = nightwatch_config;
-50
View File
@@ -1,50 +0,0 @@
const {
ROOT_URL
} = require('./config');
module.exports = {
src_folders: './test/e2e/specs/',
output_folder: './test/e2e/reports',
page_objects_path: './test/e2e/page_objects',
globals_path: './test/e2e/globals',
selenium: {
start_process: true,
server_path: 'node_modules/selenium-standalone/.selenium/selenium-server/3.5.3-server.jar',
log_path: './test/e2e/',
host: '127.0.0.1',
port: 6666,
cli_args: {
'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.32-x64-chromedriver'
}
},
test_settings: {
default: {
launch_url: ROOT_URL,
selenium_port: 6666,
selenium_host: 'localhost',
silent: true,
desiredCapabilities: {
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
webStorageEnabled: true,
databaseEnabled: true,
applicationCacheEnabled: false,
nativeEvents: true,
},
screenshots : {
enabled: true,
on_failure: true,
on_error: true,
path: './test/e2e/tests_output'
},
},
headless: {
desiredCapabilities: {
chromeOptions : {
args: ['--headless', '--disable-gpu']
},
},
},
},
};
+36 -25
View File
@@ -2,38 +2,49 @@ const {
ROOT_URL
} = require('./config');
const nightwatch_config = {
module.exports = {
src_folders: './test/e2e/specs/',
output_folder: './test/e2e/reports',
page_objects_path: './test/e2e/page_objects',
globals_path: './test/e2e/globals',
selenium : {
start_process: false,
host: 'hub-cloud.browserstack.com',
port: 80
selenium: {
start_process: true,
server_path: 'node_modules/selenium-standalone/.selenium/selenium-server/3.5.3-server.jar',
log_path: './test/e2e/',
host: '127.0.0.1',
port: 6666,
cli_args: {
'webdriver.chrome.driver': 'node_modules/selenium-standalone/.selenium/chromedriver/2.32-x64-chromedriver'
}
},
test_settings: {
default: {
launch_url: ROOT_URL,
selenium_port: 6666,
selenium_host: 'localhost',
silent: true,
desiredCapabilities: {
'browserstack.user': process.env.BROWSERSTACK_USER || 'coralproject2',
'browserstack.key': process.env.BROWSERSTACK_KEY,
'browserstack.local': true,
'browserstack.debug': true,
'browserstack.networkLogs': true,
'browser': 'chrome',
}
}
}
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
webStorageEnabled: true,
databaseEnabled: true,
applicationCacheEnabled: false,
nativeEvents: true,
},
screenshots : {
enabled: true,
on_failure: true,
on_error: true,
path: './test/e2e/tests_output'
},
},
headless: {
desiredCapabilities: {
chromeOptions : {
args: ['--headless', '--disable-gpu']
},
},
},
},
};
// Code to copy seleniumhost/port into test settings
for(const i in nightwatch_config.test_settings){
const config = nightwatch_config.test_settings[i];
config['selenium_host'] = nightwatch_config.selenium.host;
config['selenium_port'] = nightwatch_config.selenium.port;
}
module.exports = nightwatch_config;
+3 -3
View File
@@ -15,9 +15,9 @@
"lint": "yamllint locales/*.yml && eslint --ext=.js --ext=.json bin/* .",
"lint-fix": "yarn lint --fix",
"jest-watch": "TEST_MODE=unit NODE_ENV=test jest --watch",
"e2e": "NODE_ENV=test ./scripts/e2e.js",
"pree2e-local": "./scripts/e2e-local.sh",
"e2e-local": "NODE_ENV=test nightwatch --config nightwatch-local.conf.js",
"e2e-browserstack": "NODE_ENV=test ./scripts/e2e.js --config nightwatch-browserstack.conf.js",
"pree2e": "selenium-standalone install",
"e2e": "NODE_ENV=test nightwatch",
"test": "TEST_MODE=unit NODE_ENV=test jest && TEST_MODE=unit NODE_ENV=test mocha -R ${MOCHA_REPORTER:-spec}",
"test-cover": "TEST_MODE=unit NODE_ENV=test istanbul cover _mocha --report text --check-coverage -- -R spec",
"heroku-postbuild": "./bin/cli plugins reconcile && yarn build",
-1
View File
@@ -1 +0,0 @@
selenium-standalone install