ci: 添加测试失败消息发送功能并调整 trace 配置
- 在 .gitlab-ci.yml 中添加 after_script 部分,根据测试结果发送相应消息 - 在 playwright.config.js 中将 trace 配置从 'retain-on-failure' 改为 'on',以收集所有测试的 trace 信息
This commit is contained in:
parent
bac0dbfdbe
commit
88eae96f63
@ -10,6 +10,14 @@ playwright_tests:
|
|||||||
script:
|
script:
|
||||||
- npm install
|
- npm install
|
||||||
- npx playwright test /touch/boss_cashier.spec.ts --grep "挂单" --project '慧来客touch(管理员身份) - Desktop Chrome'
|
- npx playwright test /touch/boss_cashier.spec.ts --grep "挂单" --project '慧来客touch(管理员身份) - Desktop Chrome'
|
||||||
|
after_script:
|
||||||
|
- |
|
||||||
|
if [ "$CI_JOB_STATUS" == "success" ]; then
|
||||||
|
echo "Tests passed! Sending success message..."
|
||||||
|
else
|
||||||
|
echo "Tests failed! Sending failure message..."
|
||||||
|
node scripts/send-message.js "Some tests failed!"
|
||||||
|
fi
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- test-results/
|
- test-results/
|
||||||
|
|||||||
@ -55,7 +55,7 @@ module.exports = defineConfig({
|
|||||||
|
|
||||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||||
hasTouch: true,
|
hasTouch: true,
|
||||||
trace: 'retain-on-failure',
|
trace: 'on',
|
||||||
screenshot: 'only-on-failure',
|
screenshot: 'only-on-failure',
|
||||||
timezoneId: 'Asia/Shanghai',
|
timezoneId: 'Asia/Shanghai',
|
||||||
locale: 'zh-CN',
|
locale: 'zh-CN',
|
||||||
|
|||||||
Reference in New Issue
Block a user