Skip to content

Commit

Permalink
Allowing skipping local selenium server when not needed (#10312)
Browse files Browse the repository at this point in the history
* Disable local selenium server when not needed

* Disable skipping for firefox as it appears to be needed still
  • Loading branch information
ijjk authored and Timer committed Jan 28, 2020
1 parent 6a88ec1 commit 8581172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -80,6 +80,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
BROWSERSTACK: true
SKIP_LOCAL_SELENIUM_SERVER: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
Expand Down
7 changes: 5 additions & 2 deletions test/jest-environment.js
Expand Up @@ -4,7 +4,10 @@ const getPort = require('get-port')
const seleniumServer = require('selenium-standalone')
const NodeEnvironment = require('jest-environment-node')

const { BROWSER_NAME: browserName = 'chrome' } = process.env
const {
BROWSER_NAME: browserName = 'chrome',
SKIP_LOCAL_SELENIUM_SERVER,
} = process.env

const newTabPg = `
<!DOCTYPE html>
Expand Down Expand Up @@ -38,7 +41,7 @@ class CustomEnvironment extends NodeEnvironment {

let seleniumServerPort

if (browserName !== 'chrome') {
if (browserName !== 'chrome' && SKIP_LOCAL_SELENIUM_SERVER !== 'true') {
console.log('Installing selenium server')
await new Promise((resolve, reject) => {
seleniumServer.install(err => {
Expand Down

0 comments on commit 8581172

Please sign in to comment.