fix: 修复TypeScript配置错误并更新项目文档
详细说明: - 修复了@n8n/config包的TypeScript配置错误 - 移除了不存在的jest-expect-message类型引用 - 清理了所有TypeScript构建缓存 - 更新了可行性分析文档,添加了技术实施方案 - 更新了Agent prompt文档 - 添加了会展策划工作流文档 - 包含了n8n-chinese-translation子项目 - 添加了exhibition-demo展示系统框架
This commit is contained in:
74
n8n-n8n-1.109.2/packages/testing/playwright/playwright.config 2.ts
Executable file
74
n8n-n8n-1.109.2/packages/testing/playwright/playwright.config 2.ts
Executable file
@@ -0,0 +1,74 @@
|
||||
/* eslint-disable import-x/no-default-export */
|
||||
import { currentsReporter } from '@currents/playwright';
|
||||
import { defineConfig } from '@playwright/test';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import currentsConfig from './currents.config';
|
||||
import { getProjects } from './playwright-projects';
|
||||
import { getPortFromUrl } from './utils/url-helper';
|
||||
|
||||
const IS_CI = !!process.env.CI;
|
||||
|
||||
const MACBOOK_WINDOW_SIZE = { width: 1536, height: 960 };
|
||||
|
||||
const USER_FOLDER = path.join(os.tmpdir(), `n8n-main-${Date.now()}`);
|
||||
// Calculate workers based on environment
|
||||
// The amount of workers to run, limited to 6 as higher causes instability in the local server
|
||||
// Use half the CPUs in local, full in CI (CI has no other processes so we can use more)
|
||||
const CPU_COUNT = os.cpus().length;
|
||||
const LOCAL_WORKERS = Math.min(6, Math.floor(CPU_COUNT / 2));
|
||||
const CI_WORKERS = CPU_COUNT;
|
||||
const WORKERS = IS_CI ? CI_WORKERS : LOCAL_WORKERS;
|
||||
|
||||
export default defineConfig({
|
||||
globalSetup: './global-setup.ts',
|
||||
forbidOnly: IS_CI,
|
||||
retries: IS_CI ? 2 : 0,
|
||||
workers: WORKERS,
|
||||
timeout: 60000,
|
||||
expect: {
|
||||
timeout: 10000,
|
||||
},
|
||||
projects: getProjects(),
|
||||
|
||||
// We use this if an n8n url is passed in. If the server is already running, we reuse it.
|
||||
webServer: process.env.N8N_BASE_URL
|
||||
? {
|
||||
command: 'cd .. && pnpm start',
|
||||
url: `${process.env.N8N_BASE_URL}/favicon.ico`,
|
||||
timeout: 20000,
|
||||
reuseExistingServer: true,
|
||||
env: {
|
||||
DB_SQLITE_POOL_SIZE: '40',
|
||||
E2E_TESTS: 'true',
|
||||
N8N_PORT: getPortFromUrl(process.env.N8N_BASE_URL),
|
||||
N8N_USER_FOLDER: USER_FOLDER,
|
||||
N8N_LOG_LEVEL: 'debug',
|
||||
N8N_METRICS: 'true',
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
|
||||
use: {
|
||||
trace: 'on',
|
||||
video: 'on',
|
||||
screenshot: 'on',
|
||||
testIdAttribute: 'data-test-id',
|
||||
headless: process.env.SHOW_BROWSER !== 'true',
|
||||
viewport: MACBOOK_WINDOW_SIZE,
|
||||
actionTimeout: 20000, // TODO: We might need to make this dynamic for container tests if we have low resource containers etc
|
||||
navigationTimeout: 10000,
|
||||
},
|
||||
|
||||
reporter: IS_CI
|
||||
? [
|
||||
['list'],
|
||||
['github'],
|
||||
['junit', { outputFile: process.env.PLAYWRIGHT_JUNIT_OUTPUT_NAME ?? 'results.xml' }],
|
||||
['html', { open: 'never' }],
|
||||
['json', { outputFile: 'test-results.json' }],
|
||||
currentsReporter(currentsConfig),
|
||||
]
|
||||
: [['html']],
|
||||
});
|
||||
Reference in New Issue
Block a user