.agents/skills/frontend-testing
stars:148605
forks:23425
watches:818
last updated:2026-07-12 21:10:27
Dify Frontend Testing
Use this skill for Vitest work under web/ and packages/dify-ui/. Do not use it for Python tests or Cucumber/Playwright tests under e2e/.
Required Source
Before writing, changing, or reviewing frontend tests, read web/docs/test.md completely. It is the single source of truth. This skill defines the execution workflow and must not add requirements that conflict with or duplicate that guide.
Workflow
- Read the source, its behavior owner, nearby specs, and relevant public dependencies.
- Identify whether the contract belongs in
web/, Dify UI Browser Mode, or a styled Storybook test. - Apply the canonical guide to decide whether a test is needed and choose its boundary.
- For a behavior change or bug fix, write or identify the failing scenario first when practical.
- Implement one coherent scenario at a time and run the focused spec before expanding scope.
- Finish with the affected suite and relevant repository checks.
- Report what behavior was verified and any risk that still requires browser, visual, or end-to-end validation.
When reviewing existing tests, recommend deleting low-value tests as readily as adding missing behavior coverage.
Run focused tests from the owning workspace:
# web/
vp test run path/to/spec-or-directory
# packages/dify-ui/
vp test run --project unit src/path/to/spec
For styled Dify UI behavior, run vp test --project storybook --run. Run broader checks only after the focused behavior passes.
