Protractor 和 Karma 可以一起使用吗? [英] Can Protractor and Karma be used together?

查看:33
本文介绍了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 可以一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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