TestArmada / boilerplate-nightwatch

An example magellan automated testing project with nightwatch.js tests
MIT License
51 stars 46 forks source link

npm run test:desktop fails because of magellan-browserstack-executor #64

Closed michaeljacobdavis closed 6 years ago

michaeljacobdavis commented 6 years ago

Following the directions to test locally, running npm run test:desktop fails with on master:

[INFO] [Magellan] Will try to load configuration from default of ./magellan.json
Loaded configuration from:  /Users/michael-davis/dev/magellan/magellan.json
[INFO] [Magellan] Magellan is creating temporary files at: /Users/michael-davis/dev/magellan/temp
[INFO] [Magellan] Magellan 10.1.0
[INFO] [Magellan] Loaded test framework: 
[INFO] [Magellan]   testarmada-magellan-nightwatch-plugin
[INFO] [Magellan] Loaded test executors: 
[INFO] [Magellan]   testarmada-magellan-local-executor
[INFO] [Magellan]   testarmada-magellan-sauce-executor
[INFO] [Magellan]   testarmada-magellan-browserstack-executor
[INFO] [Magellan] Enabled bail strategy: 
[INFO] [Magellan]   testarmada-magellan-early-bail-strategy: Magellan will bail if failure ratio exceeds a threshold within a given period
[INFO] [Nightwatch Plugin] test iterator found nightwatch configuration at: ./conf/nightwatch.json
[INFO] [Nightwatch Plugin] Scanning tests for test files ...
[INFO] [Nightwatch Plugin] Found 3 test files in tests
[INFO] [Nightwatch Plugin] Using nightwatch test filter: tests/demo-web.js
[ERROR] [Magellan] Error initializing Magellan
[ERROR] [Magellan] Error description:
[ERROR] [Magellan] Error: no auth mechanism defined
[ERROR] [Magellan] Error stack trace:
[ERROR] [Magellan] Error: no auth mechanism defined
    at Auth.onRequest (/Users/michael-davis/dev/magellan/node_modules/request/lib/auth.js:132:32)
    at Request.auth (/Users/michael-davis/dev/magellan/node_modules/request/request.js:1349:14)
    at Request.init (/Users/michael-davis/dev/magellan/node_modules/request/request.js:375:10)
    at new Request (/Users/michael-davis/dev/magellan/node_modules/request/request.js:128:8)
    at request (/Users/michael-davis/dev/magellan/node_modules/request/index.js:53:10)
    at Function.get (/Users/michael-davis/dev/magellan/node_modules/request/index.js:61:12)
    at /Users/michael-davis/dev/magellan/node_modules/testarmada-magellan-browserstack-executor/lib/pancake.js:63:27
    at Promise (<anonymous>)
    at Object.initialize (/Users/michael-davis/dev/magellan/node_modules/testarmada-magellan-browserstack-executor/lib/pancake.js:46:12)
    at Object.getProfiles (/Users/michael-davis/dev/magellan/node_modules/testarmada-magellan-browserstack-executor/lib/profile.js:68:30)

The culprit seems to be the addition of testarmada-magellan-browserstack-executor in magellan.json. Removing it fixes the issue.

I'm not familiar with the pattern, but should testarmada-magellan-browserstack-executor be removed? Or is it expected to fail gracefully (it looks like testarmada-magellan-saucelabs-executor is in there but does not fail when no credentials are given).

archlichking commented 6 years ago

Each executor has its own setup (ENV VAR, command line args, etc.). testarmada-magellan-browserstack-executor requires browserstack user name and token to be passed in via ENV VAR. https://github.com/TestArmada/magellan-browserstack-executor#how-to-use. If you don't need to run test on browserstack simply remove it from magellan.json.

testarmada-magellan-browserstack-executor is still in beta and we just started to actively working on it with browserstack recently. And yes the error needs to be prompted gracefully. Thank you for the issue, we'll write it down and get better error alert in the executor.