angularjs - Protractor don't wait for $http result -
I am facing the following problem and I can not get rid of it:
- < Li> I have a Cooner app that makes an API call using
- This API calls update the database and 10 seconds before returning
- On the return of the call, a dialogue is open that the exam is over
$ http.post
, When I test this small app with the opponent If I try to cry, then the exam ends, step 3 happens. This fails my test because the update is not always done in the database. During the test, I see opening the dialog after 10 seconds.
Here are some code: My angular service to call:
My Conflict Test:
browser.get ('/ #! / Activate-account.html? Id =' + acc._id). Then (Function () {browser.sleep (1000); // Check that the DB account has been updated. Coll.findOne ({Pseudo: 'MyActivatePseudo'}, function (error, AC2) {hope (mistake) .to .not.exist; / / Expecting OK (acc2.activated) .to.be.true; // KO DB update only after findOne}););
I try browser.sleep ()
in the ProtectorCache test, but it does nothing.
Many thanks for your help, because I 'm completely trapped!
JM
Comments
Post a Comment