加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 我在我的配置中提供’sauceUser’和’sauceKey’但

发布时间:2020-12-17 07:30:41 所属栏目:安全 来源:网络整理
导读:我正在尝试测试使用Ionic编写的移动应用程序,因为Ionic基于Angular,我想使用Protractor编写测试并使用Saucelabs Appium在移动模拟器中运行测试.我使用命令调用量角器: SAUCE_USERNAME=$(SAUCE_USERNAME) SAUCE_ACCESS_KEY=$(SAUCE_ACCESS_KEY) ./node_modul
我正在尝试测试使用Ionic编写的移动应用程序,因为Ionic基于Angular,我想使用Protractor编写测试并使用Saucelabs Appium在移动模拟器中运行测试.我使用命令调用量角器:
SAUCE_USERNAME=$(SAUCE_USERNAME) SAUCE_ACCESS_KEY=$(SAUCE_ACCESS_KEY) ./node_modules/.bin/protractor protractorConfig.js

但是我收到以下错误:

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

我的protractorConfig.js包含:

/* global exports */
/* global process */
exports.config = {
  sauceUser: process.env.SAUCE_USERNAME,sauceKey: process.env.SAUCE_ACCESS_KEY,capabilities: {
    appiumVersion: "1.0",app: "sauce-storage:app.zip",platformName: "iOS",platformVersion: "7.1",deviceName: "iPhone Simulator",browserName: ""
  },allScriptsTimeout: 30000,seleniumAddress: "http://" + 
    process.env.SAUCE_USERNAME + ":"+process.env.SAUCE_ACCESS_KEY+
    "@ondemand.saucelabs.com:80/wd/hub",specs: [
    "spec/feature/*.js"
  ]
};

为什么Protractor / Saucelabs说我没有提供用户名或访问密钥?

编辑:我根据Running e2e tests on Sauce Labs from Protractor on Travis中的一个答案中的信息提出了这个问题和我的答案.我提出了这个问题并回答了希望获取大量谷歌搜索信息的信息更容易被其他拥有同样的问题.

感谢这个其他 question我现在知道你必须从配置中省略’seleniumAddress’,否则Protractor会忽略你的Saucelabs身份验证.如果省略它将正确生成’seleniumAddress’,但此时我不知道它是如何知道的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读