There are little part of code:
driver.wait(function(){
return driver.isElementPresent(webdriver.By.className(errElement));
}, 3000, 'Element' + errElement + ' is not found').then(function(binaryVariable){
assert.isTrue(binaryVariable, 'is not True');
/*console.log(binaryVariable);
console.log(typeof(binaryVariable));*/
});
if I enable debug print, in the console appears
true
boolean
It means that driver.wait returns boolean, so I try to check it via assert.isTrue. But I recieve error message assert.isTrue is not a function. What I does wrong?
You should use
var chai = require('chai');
chai.assert.isTrue(binaryVariable, 'is not True');
Simply referring to global assert object makes use of NodeJS' own, which doesn't have isTrue or isBoolean methods.
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