Skip to content

Commit cbc8fa1

Browse files
feat(roll): roll to ToT Playwright (25-02-25) (#1683)
1 parent 7a0aec4 commit cbc8fa1

16 files changed

+44
-44
lines changed

dotnet/docs/api/class-locator.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,7 @@ This method expects [Locator] to point to an [input element](https://developer.m
21672167

21682168
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.14</font><x-search>locator.TapAsync</x-search>
21692169

2170-
Perform a tap gesture on the element matching the locator.
2170+
Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
21712171

21722172
**Usage**
21732173

dotnet/docs/api/class-touchscreen.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import HTMLCard from '@site/src/components/HTMLCard';
99

1010
The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
1111

12+
This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
13+
1214

1315
---
1416

dotnet/docs/network.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,13 @@ Playwright uses simplified glob patterns for URL matching in network interceptio
188188
- A double `**` matches any characters including `/`
189189
1. Question mark `?` matches any single character except `/`
190190
1. Curly braces `{}` can be used to match a list of options separated by commas `,`
191+
1. Square brackets `[]` can be used to match a set of characters
192+
1. Backslash `\` can be used to escape any of special characters (note to escape backslash itself as `\\`)
191193

192194
Examples:
193195
- `https://example.com/*.js` matches `https://example.com/file.js` but not `https://example.com/path/file.js`
196+
- `https://example.com/\\?page=1` matches `https://example.com/?page=1` but not `https://example.com`
197+
- `**/v[0-9]*` matches `https://example.com/v1/` but not `https://example.com/vote/`
194198
- `**/*.js` matches both `https://example.com/file.js` and `https://example.com/path/file.js`
195199
- `**/*.{png,jpg,jpeg}` matches all image requests
196200

dotnet/docs/touch-events.mdx

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
---
22
id: touch-events
3-
title: "Emulating touch events"
3+
title: "Emulating legacy touch events"
44
---
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
77
import HTMLCard from '@site/src/components/HTMLCard';
88

99
## Introduction
1010

11-
Mobile web sites may listen to [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and react to user touch gestures such as swipe, pinch, tap etc. To test this functionality you can manually generate [TouchEvent]s in the page context using [Locator.EvaluateAsync()](/api/class-locator.mdx#locator-evaluate).
11+
Web applications that handle [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) to respond to gestures like swipe, pinch, and tap can be tested by manually dispatching [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)s to the page. The examples below demonstrate how to use [Locator.DispatchEventAsync()](/api/class-locator.mdx#locator-dispatch-event) and pass [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points as arguments.
1212

13-
If your web application relies on [pointer events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) instead of touch events, you can use [Locator.ClickAsync()](/api/class-locator.mdx#locator-click) and raw [`Mouse`] events to simulate a single-finger touch, and this will trigger all the same pointer events.
14-
15-
### Dispatching TouchEvent
16-
17-
You can dispatch touch events to the page using [Locator.DispatchEventAsync()](/api/class-locator.mdx#locator-dispatch-event). [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points can be passed as arguments, see examples below.
18-
19-
#### Emulating pan gesture
13+
### Emulating pan gesture
2014

2115
In the example below, we emulate pan gesture that is expected to move the map. The app under test only uses `clientX/clientY` coordinates of the touch point, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2216

23-
#### Emulating pinch gesture
17+
### Emulating pinch gesture
2418

2519
In the example below, we emulate pinch gesture, i.e. two touch points moving closer to each other. It is expected to zoom out the map. The app under test only uses `clientX/clientY` coordinates of touch points, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2620

java/docs/api/class-locator.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ This method expects [Locator] to point to an [input element](https://developer.m
21652165

21662166
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.14</font><x-search>locator.tap</x-search>
21672167

2168-
Perform a tap gesture on the element matching the locator.
2168+
Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
21692169

21702170
**Usage**
21712171

java/docs/api/class-touchscreen.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import HTMLCard from '@site/src/components/HTMLCard';
99

1010
The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
1111

12+
This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
13+
1214

1315
---
1416

java/docs/network.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,13 @@ Playwright uses simplified glob patterns for URL matching in network interceptio
183183
- A double `**` matches any characters including `/`
184184
1. Question mark `?` matches any single character except `/`
185185
1. Curly braces `{}` can be used to match a list of options separated by commas `,`
186+
1. Square brackets `[]` can be used to match a set of characters
187+
1. Backslash `\` can be used to escape any of special characters (note to escape backslash itself as `\\`)
186188

187189
Examples:
188190
- `https://example.com/*.js` matches `https://example.com/file.js` but not `https://example.com/path/file.js`
191+
- `https://example.com/\\?page=1` matches `https://example.com/?page=1` but not `https://example.com`
192+
- `**/v[0-9]*` matches `https://example.com/v1/` but not `https://example.com/vote/`
189193
- `**/*.js` matches both `https://example.com/file.js` and `https://example.com/path/file.js`
190194
- `**/*.{png,jpg,jpeg}` matches all image requests
191195

java/docs/touch-events.mdx

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
---
22
id: touch-events
3-
title: "Emulating touch events"
3+
title: "Emulating legacy touch events"
44
---
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
77
import HTMLCard from '@site/src/components/HTMLCard';
88

99
## Introduction
1010

11-
Mobile web sites may listen to [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and react to user touch gestures such as swipe, pinch, tap etc. To test this functionality you can manually generate [TouchEvent]s in the page context using [Locator.evaluate()](/api/class-locator.mdx#locator-evaluate).
11+
Web applications that handle [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) to respond to gestures like swipe, pinch, and tap can be tested by manually dispatching [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)s to the page. The examples below demonstrate how to use [Locator.dispatchEvent()](/api/class-locator.mdx#locator-dispatch-event) and pass [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points as arguments.
1212

13-
If your web application relies on [pointer events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) instead of touch events, you can use [Locator.click()](/api/class-locator.mdx#locator-click) and raw [`Mouse`] events to simulate a single-finger touch, and this will trigger all the same pointer events.
14-
15-
### Dispatching TouchEvent
16-
17-
You can dispatch touch events to the page using [Locator.dispatchEvent()](/api/class-locator.mdx#locator-dispatch-event). [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points can be passed as arguments, see examples below.
18-
19-
#### Emulating pan gesture
13+
### Emulating pan gesture
2014

2115
In the example below, we emulate pan gesture that is expected to move the map. The app under test only uses `clientX/clientY` coordinates of the touch point, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2216

23-
#### Emulating pinch gesture
17+
### Emulating pinch gesture
2418

2519
In the example below, we emulate pinch gesture, i.e. two touch points moving closer to each other. It is expected to zoom out the map. The app under test only uses `clientX/clientY` coordinates of touch points, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2620

nodejs/docs/api/class-locator.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,7 @@ This method expects [Locator] to point to an [input element](https://developer.m
21752175

21762176
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.14</font><x-search>locator.tap</x-search>
21772177

2178-
Perform a tap gesture on the element matching the locator.
2178+
Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
21792179

21802180
**Usage**
21812181

nodejs/docs/api/class-touchscreen.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import HTMLCard from '@site/src/components/HTMLCard';
99

1010
The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
1111

12+
This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
13+
1214

1315
---
1416

nodejs/docs/network.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,13 @@ Playwright uses simplified glob patterns for URL matching in network interceptio
302302
- A double `**` matches any characters including `/`
303303
1. Question mark `?` matches any single character except `/`
304304
1. Curly braces `{}` can be used to match a list of options separated by commas `,`
305+
1. Square brackets `[]` can be used to match a set of characters
306+
1. Backslash `\` can be used to escape any of special characters (note to escape backslash itself as `\\`)
305307

306308
Examples:
307309
- `https://example.com/*.js` matches `https://example.com/file.js` but not `https://example.com/path/file.js`
310+
- `https://example.com/\\?page=1` matches `https://example.com/?page=1` but not `https://example.com`
311+
- `**/v[0-9]*` matches `https://example.com/v1/` but not `https://example.com/vote/`
308312
- `**/*.js` matches both `https://example.com/file.js` and `https://example.com/path/file.js`
309313
- `**/*.{png,jpg,jpeg}` matches all image requests
310314

nodejs/docs/touch-events.mdx

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
---
22
id: touch-events
3-
title: "Emulating touch events"
3+
title: "Emulating legacy touch events"
44
---
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
77
import HTMLCard from '@site/src/components/HTMLCard';
88

99
## Introduction
1010

11-
Mobile web sites may listen to [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and react to user touch gestures such as swipe, pinch, tap etc. To test this functionality you can manually generate [TouchEvent]s in the page context using [locator.evaluate()](/api/class-locator.mdx#locator-evaluate).
11+
Web applications that handle [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) to respond to gestures like swipe, pinch, and tap can be tested by manually dispatching [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)s to the page. The examples below demonstrate how to use [locator.dispatchEvent()](/api/class-locator.mdx#locator-dispatch-event) and pass [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points as arguments.
1212

13-
If your web application relies on [pointer events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) instead of touch events, you can use [locator.click()](/api/class-locator.mdx#locator-click) and raw [`Mouse`] events to simulate a single-finger touch, and this will trigger all the same pointer events.
14-
15-
### Dispatching TouchEvent
16-
17-
You can dispatch touch events to the page using [locator.dispatchEvent()](/api/class-locator.mdx#locator-dispatch-event). [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points can be passed as arguments, see examples below.
18-
19-
#### Emulating pan gesture
13+
### Emulating pan gesture
2014

2115
In the example below, we emulate pan gesture that is expected to move the map. The app under test only uses `clientX/clientY` coordinates of the touch point, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2216

@@ -72,7 +66,7 @@ test(`pan gesture to move the map`, async ({ page }) => {
7266
});
7367
```
7468
75-
#### Emulating pinch gesture
69+
### Emulating pinch gesture
7670
7771
In the example below, we emulate pinch gesture, i.e. two touch points moving closer to each other. It is expected to zoom out the map. The app under test only uses `clientX/clientY` coordinates of touch points, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
7872

python/docs/api/class-locator.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2969,7 +2969,7 @@ This method expects [Locator] to point to an [input element](https://developer.m
29692969

29702970
<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.14</font><x-search>locator.tap</x-search>
29712971

2972-
Perform a tap gesture on the element matching the locator.
2972+
Perform a tap gesture on the element matching the locator. For examples of emulating other gestures by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
29732973

29742974
**Usage**
29752975

python/docs/api/class-touchscreen.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import HTMLCard from '@site/src/components/HTMLCard';
99

1010
The Touchscreen class operates in main-frame CSS pixels relative to the top-left corner of the viewport. Methods on the touchscreen can only be used in browser contexts that have been initialized with `hasTouch` set to true.
1111

12+
This class is limited to emulating tap gestures. For examples of other gestures simulated by manually dispatching touch events, see the [emulating legacy touch events](../touch-events.mdx) page.
13+
1214

1315
---
1416

python/docs/network.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,13 @@ Playwright uses simplified glob patterns for URL matching in network interceptio
466466
- A double `**` matches any characters including `/`
467467
1. Question mark `?` matches any single character except `/`
468468
1. Curly braces `{}` can be used to match a list of options separated by commas `,`
469+
1. Square brackets `[]` can be used to match a set of characters
470+
1. Backslash `\` can be used to escape any of special characters (note to escape backslash itself as `\\`)
469471

470472
Examples:
471473
- `https://example.com/*.js` matches `https://example.com/file.js` but not `https://example.com/path/file.js`
474+
- `https://example.com/\\?page=1` matches `https://example.com/?page=1` but not `https://example.com`
475+
- `**/v[0-9]*` matches `https://example.com/v1/` but not `https://example.com/vote/`
472476
- `**/*.js` matches both `https://example.com/file.js` and `https://example.com/path/file.js`
473477
- `**/*.{png,jpg,jpeg}` matches all image requests
474478

python/docs/touch-events.mdx

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
---
22
id: touch-events
3-
title: "Emulating touch events"
3+
title: "Emulating legacy touch events"
44
---
55
import Tabs from '@theme/Tabs';
66
import TabItem from '@theme/TabItem';
77
import HTMLCard from '@site/src/components/HTMLCard';
88

99
## Introduction
1010

11-
Mobile web sites may listen to [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) and react to user touch gestures such as swipe, pinch, tap etc. To test this functionality you can manually generate [TouchEvent]s in the page context using [locator.evaluate()](/api/class-locator.mdx#locator-evaluate).
11+
Web applications that handle [touch events](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events) to respond to gestures like swipe, pinch, and tap can be tested by manually dispatching [TouchEvent](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/TouchEvent)s to the page. The examples below demonstrate how to use [locator.dispatch_event()](/api/class-locator.mdx#locator-dispatch-event) and pass [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points as arguments.
1212

13-
If your web application relies on [pointer events](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) instead of touch events, you can use [locator.click()](/api/class-locator.mdx#locator-click) and raw [`Mouse`] events to simulate a single-finger touch, and this will trigger all the same pointer events.
14-
15-
### Dispatching TouchEvent
16-
17-
You can dispatch touch events to the page using [locator.dispatch_event()](/api/class-locator.mdx#locator-dispatch-event). [Touch](https://developer.mozilla.org/en-US/docs/Web/API/Touch) points can be passed as arguments, see examples below.
18-
19-
#### Emulating pan gesture
13+
### Emulating pan gesture
2014

2115
In the example below, we emulate pan gesture that is expected to move the map. The app under test only uses `clientX/clientY` coordinates of the touch point, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2216

23-
#### Emulating pinch gesture
17+
### Emulating pinch gesture
2418

2519
In the example below, we emulate pinch gesture, i.e. two touch points moving closer to each other. It is expected to zoom out the map. The app under test only uses `clientX/clientY` coordinates of touch points, so we initialize just that. In a more complex scenario you may need to also set `pageX/pageY/screenX/screenY`, if your app needs them.
2620

0 commit comments

Comments
 (0)