angularjs - Protractor - click causing angular to freeze -


i'm having trouble protractor test.

overview of test

  1. click button show form
  2. fill out form
  3. click button save form - should call function in 1 of controllers makes http call , reloads models on page.

when clicking final "save" button, seems freeze , attached ng-click function never seems called. don't see errors in console when use browser.pause. can see button in fact clicked, @ point, nothing seems happen.

final button definition:

this.addconfigfilterlinebutton = element(by.css('[ng-click="cflctrl.create();"]')); 

function fills out form:

this.addnewconfigfilterline = function (cb) {   var self = this;   var deferred = protractor.promise.defer();    browser.executescript('window.scrollto(0,10000);')   .then(function(){     self.newconfigfilterlinebutton.click();      // code fills out form      self.addconfigfilterlinebutton.click();      browser.waitforangular()     .then(function(){       deferred.fulfill();     });   });    return deferred.promise; }; 

spec

it('should allow creating new configfilterline', function (done) {   var length;   settingspage.configfilterlines.count()   .then(function(count){     length = count;     return settingspage.addnewconfigfilterline();   })   .then(function(){     expect(settingspage.configfilterlines.count()).to.eventually.equal(length+1);      done();   }); }); 

i've tried browser.waitforangular , without it, , doesn't seem matter. when button clicked, nothing happens.

any ideas helpful. let me know if there's more info can provide.

instead of using

this.addconfigfilterlinebutton = element(by.css('[ng-click="cflctrl.create();"]'));

try more this:

this.addconfigfilterlinebutton = element(by.id('id-of-final-button'));

my guess protractor isn't correctly finding "addconfigfilterlinebutton".


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -