I'm trying to test if an element appears after a button is clicked. But sublime doesn't recognize any of the functions such as toBeTrue(), toBe(true) by showing red line. Here are the codes:
updAccDtlBtn.click().then(function() {
expect(p.browser.getCurrentUrl()).to.eventually.equal('http://localhost:3000/myAccount');
//A green field notifying success will be displayed
var succUpdSpan = p.browser.element(p.By.cssContainingText('col-sm-offset-4','Account Details Successfully Updated'));
expect(succUpdSpan.isPresent()).toBeTrue();
});
The method
toBeTrue()
does not exist within protractor. Instead oftoBeTrue()
you should use the methodtoBeTruthy()
, like:expect(succUpdSpan.isPresent()).toBeTruthy();
or
expect(succUpdSpan.isPresent()).toEqual(true);