backstage
/
playwright.config.ts
67 строк · 1.9 Кб
1/*
2* Copyright 2023 The Backstage Authors
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8* http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17import { defineConfig } from '@playwright/test';
18import { generateProjects } from '@backstage/e2e-test-utils/playwright';
19
20/**
21* See https://playwright.dev/docs/test-configuration.
22*/
23export default defineConfig({
24timeout: 30_000,
25
26expect: {
27timeout: 5_000,
28},
29
30// Run your local dev server before starting the tests
31webServer: process.env.CI
32? []
33: [
34{
35command: 'yarn start',
36port: 3000,
37reuseExistingServer: true,
38timeout: 60_000,
39},
40// TODO: Before encouraging e2e tests for backend we'll want to provide better utilities for mocking auth
41// {
42// command: 'yarn start-backend',
43// port: 7007,
44// reuseExistingServer: true,
45// timeout: 60_000,
46// },
47],
48
49forbidOnly: !!process.env.CI,
50
51retries: process.env.CI ? 2 : 0,
52
53reporter: [['html', { open: 'never', outputFolder: 'e2e-test-report' }]],
54
55use: {
56actionTimeout: 0,
57baseURL:
58process.env.PLAYWRIGHT_URL ??
59(process.env.CI ? 'http://localhost:7007' : 'http://localhost:3000'),
60screenshot: 'only-on-failure',
61trace: 'on-first-retry',
62},
63
64outputDir: 'node_modules/.cache/e2e-test-results',
65
66projects: generateProjects(), // Find all packages with e2e-test folders
67});
68