将 Selenium 用于基于 AngularJS 的 Web 应用程序 [英] Use of Selenium for AngularJS based Web Applications

查看:20
本文介绍了将 Selenium 用于基于 AngularJS 的 Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 Selenium 是 UI 测试之父.

I have come to know that Selenium is the father of UI testing.

现在我的问题是为什么 Angular 团队开发了 Protractor.对于基于 AngularJS 的 Web 应用程序,Selenium 不能完成同样的工作(Protractor 所做的)吗?

Now my question is why then Angular team has developed Protractor. Can't the same job (that Protractor does) be done with Selenium for AngularJS based web applications?

此外,人们也在谈论 Nightwatch.js.那么为什么有这么多 E2E 测试库/框架,例如 Protracor 或 Nightwatch.

Further, people are talking about Nightwatch.js too. So why there are so many E2E testing libraries/frameworks like Protracor or Nightwatch.

推荐答案

Protractor 结合了强大的工具和技术,如 NodeJS、Selenium、webDriver、Jasmine、Cucumber 和 Mocha.拥有一系列来自 Selenium 的自定义功能,可以轻松地为 AngularJS 应用程序创建测试.加速您的测试,因为它避免了测试中大量睡眠"和等待"的需要,因为它优化了睡眠和等待时间.允许基于 Jasmine 组织测试,从而允许您在 Jasmine 上编写单元测试和功能测试.它可以在真实浏览器和无头浏览器上运行...

Protractor combines powerful tools and technologies such as NodeJS, Selenium, webDriver, Jasmine, Cucumber and Mocha. Has a bunch of customizations from Selenium to easily create tests for AngularJS applications. Speeds up your testing as it avoids the need for a lot of "sleeps" and "waits" in your tests, as it optimizes sleep and wait times. Allows tests to be organized based on Jasmine, thus allowing you to write both unit and functional tests on Jasmine. It runs on real browsers and headless browsers...

您可以在这里找到所有这些信息 => http://www.thoughtworks.com/见解/博客/testing-angularjs-apps-protractor.

You can find all these information here => http://www.thoughtworks.com/insights/blog/testing-angularjs-apps-protractor.

这篇关于将 Selenium 用于基于 AngularJS 的 Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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