mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
- Changed the web server configuration to specify the URL as 'http://localhost:3000' for improved clarity in local development. </message> <message>feat(ci-pipeline): add artifact upload and download steps in CI workflow - Introduced steps to upload the build output as an artifact after the build job. - Added a step to download the build output artifact before running Playwright tests, ensuring the tests have access to the latest build.
72 lines
1.7 KiB
TypeScript
72 lines
1.7 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
/**
|
|
* Read environment variables from file.
|
|
* https://github.com/motdotla/dotenv
|
|
*/
|
|
// import dotenv from 'dotenv';
|
|
// import path from 'path';
|
|
// dotenv.config({ path: path.resolve(__dirname, '.env') });
|
|
|
|
/**
|
|
* See https://playwright.dev/docs/test-configuration.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: './src/tests',
|
|
testIgnore: ['**.test.ts'],
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
/* Opt out of parallel tests on CI. */
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: 'html',
|
|
use: {
|
|
baseURL: 'http://127.0.0.1:3000',
|
|
trace: 'on-first-retry',
|
|
},
|
|
|
|
/* Configure projects for major browsers */
|
|
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'] },
|
|
// },
|
|
|
|
/* Test against branded browsers. */
|
|
// {
|
|
// name: 'Microsoft Edge',
|
|
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
// },
|
|
// {
|
|
// name: 'Google Chrome',
|
|
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
// },
|
|
],
|
|
|
|
/* Run your local dev server before starting the tests */
|
|
webServer: {
|
|
command: process.env.CI ? 'npm run start' : 'npm run dev',
|
|
url: 'http://localhost:3000',
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
});
|