Selenium 使用ember cli测试已部署的ember应用程序
我知道ember cli可以用于编写单元测试、集成测试和验收测试,这些测试都有默认的测试运行程序:QUnit和PhantomJS。 我想使用ember cli为远程网站编写验收测试。我能够为本地应用程序编写基本测试用例,该应用程序使用:Selenium 使用ember cli测试已部署的ember应用程序,selenium,ember.js,ember-cli,acceptance-testing,Selenium,Ember.js,Ember Cli,Acceptance Testing,我知道ember cli可以用于编写单元测试、集成测试和验收测试,这些测试都有默认的测试运行程序:QUnit和PhantomJS。 我想使用ember cli为远程网站编写验收测试。我能够为本地应用程序编写基本测试用例,该应用程序使用: ember new <login-test-repo> ember generate acceptance-test login-test 我对使用ember cli测试前端应用相当陌生。我已经用selenium测试了相同的工作流,在这里我可以轻松
ember new <login-test-repo>
ember generate acceptance-test login-test
我对使用ember cli测试前端应用相当陌生。我已经用selenium测试了相同的工作流,在这里我可以轻松地取消并运行网页的验收测试
任何关于为远程网页设置ember cli路由的帮助都将非常有用。谢谢。我不想成为末日预言家,但这并不意味着要使用Ember CLI工具测试远程网站。首先,您可以在配置中看到测试、开发和生产环境的不同配置。其中一个关键问题是:
ENV.APP.rootElement = '#ember-testing';
应用程序被呈现到该元素中。此外,应用程序在每次验收测试后关闭,然后再次启动,并启动初始化程序。它之所以能工作,是因为启动应用程序测试助手被调用:
import Ember from 'ember';
import Application from '../../app';
import Router from '../../router';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run(function() {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}
你根本就没有这些东西。另外,您希望您的测试如何获得这个远程网站?通过IFRAME-我严重怀疑Ember CLI工具中是否有任何逻辑使其正常工作:
我熟悉的标准是远程网站通过Selenium进行测试,例如由QA或开发人员进行测试。独立的Ember CLI测试套件由开发人员维护
import Ember from 'ember';
import Application from '../../app';
import Router from '../../router';
import config from '../../config/environment';
export default function startApp(attrs) {
let application;
let attributes = Ember.merge({}, config.APP);
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
Ember.run(function() {
application = Application.create(attributes);
application.setupForTesting();
application.injectTestHelpers();
});
return application;
}