ui: Add an optional environment variable to control how testem starts (#9793)

Here we look for a TESTEM_AUTOLAUNCH environment variable, which can be
set to either Chrome, Firefox or Safari, which will control which
browser to automatically start when running testem tests.

If the variable is set to anything else, then it will not automatically
start a browser in order to run the tests and you will need to visit the
tests manually. e.g.:

TESTEM_AUTOLAUNCH=0 make test-oss-view

Previously we only ever tested in Chrome and therefore there are no
specific settings for Firefox or Safari. If specific settings are
required for these browsers they can be added at a later date.
This commit is contained in:
John Cowen 2021-02-22 14:53:05 +00:00 committed by GitHub
parent b1d3c8002b
commit 2c2e9d1ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,8 @@ module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
launch_in_dev: ['Chrome', 'Firefox', 'Safari'].includes(process.env.TESTEM_AUTOLAUNCH) ?
[process.env.TESTEM_AUTOLAUNCH] : typeof process.env.TESTEM_AUTOLAUNCH === 'undefined' ? ['Chrome'] : [],
browser_start_timeout: 120,
browser_args: {
Chrome: {