Class webdriver.testing.Assertion
code »Utility for performing assertions against a given value
. If the
value is a webdriver.promise.Promise
, this assertion will wait
for it to resolve before applying any matchers.
Constructor
Parameters |
---|
|
Classes
|
Instance Methods
code »apply ( matcher, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the given matcher
accepts the value wrapped by this
instance. If the wrapped value is a promise, this function will defer
applying the assertion until the value has been resolved. Otherwise, it
will be applied immediately.
webdriver.promise.Promise
matcher
accepts the value wrapped by this
instance. If the wrapped value is a promise, this function will defer
applying the assertion until the value has been resolved. Otherwise, it
will be applied immediately.Parameters |
---|
|
Returns |
null if the assertion was immediately applied. |
code »closeTo ( value, range, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is a number within a given distance of an
expected value.
webdriver.promise.Promise
code »contains ( value, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is a string or array-like structure
containing the given value.
webdriver.promise.Promise
Parameters |
---|
|
Returns |
|
code »endsWith ( suffix, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is a string ending with the given suffix.
webdriver.promise.Promise
code »equalTo ( value, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the value managed by this assertion is strictly equal to the
given value
.
webdriver.promise.Promise
value
.Parameters |
---|
|
Returns |
|
code »greaterThan ( value, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the value managed by this assertion is a number strictly
greater than value
.
webdriver.promise.Promise
value
.code »greaterThanEqualTo ( value, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the value managed by this assertion is a number >= the given
value.
webdriver.promise.Promise
code »instanceOf ( ctor, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is an instance of the given class.
webdriver.promise.Promise
Asserts that the value managed by this assertion is strictly false.
Returns |
---|
|
code »isNull ( opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is null.
webdriver.promise.Promise
Parameters |
---|
|
Returns |
|
code »isNullOrUndefined ( opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is null or undefined.
webdriver.promise.Promise
Parameters |
---|
|
Returns |
|
Asserts that the value managed by this assertion is strictly true.
Returns |
---|
|
code »isUndefined ( opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is undefined.
webdriver.promise.Promise
Parameters |
---|
|
Returns |
|
code »lessThan ( value, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the value managed by this assertion is a number strictly less
than the given value.
webdriver.promise.Promise
code »lessThanEqualTo ( value, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the value managed by this assertion is a number <= the given
value.
webdriver.promise.Promise
code »matches ( regex, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is a string that matches the given RegExp.
webdriver.promise.Promise
code »startsWith ( prefix, opt_message ) ⇒ webdriver.promise.Promise
Asserts that the wrapped value is a string starting with the given prefix.
webdriver.promise.Promise