Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit dac6e6e

Browse files
committed
Add launch naked test
I tried, but I couldn't test this from the Go side. Nevertheless, this example shows users that they can launch a browser without providing any options. Also, our CI can detect if the feature works.
1 parent a1f1f6a commit dac6e6e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/launch_naked.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import exec from 'k6/execution';
2+
import { chromium } from 'k6/x/browser';
3+
4+
export const options = {}
5+
6+
export default function() {
7+
try {
8+
const browser = chromium.launch();
9+
browser.close();
10+
} catch (e) {
11+
// The test should not fail when launching the browser without
12+
// options. Try catch is used to report the error to the shell.
13+
exec.test.abort(e);
14+
}
15+
}

0 commit comments

Comments
 (0)