mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
31 lines
1.6 KiB
Markdown
31 lines
1.6 KiB
Markdown
![]() |
---
|
||
|
id: test-assertions
|
||
|
title: "Assertions"
|
||
|
---
|
||
|
|
||
|
## List of assertions
|
||
|
|
||
|
| Assertion | Description |
|
||
|
| :- | :- |
|
||
|
| [`method: LocatorAssertions.toBeChecked`] | Checkbox is checked |
|
||
|
| [`method: LocatorAssertions.toBeDisabled`] | Element is disabled |
|
||
|
| [`method: LocatorAssertions.toBeEditable`] | Element is enabled |
|
||
|
| [`method: LocatorAssertions.toBeEmpty`] | Container is empty |
|
||
|
| [`method: LocatorAssertions.toBeEnabled`] | Element is enabled |
|
||
|
| [`method: LocatorAssertions.toBeFocused`] | Element is focused |
|
||
|
| [`method: LocatorAssertions.toBeHidden`] | Element is not visible |
|
||
|
| [`method: LocatorAssertions.toBeVisible`] | Element is visible |
|
||
|
| [`method: LocatorAssertions.toContainText`] | Element contains text |
|
||
|
| [`method: LocatorAssertions.toHaveAttribute`] | Element has a DOM attribute |
|
||
|
| [`method: LocatorAssertions.toHaveClass`] | Element has a class property |
|
||
|
| [`method: LocatorAssertions.toHaveCount`] | List has exact number of children |
|
||
|
| [`method: LocatorAssertions.toHaveCSS`] | Element has CSS property |
|
||
|
| [`method: LocatorAssertions.toHaveId`] | Element has an ID |
|
||
|
| [`method: LocatorAssertions.toHaveJSProperty`] | Element has a JavaScript property |
|
||
|
| [`method: LocatorAssertions.toHaveText`] | Element matches text |
|
||
|
| [`method: LocatorAssertions.toHaveValue`] | Input has a value |
|
||
|
| [`method: LocatorAssertions.toHaveValues`] | Select has options selected |
|
||
|
| [`method: PageAssertions.toHaveTitle`] | Page has a title |
|
||
|
| [`method: PageAssertions.toHaveURL`] | Page has a URL |
|
||
|
| [`method: APIResponseAssertions.toBeOK`] | Response has an OK status |
|