Ember:使用 Selenium 在浏览器中进行集成测试的最佳实践 [英] Ember: Best practices with Selenium to make integration tests in browser

查看:29
本文介绍了Ember:使用 Selenium 在浏览器中进行集成测试的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您有使用 ember.js 进行 Selenium 测试的经验/示例吗?

Have you any experiences/examples to make Selenium tests with ember.js?

我无法抓取"视图(我使用路由器),因为它们具有不确定的 ID.

I cannot "grab" views (I use router), because they have not-deterministic ids.

有什么想法吗?

推荐答案

您可以为视图元素显式设置自己的 id.直接来自车把,如:

You can set your own id's for view elements explicitly. Directly from handlebars like:

{{#view Ember.TextField elementId="my_id"}}

或者来自您的视图对象:

Or from your view object:

MyApp.MyView = Ember.View.Extend({
  elemntId: "my_id"
});

这篇关于Ember:使用 Selenium 在浏览器中进行集成测试的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆