javascript - Protractor 和 Karma 可以一起使用吗?

标签 javascript angularjs testing protractor karma-runner

如果Protractor正在为 E2E 测试替换 Angular Scenario Runner,这是否意味着我仍然可以将它与 Karma 一起使用作为我的 E2E 测试框架?

最佳答案

Protractor 的当前维护者不推荐:

https://github.com/angular/protractor/issues/9#issuecomment-19927049

Protractor and Karma should not be used together; instead they provide separate systems for running tests. Protractor and Karma cover different aspects of testing - Karma is intended mostly for unit tests, while Protractor should be used for end to end testing.

Protractor is built on top of WebDriverJS, which uses a Selenium/WebDriver server to provision browsers and drive test execution. Examples of pure WebDriverJS can be found here: http://code.google.com/p/selenium/wiki/WebDriverJs

https://github.com/angular/protractor/issues/9#issuecomment-19931154

Georgios - I think it makes sense to keep Protractor and Karma separate - for end to end tests, you want the native event driving and flexibility of webdriver, while for unit tests you want fast execution and autowatching of files.

关于javascript - Protractor 和 Karma 可以一起使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17070522/

相关文章:

ruby-on-rails - RSpec:在 spec_helper.rb 中包含自定义帮助程序模块

ruby-on-rails - 如何使用 RSpec 模拟消息链?

javascript - 如何用JavaScript解压SVGZ?

Javascript 正则表达式的模式不起作用

javascript - 加载全部还是只加载一部分?

javascript - 当文本区域处于可编辑模式时,如何为文本区域中的每一行添加数字前缀

javascript - 当多次调用时,Angular 服务会覆盖自身

angularjs - 在 md-autocomplete show [Object Object] 中选择空项目

linux - 是否可以使用机器人框架从另一台远程服务器连接到远程服务器

javascript - 仅对 jqgrid 中的当前页行进行排序