MCPcopy
hub / github.com/mxschmitt/playwright-go / TestRunOptions_OnlyInstallShell

Function TestRunOptions_OnlyInstallShell

run_test.go:51–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestRunOptions_OnlyInstallShell(t *testing.T) {
52 if getBrowserName() != "chromium" {
53 t.Skip("chromium only")
54 return
55 }
56
57 r, w := io.Pipe()
58 var output string
59 wg := &sync.WaitGroup{}
60 readIOAsyncTilEOF(t, r, wg, &output)
61
62 driverPath := t.TempDir()
63 driver, err := NewDriver(&RunOptions{
64 Stdout: w,
65 DriverDirectory: driverPath,
66 Browsers: []string{getBrowserName()},
67 Verbose: true,
68 OnlyInstallShell: true,
69 DryRun: true,
70 })
71 require.NoError(t, err)
72 browserPath := t.TempDir()
73
74 t.Setenv("PLAYWRIGHT_BROWSERS_PATH", browserPath)
75
76 err = driver.Install()
77 require.NoError(t, err)
78 require.NoError(t, w.Close())
79 wg.Wait()
80
81 assert.Contains(t, output, "chromium-headless-shell")
82 assert.NotContains(t, output, "Chrome for Testing")
83}
84
85func TestDriverInstall(t *testing.T) {
86 driverPath := t.TempDir()

Callers

nothing calls this directly

Calls 6

readIOAsyncTilEOFFunction · 0.85
NewDriverFunction · 0.85
WaitMethod · 0.80
getBrowserNameFunction · 0.70
InstallMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected