@@ -21684,7 +21684,7 @@ async def not_to_contain_text(
2168421684 async def to_have_attribute(
2168521685 self,
2168621686 name: str,
21687- value: typing.Union[str, typing.Pattern[str]] ,
21687+ value: typing.Optional[typing. Union[typing.Pattern[str], str]] = None ,
2168821688 *,
2168921689 ignore_case: typing.Optional[bool] = None,
2169021690 timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
@@ -21700,14 +21700,16 @@ async def to_have_attribute(
2170021700
2170121701 locator = page.locator(\"input\")
2170221702 await expect(locator).to_have_attribute(\"type\", \"text\")
21703+ await expect(locator).to_have_attribute(\"disabled\")
21704+ await expect(locator).not_to_have_attribute(\"readonly\")
2170321705 ```
2170421706
2170521707 Parameters
2170621708 ----------
2170721709 name : str
2170821710 Attribute name.
21709- value : Union[Pattern[str], str]
21710- Expected attribute value.
21711+ value : Union[Pattern[str], str, None ]
21712+ Expected attribute value. If not specified, the assertion verifies that the attribute is present.
2171121713 ignore_case : Union[bool, None]
2171221714 Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular
2171321715 expression flag if specified.
@@ -21728,7 +21730,7 @@ async def to_have_attribute(
2172821730 async def not_to_have_attribute(
2172921731 self,
2173021732 name: str,
21731- value: typing.Union[str, typing.Pattern[str]] ,
21733+ value: typing.Optional[typing. Union[typing.Pattern[str], str]] = None ,
2173221734 *,
2173321735 ignore_case: typing.Optional[bool] = None,
2173421736 timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
@@ -21741,8 +21743,8 @@ async def not_to_have_attribute(
2174121743 ----------
2174221744 name : str
2174321745 Attribute name.
21744- value : Union[Pattern[str], str]
21745- Expected attribute value.
21746+ value : Union[Pattern[str], str, None ]
21747+ Expected attribute value. If not specified, the assertion verifies that the attribute is absent.
2174621748 ignore_case : Union[bool, None]
2174721749 Whether to perform case-insensitive match. `ignoreCase` option takes precedence over the corresponding regular
2174821750 expression flag if specified.
0 commit comments