Running e2e tests on Sauce Labs from Protractor on Travis

前端 未结 1 884
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 20:29

So I have my open source project (https://github.com/ahmednuaman/radian) and I have some e2e tests that run fine locally using Protractor.

I\'ve followed the Sauce Labs

1条回答
  •  臣服心动
    2021-02-19 20:59

    Ok so after re-reading all the docs again I found that my config.seleniumAddress was incorrect as it was missing the /wd/hub path at the end; then I got a new error: it was complaining about my credentials.

    After diving into Protractor's source I found this doozy, it basically wiped out all the sauce* credentials if I specify a seleniumAddress, so I removed it from my config, tried again and it worked! Woop woop! Here's the Travis output just for fun: https://travis-ci.org/ahmednuaman/radian/jobs/16271613

    So the way to get Protractor to run on Sauce Labs via Travis is to use these config options:

    config.sauceUser = process.env.SAUCE_USERNAME
    config.sauceKey = process.env.SAUCE_ACCESS_KEY
    config.capabilities =
      'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER
      'build': process.env.TRAVIS_BUILD_NUMBER
    

    And not to add a seleniumAddress.

    0 讨论(0)
提交回复
热议问题