Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <body>
  2. <div ng-app="test2App" ng-controller="test2Ctrl">
  3. <input ng-model="myValue">
  4. </div>
  5. </body>
  6.  
  7.  
  8. var test2App = angular.module('test2App', [])
  9. test2App.controller('test2Ctrl', function($scope,$timeout) {
  10. $timeout(function() {
  11. $scope.myValue = true;
  12. },10000);
  13. });
  14.  
  15. describe('my suite',function() {
  16. it('wait for a model to be defined',function() {
  17. element(by.model('myValue')).evaluate('myValue')
  18. .then(function(v) {
  19. expect(v).toBe(true);
  20. });
  21. });
  22. });
  23.  
  24. browser.wait(function(){
  25. // Wait until condition is true.
  26. return element(by.model('myValue')).evaluate('myValue')
  27. .then(function(v) {
  28. // I'm not sure if it will evaluate to a string, try it.
  29. return v === 'true';
  30. });
  31. }, 10000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement