I'm using Angular.js Protractor to get check the values of cells in an 
ng-grid. I'm able to get the values, but they are strings, and I'd like to 
do calculations with them.

When I try this:

ptor.findElements(protractor.By.className('ngCellText')).then(function(cells) {
  
expect(parseFloat(cells[16].getText())).toEqual(parseFloat(cells[14].getText()) 
/ parseFloat(cells[11].getText()));});

I get the error: Expected NaN to equal NaN. 

I read that promises are asynchronous, and you can't convert them with a 
synchronous function, so I tried this:

element.all(by.className('ngCellText')).then(function(text1) {
  element.all(by.className('ngCellText')).then(function (text2) {
    element.all(by.className('ngCellText')).then(function (text3) {
      
expect(parseFloat(text1[16].getText())).toEqual(parseFloat(text2[14].getText()) 
+ parseFloat(text3[11].getText()));
    });
  });});

And I get the same error: Expected NaN to equal NaN. 

If anyone could help me out, that'd be great!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to