Appearance
UI.doesNotHaveClass()
Asserts that an element does not have the specified CSS class.
If the element has the class, the assertion fails and the test will fail.
Usage
js
UI.doesNotHaveClass(element: string, className: string)Parameters
| Parameter | Type | Description |
|---|---|---|
element | string | Element to target — by CSS or XPath selector. |
className | string | CSS class name that must not be present (without the leading .) |
Example
js
I.click("Next")
UI.doesNotHaveClass("#checkout-form", "has-error")In this example, the test asserts that the #checkout-form element does not have the has-error CSS class.