O'Reilly logo

Angular Test-Driven Development - Second Edition by Md. Ziaul Haq

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Protractor APIs

The main activities of an e2e test for any web page are to get the DOM elements of that page, interact with them, assign an action to them, and share information with them; then, the user can get the current state of the website. To enable us to perform all these actions, Protractor provides a wide array of APIs (some are from the web driver). In this chapter, we will look at some commonly used APIs.

In the previous chapter, we saw how Protractor works with an Angular project, where we had to interact with UI elements. For that, we used a few Protractor APIs, such as element.all, by.css, first, last, and getText. However, we didn't see or understand the workings of these APIs in depth. To understand the workings of APIs in Protractor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required