部署 Sentinel Playwright 记者
启用从远程环境( ex. CI) 运行的 Playwright 查看/调试 本地调试信息 .
安装
在您的 Playwright 项目中安装 Playwright 记者 .
npm install -D @deploysentinel/playwright
使用量
添加报告者
在您的剧作家配置文件( ex. playwright.config.ts增加:
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
reporter: '@deploysentinel/playwright',
use: {
/* Make sure this is not 'off' so debugger can upload trace info */
trace: 'on',
},
};
export default config;
添加 API 密钥
最后,将您的 API 密钥导出到 OS 环境变量
DEPLOYSENTINEL_API_KEY您可以通过 API 键抓取
登录编号 :报名
部署森蒂内尔并访问你的团队网页:
https://depmoutsentinel.com/team (中文(简体) )。 。 。 .
DEPLOYSENTINEL_API_KEY=YOUR_API_KEY
调试
要显示内部调试日志, 请设置环境变量
DEPLOYSENTINEL_LOG_VERBOSE 改为 1, (中文(简体) ), yes,或 true。 。 。 .
DEPLOYSENTINEL_LOG_VERBOSE=1 ('1', 'yes' or 'true')
用 API 密钥运行 Playwright
DEPLOYSENTINEL_API_KEY=xxx npx playwright test