Files
msh-system/docs/Testing/T10-full-regression-report.md

74 lines
3.5 KiB
Markdown
Raw Normal View History

# T10 Full Regression Test Report
**Plan:** smooth-moseying-tiger · **Task:** T10 Full regression testing
**Date:** 2026-03-04
**Scope:** Verify all 6 fixes: post detail tag, post/recipe AI fill, recipe favorite, recipe like visual, knowledge navigation.
---
## Summary
| # | Issue | Test ID | Pass/Fail | Notes |
|---|--------|---------|-----------|--------|
| 1 | Post detail tag shows Chinese | T10-1 | *(run tests)* | Asserts `.meal-tag`/`.type-tag` has Chinese on post detail |
| 2 | Post nutrition AI fill works | T10-2 | *(run tests)* | Clicks "AI 补充营养", expects stats and no error |
| 3 | Recipe nutrition AI fill works | T10-3 | *(run tests)* | Recipe detail shows nutrition (API or AI fill) |
| 4 | Recipe favorite no error | T10-4 | *(run tests)* | Favorite button shows 已收藏/已取消收藏, no 操作失败 |
| 5 | Recipe like emoji changes visual | T10-5 | *(run tests)* | Like button emoji 🤍 ↔ ❤️ on click |
| 6 | Knowledge articles can navigate to detail | T10-6 | *(run tests)* | 科普文章 → first item → detail has content |
**To get pass/fail:** Run `./scripts/run-t10-regression.sh` or `npx playwright test tests/e2e/bug-regression.spec.ts --grep "T10"`, then set each row to PASS or FAIL from the test output.
---
## How to Run
**Prerequisites:** Frontend at `http://localhost:8080`, backend API at `http://127.0.0.1:20822`, logged-in test account (phone/password in spec).
```bash
cd /Users/apple/scott2026/msh-system
npx playwright test tests/e2e/bug-regression.spec.ts --grep "T10" --reporter=list
```
To run with HTML report:
```bash
npx playwright test tests/e2e/bug-regression.spec.ts --grep "T10" --reporter=html
npx playwright show-report tests/e2e/reports
```
---
## Test Descriptions
| # | Issue | What the test does |
|---|--------|---------------------|
| **1** | **Post detail tag shows Chinese** | Opens community → first post → checks `.meal-tag` / `.type-tag` contains Chinese (e.g. 早餐/午餐/晚餐/分享). |
| **2** | **Post nutrition AI fill works** | Opens a post detail; if "🤖 AI 补充营养" is visible, clicks it, waits ~8s; asserts no error and nutrition stats appear. |
| **3** | **Recipe nutrition AI fill works** | Opens recipe detail (from tool main or `recipe-detail?id=1`), waits for nutrition card; asserts nutrition values are present (from API or AI fill). |
| **4** | **Recipe favorite no error** | Opens recipe detail, clicks favorite (⭐) button; expects toast "已收藏" or "已取消收藏" and no "操作失败". |
| **5** | **Recipe like emoji changes visual** | Opens recipe detail, reads like button emoji (🤍/❤️), clicks like; asserts emoji or state changes. |
| **6** | **Knowledge articles can navigate to detail** | Goes to nutrition-knowledge → 科普文章 tab → clicks first article; asserts detail page has visible content. |
---
## After Running: Fill Pass/Fail
Replace **Run tests to fill** in the Summary table with **PASS** or **FAIL** per test, and add any Notes (e.g. timeout, missing data, API error).
Example:
| # | Issue | Test ID | Pass/Fail | Notes |
|---|--------|---------|-----------|--------|
| 1 | Post detail tag shows Chinese | T10-1 | PASS | |
| 2 | Post nutrition AI fill works | T10-2 | PASS | |
| ... | ... | ... | ... | ... |
---
## Related Existing Tests
- **TC-B07** Diet guide & science article detail content (same scope as item 6).
- **TC-B08** Post detail nutrition stats visible.
- **TC-B09** Community tabs and post type tags in Chinese (list page; T10-1 checks post *detail* page).