Commit e2785215 authored by liguangyu06's avatar liguangyu06
Browse files

Use installed Chrome when PLAYWRIGHT_CHANNEL=chrome on intranet Jenkins.

parent df35e221
...@@ -4,9 +4,13 @@ import './load-env'; ...@@ -4,9 +4,13 @@ import './load-env';
import { resolveRetries } from './ci.config'; import { resolveRetries } from './ci.config';
import { timeouts } from './timeouts.config'; import { timeouts } from './timeouts.config';
/** 内网 Jenkins 无法下载官方 Chromium 时,设 PLAYWRIGHT_CHANNEL=chrome 使用本机 Chrome。 */
const channel = (process.env.PLAYWRIGHT_CHANNEL || '').trim();
/** 与 playwright.config.ts 的 use 互补:截图、trace、视口。 */ /** 与 playwright.config.ts 的 use 互补:截图、trace、视口。 */
export const browserUse: PlaywrightTestConfig['use'] = { export const browserUse: PlaywrightTestConfig['use'] = {
...devices['Desktop Chrome'], ...devices['Desktop Chrome'],
...(channel ? { channel } : {}),
launchOptions: { launchOptions: {
...(process.env.SLOW_MO ? { slowMo: Number(process.env.SLOW_MO) } : {}), ...(process.env.SLOW_MO ? { slowMo: Number(process.env.SLOW_MO) } : {}),
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment