@@ -382,8 +382,8 @@ type BrowserContext interface {
382
382
// [this] issue. We recommend disabling Service Workers when
383
383
// using request interception by setting “[object Object]” to `block`.
384
384
//
385
- // 1. url: A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a “[object Object]” via the
386
- // context options was provided and the passed URL is a path , it gets merged via the
385
+ // 1. url: A glob pattern, regex pattern, or predicate that receives a [URL] to match during routing. If “[object Object]” is
386
+ // set in the context options and the provided URL is a string that does not start with `*` , it is resolved using the
387
387
// [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
388
388
// 2. handler: handler function to route the request.
389
389
//
@@ -529,11 +529,15 @@ type BrowserType interface {
529
529
// Launches browser that uses persistent storage located at “[object Object]” and returns the only context. Closing
530
530
// this context will automatically close the browser.
531
531
//
532
- // userDataDir: Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for
532
+ // userDataDir: Path to a User Data Directory, which stores browser session data like cookies and local storage. Pass an empty
533
+ // string to create a temporary directory.
534
+ //
535
+ // More details for
533
536
// [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and
534
- // [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's
535
- // user data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`. Pass an empty
536
- // string to use a temporary directory instead.
537
+ // [Firefox](https://wiki.mozilla.org/Firefox/CommandLineOptions#User_profile). Chromium's user data directory is the
538
+ // **parent** directory of the "Profile Path" seen at `chrome://version`.
539
+ //
540
+ // Note that browsers do not allow launching multiple instances with the same User Data Directory.
537
541
LaunchPersistentContext (userDataDir string , options ... BrowserTypeLaunchPersistentContextOptions ) (BrowserContext , error )
538
542
539
543
// Returns browser name. For example: `chromium`, `webkit` or `firefox`.
@@ -2906,6 +2910,16 @@ type LocatorAssertions interface {
2906
2910
// [visible]: https://playwright.dev/docs/actionability#visible
2907
2911
ToBeVisible (options ... LocatorAssertionsToBeVisibleOptions ) error
2908
2912
2913
+ // Ensures the [Locator] points to an element with given CSS classes. All classes from the asserted value, separated
2914
+ // by spaces, must be present in the
2915
+ // [Element.ClassList] in any order.
2916
+ //
2917
+ // expected: A string containing expected class names, separated by spaces, or a list of such strings to assert multiple
2918
+ // elements.
2919
+ //
2920
+ // [Element.ClassList]: https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
2921
+ ToContainClass (expected interface {}, options ... LocatorAssertionsToContainClassOptions ) error
2922
+
2909
2923
// Ensures the [Locator] points to an element that contains the given text. All nested elements will be considered
2910
2924
// when computing the text content of the element. You can use regular expressions for the value as well.
2911
2925
//
@@ -2948,7 +2962,7 @@ type LocatorAssertions interface {
2948
2962
ToHaveAttribute (name string , value interface {}, options ... LocatorAssertionsToHaveAttributeOptions ) error
2949
2963
2950
2964
// Ensures the [Locator] points to an element with given CSS classes. When a string is provided, it must fully match
2951
- // the element's `class` attribute. To match individual classes or perform partial matches, use a regular expression:
2965
+ // the element's `class` attribute. To match individual classes use [LocatorAssertions.ToContainClass].
2952
2966
//
2953
2967
// expected: Expected class or RegExp or a list of those.
2954
2968
ToHaveClass (expected interface {}, options ... LocatorAssertionsToHaveClassOptions ) error
@@ -3796,8 +3810,8 @@ type Page interface {
3796
3810
// using request interception by setting “[object Object]” to `block`.
3797
3811
// **NOTE** [Page.Route] will not intercept the first request of a popup page. Use [BrowserContext.Route] instead.
3798
3812
//
3799
- // 1. url: A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a “[object Object]” via the
3800
- // context options was provided and the passed URL is a path , it gets merged via the
3813
+ // 1. url: A glob pattern, regex pattern, or predicate that receives a [URL] to match during routing. If “[object Object]” is
3814
+ // set in the context options and the provided URL is a string that does not start with `*` , it is resolved using the
3801
3815
// [`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor.
3802
3816
// 2. handler: handler function to route the request.
3803
3817
//
@@ -4376,6 +4390,9 @@ type Route interface {
4376
4390
// over to redirected requests.
4377
4391
// [Route.Continue] will immediately send the request to the network, other matching handlers won't be invoked. Use
4378
4392
// [Route.Fallback] If you want next matching handler in the chain to be invoked.
4393
+ // **NOTE** The `Cookie` header cannot be overridden using this method. If a value is provided, it will be ignored,
4394
+ // and the cookie will be loaded from the browser's cookie store. To set custom cookies, use
4395
+ // [BrowserContext.AddCookies].
4379
4396
Continue (options ... RouteContinueOptions ) error
4380
4397
4381
4398
// Continues route's request with optional overrides. The method is similar to [Route.Continue] with the difference
0 commit comments