forcedotcom / LightningTestingService

Apache License 2.0
122 stars 35 forks source link

saucelabs environment vars #60

Closed froucher closed 6 years ago

froucher commented 6 years ago

Hi,

I am trying to connect LTS with saucelabs.com, and I has successfully connected with this command:

sfdx force:lightning:test:run -f config.json

And the following configuration in config.json

{
  "webdriverio": {
    "host": "ondemand.saucelabs.com",
    "port": "80",
    "user": "saucelabs_user",
    "key": "secretkey",
    "desiredCapabilities": {
      "browserName": "chrome",
      "chromeOption": {
        "args": [ "--no-sandbox" ]
      }
    }
  }
}

This run :)

But the question is:

Can I use two environment variables instead of push these secrets to the git repository?

This is a Best Practices and it is very interesting for continuous integration environment.

Sample:

export SAUCE_USERNAME=saucelabs_user
export SAUCE_ACCESS_KEY=secretkey
sfdx force:lightning:test:run -f config.json

Thanks.

esalman-sfdc commented 6 years ago

When running on CI, may be you could generate a config file from a template replacing placeHolders with values read from env variables. For localhost, you could use a config which is in gitignore (assuming you use git)

froucher commented 6 years ago

I deployed lightning testing services in CI with this workaround. Thanks for the answer.