mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 13:51:46 +00:00
This runs playwright tests with bazel. This changes how the app is served in the tests, specifically playwright will intercept all network calls to the local server and serve the static assets directly or serve root index.html file if nothing is matched. --------- Co-authored-by: bahrmichael <michael.bahr@sourcegraph.com> Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr> Co-authored-by: Michael Bahr <1830132+bahrmichael@users.noreply.github.com> Co-authored-by: Jean-Hadrien Chabran <jean-hadrien.chabran@sourcegraph.com> Co-authored-by: Camden Cheek <camden@ccheek.com>
29 lines
815 B
TypeScript
29 lines
815 B
TypeScript
import type { PlaywrightTestConfig } from '@playwright/test'
|
|
import { devices } from '@playwright/test'
|
|
|
|
const PORT = process.env.PORT ? Number(process.env.PORT) : 4173
|
|
|
|
const config: PlaywrightTestConfig = {
|
|
testMatch: 'src/**/*.spec.ts',
|
|
reporter: 'list',
|
|
// note: if you proxy into a locally running vite preview, you may have to raise this to 60 seconds
|
|
timeout: 5_000,
|
|
use: {
|
|
baseURL: `http://localhost:${PORT}`,
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
launchOptions: {
|
|
// When in CI, use bazel packaged linux chromium
|
|
executablePath: process.env.CHROMIUM_BIN,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
}
|
|
|
|
export default config
|