Refine admin login flow and verification harness
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m21s

This commit is contained in:
2026-07-07 14:38:30 +09:00
parent b7cb442937
commit 35842b6765
60 changed files with 1043 additions and 495 deletions
+55 -30
View File
@@ -69,44 +69,69 @@ jobs:
echo "✗ TIMEOUT: Deployment failed to publish ${SHORT_VERSION} within 60 seconds" >&2
exit 1
- name: Browser Smoke verification
- name: Browser verifications in parallel
env:
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
E2E_BASE_URL: https://www.taxbaik.com/taxbaik
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
E2E_ADMIN_USERNAME: test_admin
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
run: |
echo "Running smoke checks on Desktop Chrome (production verification)"
npm run test:e2e:public-smoke
npm run test:e2e:admin-smoke
- name: Browser E2E verification
env:
# Green-Blue 배포 지원: Nginx를 통해 active 포트로 라우팅
E2E_BASE_URL: https://www.taxbaik.com/taxbaik
# E2E 테스트는 test_admin 테스트 계정 사용 (실 admin 계정과 분리)
E2E_ADMIN_USERNAME: test_admin
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
run: |
echo "Running full E2E on Desktop Chrome (production verification)"
npx playwright test --project="Desktop Chrome" --reporter=html --reporter=list
- name: API smoke verification
env:
E2E_ADMIN_USERNAME: test_admin
E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }}
run: |
set -e
TOKEN="$(curl -s -X POST "https://www.taxbaik.com/taxbaik/api/auth/login" -H "Content-Type: application/json" -d "{\"username\":\"${E2E_ADMIN_USERNAME}\",\"password\":\"${E2E_ADMIN_PASSWORD}\"}" | python3 -c 'import sys, json; print(json.load(sys.stdin)["accessToken"])')"
test -n "$TOKEN"
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/blog/admin?page=1&pageSize=1" >/dev/null
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/faq" >/dev/null
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/announcement" >/dev/null
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/inquiry?page=1&pageSize=1" >/dev/null
curl -fsS "https://www.taxbaik.com/taxbaik/favicon.svg" >/dev/null
curl -fsS "https://www.taxbaik.com/taxbaik/favicon.ico" >/dev/null
curl -fsS "https://www.taxbaik.com/taxbaik/robots.txt" >/dev/null
pids=()
names=()
run_job() {
local name="$1"
shift
(
echo "=== START ${name} ==="
"$@"
echo "=== DONE ${name} ==="
) &
pids+=($!)
names+=("$name")
}
run_job "browser-smoke" bash -lc 'npm run test:e2e:public-smoke && npm run test:e2e:admin-smoke'
run_job "browser-e2e" bash -lc 'npm run test:e2e:ci'
run_job "api-smoke" bash -lc '
set -e
TOKEN="$(curl -s -X POST "https://www.taxbaik.com/taxbaik/api/auth/login" -H "Content-Type: application/json" -d "{\"username\":\"${E2E_ADMIN_USERNAME}\",\"password\":\"${E2E_ADMIN_PASSWORD}\"}" | python3 -c '\''import sys, json; print(json.load(sys.stdin)["accessToken"])'\'')"
test -n "$TOKEN"
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/blog/admin?page=1&pageSize=1" >/dev/null
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/faq" >/dev/null
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/announcement" >/dev/null
curl -fsS -H "Authorization: Bearer $TOKEN" "https://www.taxbaik.com/taxbaik/api/inquiry?page=1&pageSize=1" >/dev/null
curl -fsS "https://www.taxbaik.com/taxbaik/favicon.svg" >/dev/null
curl -fsS "https://www.taxbaik.com/taxbaik/favicon.ico" >/dev/null
curl -fsS "https://www.taxbaik.com/taxbaik/robots.txt" >/dev/null
'
failures=0
for idx in "${!pids[@]}"; do
pid="${pids[$idx]}"
name="${names[$idx]}"
if wait "$pid"; then
echo "✓ ${name} passed"
else
echo "✗ ${name} failed" >&2
failures=1
fi
done
exit "$failures"
- name: Upload Playwright artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-artifacts
path: |
playwright-report/
test-results/
evidence/
if-no-files-found: ignore
- name: Browser E2E summary
if: always()