mercredi 27 mai 2015

Ignore synchronization for $http, but not $timeout

Is there a way to ignore synching with the http request for a angular app?

I have this form that should be disabled during the POST of the form. When this POST request is pending, the form should be disabled and this is what I would like to write specs for.

So in Protractor I fill out the form and click on the send button. The request will never get a response, waiting until the browser ends the request due to a timeout (usually 30 secs), so I have time to check if the form is disabled. But since Protractor wants to sync with http requests, a pending request would render in a timeout from Protractor.

So I added the line browser.ignoreSynchronization = true, making Protractor ignore syncing http request. But I believe this also means ignoring syncing with angular as a whole, not waiting until angular have updated data-bindings for example before Protractor moves on.

Aucun commentaire:

Enregistrer un commentaire