Pop-up dictionary browser extension for language learning. Successor to Yomichan. (PERSONAL FORK)
at lambda-fork/main 121 lines 3.9 kB view raw
1/* 2 * Copyright (C) 2023-2025 Yomitan Authors 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <https://www.gnu.org/licenses/>. 16 */ 17 18// @ts-check 19import {defineConfig, devices} from '@playwright/test'; 20/** 21 * Read environment variables from file. 22 * https://github.com/motdotla/dotenv 23 */ 24import 'dotenv/config'; 25 26/** 27 * @see https://playwright.dev/docs/test-configuration 28 */ 29export default defineConfig({ 30 testDir: './test/playwright', 31 snapshotPathTemplate: '{testDir}/__screenshots__/{testFilePath}/{arg}{ext}', 32 /* Maximum time one test can run for. */ 33 timeout: 60 * 60 * 1000, 34 expect: { 35 /** 36 * Maximum time expect() should wait for the condition to be met. 37 * For example in `await expect(locator).toHaveText();` 38 */ 39 timeout: 5000, 40 }, 41 /* Run tests in files in parallel */ 42 fullyParallel: true, 43 /* Fail the build on CI if you accidentally left test.only in the source code. */ 44 forbidOnly: !!process.env.CI, 45 /* Retry on CI only */ 46 retries: process.env.CI ? 2 : 0, 47 /* Opt out of parallel tests on CI. */ 48 workers: process.env.CI ? 1 : void 0, 49 /* Reporter to use. See https://playwright.dev/docs/test-reporters */ 50 reporter: process.env.CI ? 'blob' : 'html', 51 /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ 52 use: { 53 /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ 54 actionTimeout: 60 * 1000, 55 /* Base URL to use in actions like `await page.goto('/')`. */ 56 // baseURL: 'http://localhost:3000', 57 58 /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ 59 trace: 'on-first-retry', 60 }, 61 62 /* Configure projects for major browsers */ 63 projects: [ 64 { 65 name: 'playwright setup', 66 testMatch: /global\.setup\.js/, 67 teardown: 'playwright teardown', 68 }, 69 { 70 name: 'playwright teardown', 71 testMatch: /global\.teardown\.js/, 72 }, 73 { 74 name: 'chromium', 75 use: { 76 ...devices['Desktop Chrome'], 77 channel: 'chromium', 78 }, 79 dependencies: ['playwright setup'], 80 }, 81 82 // { 83 // name: 'firefox', 84 // use: { ...devices['Desktop Firefox'] }, 85 // }, 86 87 // { 88 // name: 'webkit', 89 // use: { ...devices['Desktop Safari'] }, 90 // }, 91 92 /* Test against mobile viewports. */ 93 // { 94 // name: 'Mobile Chrome', 95 // use: { ...devices['Pixel 5'] }, 96 // }, 97 // { 98 // name: 'Mobile Safari', 99 // use: { ...devices['iPhone 12'] }, 100 // }, 101 102 /* Test against branded browsers. */ 103 // { 104 // name: 'Microsoft Edge', 105 // use: { channel: 'msedge' }, 106 // }, 107 // { 108 // name: 'Google Chrome', 109 // use: { channel: 'chrome' }, 110 // }, 111 ], 112 113 /* Folder for test artifacts such as screenshots, videos, traces, etc. */ 114 // outputDir: 'test-results/', 115 116 /* Run your local dev server before starting the tests */ 117 // webServer: { 118 // command: 'npm run start', 119 // port: 3000, 120 // }, 121});