diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c191ff..9e54d4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,14 @@ playwright_tests: script: - npm install - 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: paths: - test-results/ diff --git a/playwright.config.js b/playwright.config.js index 2fa2f25..c59b2ff 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -55,7 +55,7 @@ module.exports = defineConfig({ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ hasTouch: true, - trace: 'retain-on-failure', + trace: 'on', screenshot: 'only-on-failure', timezoneId: 'Asia/Shanghai', locale: 'zh-CN',