I'm attempting to write tests around a form that uses Angular.
After following this solution, I'm able to access the form's scope inside the e2e test. Now with this code:
scope('Form', function(scope) {
scope.email = "test@test.com";
scope.password = "abcd1234";
expect(scope.form.$valid).toBe(true);
})
For whatever reason, scope.form.$valid
is false. If I wrap that inside a setTimeout()
, it works perfectly well. Angular's sleep()
method is of no use.
Any pointers?