小编Pat*_*eld的帖子

流星:什么是测试Blaze中两个值(如{{#if someVar =='someVal'}})相等的最佳方法?

我不得不在任何地方定义模板助手,只是用常量测试文档属性的相等性,所以我可以在我的模板中做这样的事情:

    {{#if fruitIsPineapple}}...{{/if}}
Run Code Online (Sandbox Code Playgroud)

在我的模板中,助手看起来像:

    Template.example.helpers({
      fruitIsPineapple: function () { return this.document.fruit === 'pineapple'; } 
    });
Run Code Online (Sandbox Code Playgroud)

如何避免创建所有这些助手?如果我们在Blaze中有一个相等运算符,那就太好了......

javascript templating meteor

17
推荐指数
2
解决办法
1万
查看次数

我在我的配置中提供'sauceUser'和'sauceKey'但是我说我正在尝试使用用户名'None'进行身份验证并访问密钥'None'

我正在尝试测试使用Ionic编写的移动应用程序,因为Ionic基于Angular,我想使用Protractor编写测试并使用Saucelabs Appium在移动模拟器中运行测试.我使用命令调用量角器:

SAUCE_USERNAME=$(SAUCE_USERNAME) SAUCE_ACCESS_KEY=$(SAUCE_ACCESS_KEY) ./node_modules/.bin/protractor protractorConfig.js
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误:

UnknownError: Sauce Labs Authentication Error.
You used username 'None' and access key 'None' to authenticate, which are not valid Sauce Labs credentials.
Run Code Online (Sandbox Code Playgroud)

我的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"
  ]
};
Run Code Online (Sandbox Code Playgroud)

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

编辑:我根据Travis的Protractor对Sauce Labs运行e2e测试的答案中的一个问题,提供了这个问题和我的答案.我提出了这个问题并回答说希望这些信息需要大量的谷歌搜索才能找到相同问题的其他人.

angularjs saucelabs appium protractor ionic-framework

8
推荐指数
1
解决办法
2187
查看次数

Meteor 0.8.0:构建应用程序时:意外关闭模板标记

我的模板中有此部分,意外的结束模板标记为{{/ if}}.

{{#if selected}}
  <div class="Answer--selected">
{{else}}
  <div class="Answer">
{{/if}}
    <i class="fa"></i> {{title}}
  </div>
Run Code Online (Sandbox Code Playgroud)

这段代码有什么问题?

html javascript templates web meteor

6
推荐指数
2
解决办法
1844
查看次数