2

Installing 'testcafe-browser-provider-browserstack' by package.json causes Jenkins job not to recognize 'browserstack'

Tried removing from package.json and install from command line but dependencies cause npm install to error.

testcafe 1.1.4 testcafe-browser-provider-browserstack 1.8.0

npm install

node_modules/.bin/testcafe -e browserstack:safari auth-subscriber-access-myaccount.js

ERROR Unable to find the browser. "browserstack:safari" is not a browser alias or path to an executable file.

bwmathews
  • 161
  • 4
  • 1
    Try to change command line for running TestCafe as follows: `node node_modules/testcafe/bin/testcafe browserstack:safari auth-subscriber-access-myaccount.js` – mlosev May 31 '19 at 09:29

2 Answers2

2

One way to debug the issue would be to run the test explicitly with your BrowserStack credentials with the following command -

BROWSERSTACK_USERNAME="YOUR_USERNAME" BROWSERSTACK_ACCESS_KEY="YOUR_KEY" testcafe "browserstack:safari@12.0:OS X Mojave" "path/to/test/file.js"
Ozone17
  • 138
  • 7
2

I tried different paths and also moving to devDependencies in package.json but wasn't successful. I removed from package.json and installed command line at run time and it works.

Maybe I didn't find the right path to call it or it needs to be "local" installed but it now recognizes 'browserstack' this way.

bwmathews
  • 161
  • 4