mardi 2 janvier 2018

Cypress and Angular

In Protractor, there is this selling feature called "Protractor to Angular synchronization":

Automatic Waiting

You no longer need to add waits and sleeps to your test. Protractor can automatically execute the next step in your test the moment the webpage finishes pending tasks, so you don’t have to worry about waiting for your test and webpage to sync.

which is performed before every webdriver command. The synchronization is based on the Angular's "Testability" API which would signal back when Angular is "stable":

return testability.whenStable(function() { testCallback(); });

The sync itself is quite handy and allows for clean and naturally written tests without having to use Explicit Waits because on every step you are sure that Angular is done with outstanding requests and ready to work with.

There is also the Cypress testing tool, which we are starting to use. Is there a way to use the "Testability API" to have the sync between the tests and an Angular application under test?

Aucun commentaire:

Enregistrer un commentaire