christo8989 christo8989 - 2 years ago 148
Javascript Question

What are all the possible assert functions?

I don't see the possible assert functions in protractor's api. Could someone post the possible functions to use?

I know of:

  • toEqual

  • toBeLessThan


expect(element.getText()).toEqual('Please help me!'); //toEqual being the assertion

Answer Source

These functions are provided by an expectation/assertion library to determine the 'result' of a testable operation. By itself, protractor merely provides the glue/harness for Angular-Selenium (to run within a testing framework) that exposes testable operations.

In this case that is probably expect. (See the link for standard expectations.)

When you use expect, you write assertions similarly to how you would say them, e.g. "I expect this value to be equal to 3" or "I expect this array to contain 3"..

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download