(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func 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 | |
| 85 | func TestDriverInstall(t *testing.T) { |
| 86 | driverPath := t.TempDir() |
nothing calls this directly
no test coverage detected