|
| 1 | +/** |
| 2 | + * Copyright 2025 Adobe. All rights reserved. |
| 3 | + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. You may obtain a copy |
| 5 | + * of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under |
| 8 | + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS |
| 9 | + * OF ANY KIND, either express or implied. See the License for the specific language |
| 10 | + * governing permissions and limitations under the License. |
| 11 | + */ |
| 12 | + |
| 13 | +import type { PlaywrightTestConfig } from '@playwright/test'; |
| 14 | +import { devices } from '@playwright/test'; |
| 15 | + |
| 16 | +const config: PlaywrightTestConfig = { |
| 17 | + timeout: 30 * 1000, |
| 18 | + fullyParallel: true, |
| 19 | + forbidOnly: !!process.env.CI, |
| 20 | + retries: process.env.CI ? 2 : 0, |
| 21 | + reporter: [ |
| 22 | + ['html', { outputFolder: 'test/playwright-a11y/report' }], |
| 23 | + ['list'], |
| 24 | + ], |
| 25 | + |
| 26 | + use: { |
| 27 | + trace: 'on-first-retry', |
| 28 | + screenshot: 'only-on-failure', |
| 29 | + reducedMotion: 'reduce', |
| 30 | + }, |
| 31 | + |
| 32 | + projects: [ |
| 33 | + { |
| 34 | + name: '1st-gen', |
| 35 | + testDir: './', |
| 36 | + testMatch: '**/packages/*/test/**/*.a11y.spec.ts', |
| 37 | + use: { |
| 38 | + ...devices['Desktop Chrome'], |
| 39 | + baseURL: 'http://localhost:8080', |
| 40 | + }, |
| 41 | + }, |
| 42 | + { |
| 43 | + name: '2nd-gen', |
| 44 | + testDir: '../second-gen/', |
| 45 | + testMatch: '**/packages/swc/components/*/test/**/*.a11y.spec.ts', |
| 46 | + use: { |
| 47 | + ...devices['Desktop Chrome'], |
| 48 | + baseURL: 'http://localhost:6006', |
| 49 | + }, |
| 50 | + }, |
| 51 | + ], |
| 52 | + |
| 53 | + webServer: [ |
| 54 | + { |
| 55 | + command: 'yarn storybook', |
| 56 | + port: 8080, |
| 57 | + reuseExistingServer: !process.env.CI, |
| 58 | + timeout: 120 * 1000, |
| 59 | + }, |
| 60 | + { |
| 61 | + command: 'cd ../second-gen/packages/swc && yarn storybook', |
| 62 | + port: 6006, |
| 63 | + reuseExistingServer: !process.env.CI, |
| 64 | + timeout: 120 * 1000, |
| 65 | + }, |
| 66 | + ], |
| 67 | +}; |
| 68 | + |
| 69 | +export default config; |
0 commit comments