webdriverio-boneyard / wdio-sauce-service

WebdriverIO v4 service for better Sauce Labs integration
http://webdriver.io
MIT License
18 stars 21 forks source link

Authentication Error when SauceConnect is not in wdio.conf.js #29

Closed Lmasniuk closed 7 years ago

Lmasniuk commented 7 years ago

I am trying to get my wdio tests to run against my Sauce Labs account. I have been running them against my locally hosted selenium-standalone server thus far.

I've installed wdio-sauce-service and have modified my wdio.conf.js file to contain the following:

host: 'ondemand.saucelabs.com',
port: 80,
services: ['sauce'],
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,

Then when I attempt to run my test command 'npm test' I get the following error message:

Error: Sauce Labs Authentication Error. You used username 'None' and access key 'None' to authenticate, which are not valid Sauce Labs credentials.

Is this because I do not have the line 'sauceConnect: true' in my config file? The page that I am testing is not behind a firewall nor is the SauceLabs server(presumably) so I was hoping to not have to install and use SauceConnect if possible.

christian-bromann commented 7 years ago

@Lmasniuk you don't need to set host and port. Are you sure SAUCE_USERNAME and SAUCE_ACCESS_KEY is set in your environment?

Lmasniuk commented 7 years ago

@christian-bromann After removing the lines for setting host and port, then checking my environment variables I was able to get it to work. I wasn't referring to one of my env variables correctly and the host & port were causing issues. Thank you very much!