In my program I'm calculating two numbers, and I want to make sure that subtraction of them equals 1.
this is the code:
var firstCount=element.all(by.repeater('app in userApps')).count();
var secondCount=element.all(by.repeater('app in userApps')).count();
so far it's good- I'm getting the numbers. the problem comes next:
var sub=secondCount-firstCount;
expect(sub).toEqual(1);
I'm getting this error:
Expected NaN to equal 1.
any idea?
Both firstCount
and secondCount
are promises that are needed to be resolved:
element.all(by.repeater('app in userApps')).count().then(function (first) {
element.all(by.repeater('app in userApps')).count().then(function(second) {
expect(first - second).toEqual(1);
})
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With