Skip to content

Commit c6ac315

Browse files
committed
Update import URL to be dynamic
1 parent 157c48a commit c6ac315

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/sources/k6/v1.3.x/using-k6-browser/migrate-from-playwright-to-k6.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test('has title', async ({ page }) => {
3939
Create a new file named `pw-migrated.js` and copy the following initial k6 script setup:
4040

4141
```js
42-
import { expect } from "https://jslib.k6.io/k6-testing/0.6.0/index.js";
42+
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
4343
import { browser } from 'k6/browser';
4444

4545
export const options = {
@@ -67,7 +67,7 @@ k6 browser doesn't implement a `test` framework. Instead, the logic of test is h
6767
Next, copy the contents from the `test()` function from the Playwright script into the k6 `default async function ()`.
6868

6969
```js
70-
import { expect } from "https://jslib.k6.io/k6-testing/0.6.0/index.js";
70+
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
7171
import { browser } from 'k6/browser';
7272

7373
export const options = {
@@ -94,7 +94,7 @@ export default async function () {
9494
k6 doesn't implement fixtures like Playwright does. Instead, use the `browser` class to retrieve a `page` within its own context. After that, you can use the usual `page` methods such as `goto` or `click`:
9595

9696
```js
97-
import { expect } from "https://jslib.k6.io/k6-testing/0.6.0/index.js";
97+
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
9898
import { browser } from 'k6/browser';
9999

100100
export const options = {
@@ -219,7 +219,7 @@ To convert this Playwright script to k6, create a new file named `pw-migrated.js
219219
First, create two `scenarios` and point them to two exported functions using the `exec` field in each scenario:
220220
221221
```js
222-
import { expect } from "https://jslib.k6.io/k6-testing/0.6.0/index.js";
222+
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
223223
import { browser } from 'k6/browser';
224224

225225
export const options = {
@@ -257,7 +257,7 @@ export async function userLogin() {
257257
Next, copy the test code into the respective exported functions. Since k6 doesn't have fixtures, use the imported `browser` class to create a `newPage`:
258258
259259
```js
260-
import { expect } from "https://jslib.k6.io/k6-testing/0.6.0/index.js";
260+
import { expect } from 'https://jslib.k6.io/k6-testing/{{< param "JSLIB_TESTING_VERSION" >}}/index.js';
261261
import { browser } from 'k6/browser';
262262
263263
export const options = {

0 commit comments

Comments
 (0)