Can Protractor and Karma be used together?(Protractor 和 Karma 可以一起使用吗?)
问题描述
如果 Protractor 正在取代 Angular Scenario Runner 进行 E2E 测试,这是否意味着我仍然可以将它与 Karma 作为我的端到端测试框架?
If Protractor is replacing Angular Scenario Runner for E2E testing, does that mean I will still be able to use it with Karma as my E2E testing framework ?
推荐答案
Protractor 的当前维护者不推荐:
Not recommended by the current maintainer of Protractor:
https://github.com/angular/protractor/issues/9#issuecomment-19927049
Protractor 和 Karma 不应该一起使用;相反,它们为运行测试提供了单独的系统.Protractor 和 Karma 涵盖了测试的不同方面 - Karma 主要用于单元测试,而 Protractor 应该用于端到端测试.
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 构建在 WebDriverJS 之上,它使用 Selenium/WebDriver 服务器来配置浏览器和驱动测试执行.可以在这里找到纯 WebDriverJS 的示例:http://code.google.com/p/selenium/wiki/WebDriverJs
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 - 我认为将 Protractor 和 Karma 分开是有意义的 - 对于端到端测试,您需要 webdriver 的原生事件驱动和灵活性,而对于单元测试,您需要快速执行和自动查看文件.
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.
这篇关于Protractor 和 Karma 可以一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Protractor 和 Karma 可以一起使用吗?


- addEventListener 在 IE 11 中不起作用 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01