Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <div ng-app="test2App" ng-controller="test2Ctrl">
- <input ng-model="myValue">
- </div>
- </body>
- var test2App = angular.module('test2App', [])
- test2App.controller('test2Ctrl', function($scope,$timeout) {
- $timeout(function() {
- $scope.myValue = true;
- },10000);
- });
- describe('my suite',function() {
- it('wait for a model to be defined',function() {
- element(by.model('myValue')).evaluate('myValue')
- .then(function(v) {
- expect(v).toBe(true);
- });
- });
- });
- browser.wait(function(){
- // Wait until condition is true.
- return element(by.model('myValue')).evaluate('myValue')
- .then(function(v) {
- // I'm not sure if it will evaluate to a string, try it.
- return v === 'true';
- });
- }, 10000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement