class NegatedAssertion

webdriver.testing.Assertion
  └ webdriver.testing.NegatedAssertion

An assertion that negates any applied matchers.

new NegatedAssertion(value)

Parameters
value*

The value to perform assertions on.

Instance Methods

apply(matcher, opt_message)code »

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.

Overrides: webdriver.testing.Assertion

Parameters
matchergoog.labs.testing.Matcher

The matcher to apply

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The deferred assertion result, or null if the assertion was immediately applied.


closeTo(value, range, opt_message)code »

Asserts that the wrapped value is a number within a given distance of an expected value.

Defined by: webdriver.testing.Assertion

Parameters
valuenumber

The expected value.

rangenumber

The maximum amount the actual value is permitted to differ from the expected value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


contains(value, opt_message)code »

Asserts that the wrapped value is a string or array-like structure containing the given value.

Defined by: webdriver.testing.Assertion

Parameters
value*

The expected value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


endsWith(suffix, opt_message)code »

Asserts that the wrapped value is a string ending with the given suffix.

Defined by: webdriver.testing.Assertion

Parameters
suffixstring

The expected suffix.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


equalTo(value, opt_message)code »

Asserts that the value managed by this assertion is strictly equal to the given value.

Defined by: webdriver.testing.Assertion

Parameters
value*

The expected value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


greaterThan(value, opt_message)code »

Asserts that the value managed by this assertion is a number strictly greater than value.

Defined by: webdriver.testing.Assertion

Parameters
valuenumber

The minimum value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


greaterThanEqualTo(value, opt_message)code »

Asserts that the value managed by this assertion is a number >= the given value.

Defined by: webdriver.testing.Assertion

Parameters
valuenumber

The minimum value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


instanceOf(ctor, opt_message)code »

Asserts that the wrapped value is an instance of the given class.

Defined by: webdriver.testing.Assertion

Parameters
ctorFunction

The expected class constructor.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


isFalse()code »

Asserts that the value managed by this assertion is strictly false.

Defined by: webdriver.testing.Assertion

Returns
webdriver.promise.Promise

The assertion result.


isNull(opt_message)code »

Asserts that the wrapped value is null.

Defined by: webdriver.testing.Assertion

Parameters
opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


isNullOrUndefined(opt_message)code »

Asserts that the wrapped value is null or undefined.

Defined by: webdriver.testing.Assertion

Parameters
opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


isTrue()code »

Asserts that the value managed by this assertion is strictly true.

Defined by: webdriver.testing.Assertion

Returns
webdriver.promise.Promise

The assertion result.


isUndefined(opt_message)code »

Asserts that the wrapped value is undefined.

Defined by: webdriver.testing.Assertion

Parameters
opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


lessThan(value, opt_message)code »

Asserts that the value managed by this assertion is a number strictly less than the given value.

Defined by: webdriver.testing.Assertion

Parameters
valuenumber

The maximum value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


lessThanEqualTo(value, opt_message)code »

Asserts that the value managed by this assertion is a number <= the given value.

Defined by: webdriver.testing.Assertion

Parameters
valuenumber

The maximum value.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


matches(regex, opt_message)code »

Asserts that the wrapped value is a string that matches the given RegExp.

Defined by: webdriver.testing.Assertion

Parameters
regexRegExp

The regex to test.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.


startsWith(prefix, opt_message)code »

Asserts that the wrapped value is a string starting with the given prefix.

Defined by: webdriver.testing.Assertion

Parameters
prefixstring

The expected prefix.

opt_messagestring=

A message to include if the matcher does not accept the value wrapped by this assertion.

Returns
webdriver.promise.Promise

The assertion result.

Instance Properties

iswebdriver.testing.Assertion

A self reference provided for writing fluent assertions: webdriver.testing.assert(x).is.equalTo(y);

notwebdriver.testing.NegatedAssertion

Negates any matchers applied to this instance's value: webdriver.testing.assert(x).not.equalTo(y);

value*
No description.