Skip to content

Commit c982c23

Browse files
committed
Remove {{ code }} since all examples are in one..
... language.
1 parent 0a716c9 commit c982c23

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

docs/sources/k6/next/javascript-api/k6-browser/page/waitforurl.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ Events can be either:
4040

4141
### Examples
4242

43-
{{< code >}}
44-
4543
<!-- md-k6:skip -->
4644

4745
```javascript
@@ -82,14 +80,10 @@ export default async function () {
8280
}
8381
```
8482

85-
{{< /code >}}
86-
8783
### Valid usage patterns for waitForURL
8884

8985
Use one of the following patterns to coordinate the action that triggers navigation with waiting for the final URL.
9086

91-
{{< code >}}
92-
9387
<!-- eslint-skip -->
9488

9589
```js
@@ -99,12 +93,8 @@ await Promise.all([
9993
]);
10094
```
10195

102-
{{< /code >}}
103-
10496
or
10597

106-
{{< code >}}
107-
10898
<!-- eslint-skip -->
10999

110100
```js
@@ -113,21 +103,15 @@ await page.locator('a[href="/my_messages.php"]').click();
113103
await navPromise;
114104
```
115105

116-
{{< /code >}}
117-
118106
Unlike [waitForNavigation](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-browser/page/waitfornavigation), `waitForURL` will first check whether it is already on the page with the given URL before proceeding to wait. If it is already there and the `waitUntil` condition has also been met, it will return straight away. This means that it is safe to do this:
119107

120-
{{< code >}}
121-
122108
<!-- eslint-skip -->
123109

124110
```js
125111
await page.locator('a[href="/my_messages.php"]').click();
126112
await page.waitForURL('https://quickpizza.grafana.com/my_messages.php');
127113
```
128114

129-
{{< /code >}}
130-
131115
### Best practices
132116

133117
1. **Use appropriate matching**: Choose the right matching method based on your needs:

0 commit comments

Comments
 (0)