@@ -11244,7 +11244,8 @@ def launch_persistent_context(
11244
11244
Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for
11245
11245
[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and
11246
11246
[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's user
11247
- data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`.
11247
+ data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`. Pass an empty string to use
11248
+ a temporary directory instead.
11248
11249
channel : Union[str, NoneType]
11249
11250
Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge",
11250
11251
"msedge-beta", "msedge-dev", "msedge-canary". Read more about using
@@ -13074,6 +13075,46 @@ def all_text_contents(self) -> typing.List[str]:
13074
13075
self._sync("locator.all_text_contents", self._impl_obj.all_text_contents())
13075
13076
)
13076
13077
13078
+ def wait_for(
13079
+ self,
13080
+ *,
13081
+ timeout: float = None,
13082
+ state: Literal["attached", "detached", "hidden", "visible"] = None
13083
+ ) -> NoneType:
13084
+ """Locator.wait_for
13085
+
13086
+ Returns when element specified by locator satisfies the `state` option.
13087
+
13088
+ If target element already satisfies the condition, the method returns immediately. Otherwise, waits for up to `timeout`
13089
+ milliseconds until the condition is met.
13090
+
13091
+ ```py
13092
+ order_sent = page.locator(\"#order-sent\")
13093
+ order_sent.wait_for()
13094
+ ```
13095
+
13096
+ Parameters
13097
+ ----------
13098
+ timeout : Union[float, NoneType]
13099
+ Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
13100
+ using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.
13101
+ state : Union["attached", "detached", "hidden", "visible", NoneType]
13102
+ Defaults to `'visible'`. Can be either:
13103
+ - `'attached'` - wait for element to be present in DOM.
13104
+ - `'detached'` - wait for element to not be present in DOM.
13105
+ - `'visible'` - wait for element to have non-empty bounding box and no `visibility:hidden`. Note that element without
13106
+ any content or with `display:none` has an empty bounding box and is not considered visible.
13107
+ - `'hidden'` - wait for element to be either detached from DOM, or have an empty bounding box or `visibility:hidden`.
13108
+ This is opposite to the `'visible'` option.
13109
+ """
13110
+
13111
+ return mapping.from_maybe_impl(
13112
+ self._sync(
13113
+ "locator.wait_for",
13114
+ self._impl_obj.wait_for(timeout=timeout, state=state),
13115
+ )
13116
+ )
13117
+
13077
13118
def set_checked(
13078
13119
self,
13079
13120
checked: bool,
0 commit comments