2022-09-28 15:13:33 +00:00
|
|
|
// NOTE: Sometimes, tests fail with `TypeError: process.stdout.clearLine is not a function`
|
|
|
|
// for some reason. This comes from Vite, and is conditionally called based on `isTTY`.
|
|
|
|
// We set it to false here to skip this odd behavior.
|
|
|
|
process.stdout.isTTY = false;
|
2022-05-23 16:56:45 +00:00
|
|
|
|
|
|
|
const config = {
|
|
|
|
testMatch: 'e2e/*.test.js',
|
|
|
|
/* Maximum time one test can run for. */
|
2022-10-06 20:32:37 +00:00
|
|
|
timeout: 40 * 1000,
|
2022-05-23 16:57:55 +00:00
|
|
|
expect: {
|
|
|
|
/**
|
|
|
|
* Maximum time expect() should wait for the condition to be met.
|
|
|
|
* For example in `await expect(locator).toHaveText();`
|
|
|
|
*/
|
2022-10-06 20:32:37 +00:00
|
|
|
timeout: 4 * 1000,
|
2022-05-23 16:57:55 +00:00
|
|
|
},
|
|
|
|
/* Fail the build on CI if you accidentally left test in the source code. */
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
/* Retry on CI only */
|
2022-07-19 21:47:31 +00:00
|
|
|
retries: process.env.CI ? 3 : 0,
|
2022-05-23 16:57:55 +00:00
|
|
|
/* Opt out of parallel tests on CI. */
|
2022-06-06 18:39:48 +00:00
|
|
|
workers: 1,
|
2022-05-23 16:57:55 +00:00
|
|
|
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
|
|
use: {
|
|
|
|
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
|
|
|
actionTimeout: 0,
|
|
|
|
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
|
|
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000',
|
2022-05-23 16:56:45 +00:00
|
|
|
|
2022-05-23 16:57:55 +00:00
|
|
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
|
|
trace: 'on-first-retry',
|
|
|
|
},
|
|
|
|
projects: [
|
|
|
|
{
|
|
|
|
name: 'Chrome Stable',
|
|
|
|
use: {
|
|
|
|
browserName: 'chromium',
|
|
|
|
channel: 'chrome',
|
2022-07-19 21:49:29 +00:00
|
|
|
args: ['--use-gl=egl'],
|
2022-05-23 16:57:55 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2022-05-23 16:56:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|