0

我有一个 donejs 插件 ( https://github.com/riescorp/donejs-typeahead ),我决定使用 funcunit ( http://funcunit.com/ ) 进行 GUI 交互测试。在我的电脑上一切正常,无论是运行测试页面(http://localhost:8080/test/test.html)还是npm test在控制台上运行。

问题是在 CircleCI 或 Travis CI 上运行测试时,测试不会通过。错误类似于“xxxxx 页面未及时加载!” (见下面的例子)。

有一个简化的分支来显示正在发生的事情(https://github.com/riescorp/donejs-typeahead/tree/testing-open),您可以克隆它,然后运行npm installnpm test您会看到它有效。

您可以在此处查看 CircleCI 中错误的详细信息:

Travis 生成相同的错误,但它会失败,因为我正在测试 firefox 和 chrome(travis 不支持 chrome)

示例错误:

1) QUnit "test/test.html" on Chrome 53.0.2785 / Linux 0.0.0: donejs-typeahead GUI Interaction DEBUG TESTS DEBUG 1 Page //../src/donejs-typeahead.html not loaded in time!: Error: Expected true but was false at Object.ok (http://localhost:3996/node_modules/steal-qunit/node_modules/qunitjs/qunit/qunit.js:2194:12) at Object.assertOK (http://localhost:3996/node_modules/funcunit/browser/adapters/qunit.js:12:10) at http://localhost:3996/node_modules/funcunit/browser/queue.js:168:27

4

1 回答 1

1

您可以通过设置 Funcunit 在 iframe 中打开新窗口frameMode: true。这就是DoneJS应用程序生成器设置的内容。

于 2016-12-05T23:03:02.133 回答