You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/api/class-locatorassertions.md
+16-6
Original file line number
Diff line number
Diff line change
@@ -1431,7 +1431,7 @@ Attribute name.
1431
1431
* langs:
1432
1432
- alias-java: hasClass
1433
1433
1434
-
Ensures the [Locator] points to an element with given CSS classes. When a string is provided, it must fully match the element's `class` attribute. To match individual classes or perform partial matches, use a regular expression:
1434
+
Ensures the [Locator] points to an element with given CSS classes. When a string is provided, it must fully match the element's `class` attribute. To match individual classes or perform partial matches use [`option: LocatorAssertions.toHaveClass.partial`].
1435
1435
1436
1436
**Usage**
1437
1437
@@ -1442,34 +1442,38 @@ Ensures the [Locator] points to an element with given CSS classes. When a string
When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected class values. Each element's class attribute is matched against the corresponding string or regular expression in the array:
@@ -1523,6 +1527,12 @@ Expected class or RegExp or a list of those.
1523
1527
1524
1528
Expected class or RegExp or a list of those.
1525
1529
1530
+
### option: LocatorAssertions.toHaveClass.partial
1531
+
* since: v1.52
1532
+
-`partial` <[boolean]>
1533
+
1534
+
Whether to perform a partial match, defaults to `false`. In an exact match, which is the default, the `className` attribute must be exactly the same as the asserted value. In a partial match, all classes from the asserted value, separated by spaces, must be present in the [Element.classList](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList) in any order. Partial match does not support a regular expression.
0 commit comments