a596b3aaca
ref https://www.notion.so/AdminX-testing-plan-99b2dab27e794fc893767ccd01c84a63?d=26612fc2b9d84e65bbb269fa3bc5079e&pvs=4#f0089cd4d9f24e93bd7f8e2868987bf6 This pull request renames the end-to-end tests to acceptance tests in the `apps/admin-x-settings` folder. It updates the `ci.yml` file, the `package.json` file, the `playwright.config.ts` file, and the test files to reflect the new naming convention. This change aims to better reflect the purpose and scope of the tests.
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import {defineConfig, devices} from '@playwright/test';
|
|
|
|
export const E2E_PORT = 5173;
|
|
|
|
/**
|
|
* See https://playwright.dev/docs/test-configuration.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: './test/acceptance',
|
|
/* Run tests in files in parallel */
|
|
fullyParallel: true,
|
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
forbidOnly: !!process.env.CI,
|
|
/* Retry on CI only */
|
|
retries: process.env.CI ? 2 : 0,
|
|
/* Hardcode to use all cores in CI */
|
|
workers: process.env.CI ? '100%' : (process.env.PLAYWRIGHT_SLOWMO ? 1 : undefined),
|
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
reporter: 'html',
|
|
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
use: {
|
|
baseURL: `http://localhost:${E2E_PORT}`,
|
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
trace: 'on-first-retry',
|
|
launchOptions: {
|
|
slowMo: parseInt(process.env.PLAYWRIGHT_SLOWMO ?? '') || 0,
|
|
// force GPU hardware acceleration
|
|
// (even in headless mode)
|
|
args: ['--use-gl=egl']
|
|
}
|
|
},
|
|
|
|
/* Configure projects for major browsers */
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: {...devices['Desktop Chrome']}
|
|
},
|
|
|
|
...(process.env.ALL_BROWSERS ? [{
|
|
name: 'firefox',
|
|
use: {...devices['Desktop Firefox']}
|
|
},
|
|
|
|
{
|
|
name: 'webkit',
|
|
use: {...devices['Desktop Safari']}
|
|
}] : [])
|
|
],
|
|
|
|
/* Run local dev server before starting the tests */
|
|
webServer: {
|
|
command: `yarn dev:start`,
|
|
url: `http://localhost:${E2E_PORT}`,
|
|
reuseExistingServer: !process.env.CI,
|
|
timeout: 10000
|
|
}
|
|
});
|