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

Commit f933c5e

Browse files
committed
Add launch options on cloud test
1 parent acac8b9 commit f933c5e

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

common/browser_options_test.go

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
1515
t.Parallel()
1616

1717
for name, tt := range map[string]struct {
18-
opts map[string]any
19-
assert func(testing.TB, *LaunchOptions)
20-
err string
18+
opts map[string]any
19+
assert func(testing.TB, *LaunchOptions)
20+
err string
21+
onCloud bool
2122
}{
2223
"defaults": {
2324
opts: map[string]any{},
@@ -31,6 +32,24 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
3132
}, lo)
3233
},
3334
},
35+
"defaults_on_cloud": {
36+
onCloud: true,
37+
opts: map[string]any{
38+
"headless": false,
39+
"devtools": true,
40+
"executablePath": "something else",
41+
},
42+
assert: func(tb testing.TB, lo *LaunchOptions) {
43+
tb.Helper()
44+
assert.Equal(t, &LaunchOptions{
45+
Env: make(map[string]string),
46+
Headless: true,
47+
LogCategoryFilter: ".*",
48+
Timeout: DefaultTimeout,
49+
onCloud: true,
50+
}, lo)
51+
},
52+
},
3453
"nulls": { // don't override the defaults on `null`
3554
opts: map[string]any{
3655
"env": nil,
@@ -212,7 +231,7 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
212231
t.Parallel()
213232
var (
214233
vu = k6test.NewVU(t)
215-
lo = NewLaunchOptions(false)
234+
lo = NewLaunchOptions(tt.onCloud)
216235
)
217236
err := lo.Parse(vu.Context(), vu.ToGojaValue(tt.opts), log.NewNullLogger())
218237
if tt.err != "" {

0 commit comments

Comments
 (0)