完成第二轮降噪部署复检(frontend-simplification-wave2-deploy-verify)
这个提交包含在:
@@ -85,3 +85,79 @@ SYNC_ENV=0 bash deploy/trialrun/deploy.sh
|
||||
node deploy/trialrun/validate-env-contract.js
|
||||
SYNC_ENV=0 bash deploy/trialrun/deploy.sh
|
||||
```
|
||||
|
||||
## Scenario: Public Smoke Navigation Labels
|
||||
|
||||
### 1. Scope / Trigger
|
||||
|
||||
- Trigger: frontend shell, navigation labels, sidebar grouping, Portal/workbench
|
||||
copy, or live smoke assertions change.
|
||||
- Purpose: prevent public deployment from being marked failed only because
|
||||
smoke tests look for stale navigation copy while the page itself is healthy.
|
||||
|
||||
### 2. Signatures
|
||||
|
||||
- Live smoke command:
|
||||
`E2E_MODE=live LIVE_SMOKE_BASE_URL=https://oa.hyinda.com npx playwright test tests/e2e/live-smoke.spec.ts`
|
||||
- Shared assertions: `client/tests/e2e/helpers/smokeAssertions.ts`
|
||||
- Workbench route: `/portal`
|
||||
- Current primary workbench nav label: `工作台`
|
||||
- Historical nav label still allowed in mocks or older fixtures: `Portal`
|
||||
|
||||
### 3. Contracts
|
||||
|
||||
- `assertPortalLoaded(page)` must assert route and page content first:
|
||||
`/portal` URL and the `今日任务` heading.
|
||||
- Navigation-label assertions for the workbench link must accept both `工作台`
|
||||
and `Portal` while older mocks still use English labels.
|
||||
- Smoke tests must not require a copy string that is not a product contract for
|
||||
public availability.
|
||||
- If the product intentionally renames the primary workbench label again, update
|
||||
the shared smoke helper rather than duplicating route-specific assertions in
|
||||
each live smoke test.
|
||||
|
||||
### 4. Validation & Error Matrix
|
||||
|
||||
- Page reaches `/portal`, `今日任务` is visible, but nav label is `工作台` ->
|
||||
smoke should pass.
|
||||
- Page reaches `/portal`, but `今日任务` is missing -> smoke should fail.
|
||||
- Page stays on login, `/403`, error fallback or another route -> smoke should
|
||||
fail.
|
||||
- New shell label appears only in one live smoke test -> move the compatibility
|
||||
logic into `smokeAssertions.ts`.
|
||||
|
||||
### 5. Good/Base/Bad Cases
|
||||
|
||||
- Good: `assertPortalLoaded` checks `/portal`, `今日任务`, and a workbench link
|
||||
matching either `工作台` or `Portal`.
|
||||
- Base: mocked E2E fixtures may still emit `Portal`; live public navigation may
|
||||
emit `工作台`.
|
||||
- Bad: live smoke hard-codes only `Portal` and blocks deployment after a valid
|
||||
Chinese navigation rollout.
|
||||
|
||||
### 6. Tests Required
|
||||
|
||||
- After changing live smoke assertions, run:
|
||||
`cd client && npm run typecheck`
|
||||
- For public deploy verification, run live smoke or the readiness wrapper:
|
||||
`LIVE_SMOKE_BASE_URL=https://oa.hyinda.com bash scripts/qa/run-live-smoke-readiness.sh`
|
||||
- When changing the shell or Portal page, include a focused Playwright check
|
||||
that proves the workbench route and heading still load.
|
||||
|
||||
### 7. Wrong vs Correct
|
||||
|
||||
#### Wrong
|
||||
|
||||
```ts
|
||||
await expect(page.getByRole("link", { name: "Portal" }).first()).toBeVisible();
|
||||
```
|
||||
|
||||
#### Correct
|
||||
|
||||
```ts
|
||||
await expect(
|
||||
page.getByRole("link", { name: "工作台", exact: true })
|
||||
.or(page.getByRole("link", { name: "Portal", exact: true }))
|
||||
.first(),
|
||||
).toBeVisible();
|
||||
```
|
||||
|
||||
在新工单中引用
屏蔽一个用户