- 移除了 playwright 测试命令中的 --grep 参数 - 重构了员工选择和挂单操作的代码,提高了可读性和可维护性 - 优化了等待和点击操作,确保测试流程更加稳定 - 删除了冗余的代码,简化了测试逻辑
27 lines
691 B
YAML
27 lines
691 B
YAML
playwright_tests:
|
|
stage: test
|
|
image: mcr.microsoft.com/playwright:v1.51.0-noble
|
|
cache:
|
|
key: $CI_COMMIT_REF_SLUG
|
|
paths:
|
|
- node_modules/
|
|
before_script:
|
|
- npm config set registry https://registry.npmmirror.com
|
|
script:
|
|
- npm install
|
|
- npx playwright test /touch/boss_cashier.spec.ts --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..."
|
|
fi
|
|
artifacts:
|
|
paths:
|
|
- playwright-report/
|
|
expire_in: 1 week
|
|
tags:
|
|
- test
|
|
only:
|
|
- main |