major features update
This commit is contained in:
parent
519fb49901
commit
4e2fab67c5
48 changed files with 3925 additions and 208 deletions
71
e2e/playwright.config.ts
Normal file
71
e2e/playwright.config.ts
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
// purposefully not using ??: we want to replace empty empty string with default
|
||||
const BASE_URL = process.env.BASE_URL || 'http://localhost:3000';
|
||||
|
||||
let addlConfig = {
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
};
|
||||
|
||||
let projects = [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: { ...devices['Desktop Chrome'] },
|
||||
},
|
||||
|
||||
{
|
||||
name: 'firefox',
|
||||
use: { ...devices['Desktop Firefox'] },
|
||||
},
|
||||
|
||||
{
|
||||
name: 'webkit',
|
||||
use: { ...devices['Desktop Safari'] },
|
||||
},
|
||||
|
||||
/* Test against mobile viewports. */
|
||||
{
|
||||
name: 'Mobile Chrome',
|
||||
use: { ...devices['Pixel 5'] },
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Mobile Safari',
|
||||
use: { ...devices['iPhone 12'] },
|
||||
},
|
||||
];
|
||||
|
||||
const pfil = process.env.PROJECT_FILTER;
|
||||
if (pfil) {
|
||||
if (pfil.startsWith('!')) {
|
||||
projects = projects.filter(p => p.name !== pfil.slice(1));
|
||||
} else {
|
||||
projects = projects.filter(p => p.name === pfil);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: './pages',
|
||||
fullyParallel: true,
|
||||
workers: 1,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: Boolean(process.env.CI),
|
||||
/* 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: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: BASE_URL,
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects,
|
||||
...addlConfig,
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue