i need to check that there are more than twelve elements listed in a page. I did it, but on expectation I have this error:
AssertionError: expected '24' to be a number or a date
Now, 24 is obviously a number, so what is the problem?? Why this assertion error? Can you help me to solve this?
Here my stepdefinition.js
Given('there are more than twelve elements listed', function (next) {
let listed_count = element(by.css('span[class="total-results"]'));
listed_count.getText().then(function(text){
console.log('How much elements?: ', text);
browser.sleep(1111);
return expect(text).to.be.above(12);
})
next();
});
Thank you.
listed_count.getText() returns text. You need to convert it into number:
parseInt(text);