mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
test: add firefox to the list of browsers to test (#11036)
This commit is contained in:
parent
cf8dee4d62
commit
e90c98fea1
3 changed files with 48 additions and 3 deletions
|
@ -30,8 +30,8 @@
|
|||
"test:smoke:docs": "turbo run build --filter=docs",
|
||||
"test:check-examples": "node ./scripts/smoke/check.js",
|
||||
"test:vite-ci": "turbo run test --filter=astro",
|
||||
"test:e2e": "cd packages/astro && pnpm playwright install chromium && pnpm run test:e2e",
|
||||
"test:e2e:match": "cd packages/astro && pnpm playwright install chromium && pnpm run test:e2e:match",
|
||||
"test:e2e": "cd packages/astro && pnpm playwright install chromium firefox && pnpm run test:e2e",
|
||||
"test:e2e:match": "cd packages/astro && pnpm playwright install chromium firefox && pnpm run test:e2e:match",
|
||||
"test:e2e:hosts": "turbo run test:hosted",
|
||||
"benchmark": "astro-benchmark",
|
||||
"lint": "eslint . --report-unused-disable-directives",
|
||||
|
|
|
@ -112,8 +112,10 @@
|
|||
"postbuild": "astro-scripts copy \"src/**/*.astro\" && astro-scripts copy \"src/**/*.wasm\"",
|
||||
"test": "pnpm run test:node",
|
||||
"test:match": "pnpm run test:node --match",
|
||||
"test:e2e": "playwright test",
|
||||
"test:e2e": "pnpm test:e2e:chrome && pnpm test:e2e:firefox",
|
||||
"test:e2e:match": "playwright test -g",
|
||||
"test:e2e:chrome": "playwright test",
|
||||
"test:e2e:firefox": "playwright test --config playwright.firefox.config.js",
|
||||
"test:node": "astro-scripts test \"test/**/*.test.js\""
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
43
packages/astro/playwright.firefox.config.js
Normal file
43
packages/astro/playwright.firefox.config.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
// 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;
|
||||
|
||||
const config = {
|
||||
// TODO: add more tests like view transitions and audits, and fix them. Some of them are failing.
|
||||
testMatch: ['e2e/css.test.js'],
|
||||
/* Maximum time one test can run for. */
|
||||
timeout: 40 * 1000,
|
||||
expect: {
|
||||
/**
|
||||
* Maximum time expect() should wait for the condition to be met.
|
||||
* For example in `await expect(locator).toHaveText();`
|
||||
*/
|
||||
timeout: 4 * 1000,
|
||||
},
|
||||
/* Fail the build on CI if you accidentally left test in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 3 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: 1,
|
||||
/* 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,
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'Firefox Stable',
|
||||
use: {
|
||||
browserName: 'firefox',
|
||||
channel: 'firefox',
|
||||
args: ['--use-gl=egl'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
Loading…
Reference in a new issue