Sublime not recognize functions such as toBeTrue().

163 Views Asked by At

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();

 });
1

There are 1 best solutions below

1
On

The method toBeTrue() does not exist within protractor. Instead of toBeTrue() you should use the method toBeTruthy(), like:

expect(succUpdSpan.isPresent()).toBeTruthy();

or

expect(succUpdSpan.isPresent()).toEqual(true);