@jhm1909/ag-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/ARCHITECTURE.md +189 -0
- package/.agent/known-registries.json +181 -0
- package/.agent/mcp_config.json +19 -0
- package/.agent/rules/clean-code.md +107 -0
- package/.agent/rules/documents.md +177 -0
- package/.agent/rules/git-workflow.md +68 -0
- package/.agent/rules/nano-banana.md +46 -0
- package/.agent/rules/research.md +35 -0
- package/.agent/rules/skill-loading.md +100 -0
- package/.agent/rules/skill-suggestion.md +47 -0
- package/.agent/rules/testing.md +52 -0
- package/.agent/rules/workflow-advisor.md +108 -0
- package/.agent/rules/workflow-skill-convention.md +127 -0
- package/.agent/skills/ai-engineer/SKILL.md +824 -0
- package/.agent/skills/ai-engineer/references/agentic-patterns.md +329 -0
- package/.agent/skills/ai-engineer/references/evaluation.md +493 -0
- package/.agent/skills/ai-engineer/references/llm.md +490 -0
- package/.agent/skills/ai-engineer/references/rag-advanced.md +444 -0
- package/.agent/skills/ai-engineer/references/serving-optimization.md +531 -0
- package/.agent/skills/ai-engineer/vector-db/README.md +137 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +41 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/backend-developer/SKILL.md +763 -0
- package/.agent/skills/backend-developer/references/general-patterns.md +65 -0
- package/.agent/skills/backend-developer/references/go-echo.md +68 -0
- package/.agent/skills/backend-developer/references/go-gin.md +76 -0
- package/.agent/skills/backend-developer/references/java-springboot.md +83 -0
- package/.agent/skills/backend-developer/references/node-express.md +64 -0
- package/.agent/skills/backend-developer/references/node-nestjs.md +69 -0
- package/.agent/skills/backend-developer/references/python-django.md +67 -0
- package/.agent/skills/backend-developer/references/python-fastapi.md +80 -0
- package/.agent/skills/blockchain-engineer/SKILL.md +975 -0
- package/.agent/skills/blockchain-engineer/references/deployment.md +28 -0
- package/.agent/skills/blockchain-engineer/references/evm.md +14 -0
- package/.agent/skills/blockchain-engineer/references/mechanisms.md +32 -0
- package/.agent/skills/blockchain-engineer/references/solidity.md +32 -0
- package/.agent/skills/business-analysis/SKILL.md +85 -0
- package/.agent/skills/business-analysis/references/best-practices/diagrams.md +141 -0
- package/.agent/skills/business-analysis/references/domains/ai-agent.md +94 -0
- package/.agent/skills/business-analysis/references/domains/blockchain-dapp.md +86 -0
- package/.agent/skills/business-analysis/references/domains/ecommerce.md +77 -0
- package/.agent/skills/business-analysis/references/domains/education.md +42 -0
- package/.agent/skills/business-analysis/references/domains/fintech.md +44 -0
- package/.agent/skills/business-analysis/references/domains/fnb.md +82 -0
- package/.agent/skills/business-analysis/references/domains/healthtech.md +44 -0
- package/.agent/skills/business-analysis/references/domains/internal-tools.md +38 -0
- package/.agent/skills/business-analysis/references/domains/marketplace.md +52 -0
- package/.agent/skills/business-analysis/references/domains/saas.md +36 -0
- package/.agent/skills/business-analysis/references/workflows/collaboration.md +41 -0
- package/.agent/skills/business-analysis/scripts/verify_mermaid.py +86 -0
- package/.agent/skills/business-analysis/templates/brd.md +46 -0
- package/.agent/skills/business-analysis/templates/change-request.md +41 -0
- package/.agent/skills/business-analysis/templates/prd-functional.md +38 -0
- package/.agent/skills/business-analysis/templates/use-case.md +40 -0
- package/.agent/skills/business-analysis/templates/user-story-detailed.md +36 -0
- package/.agent/skills/code-review/SKILL.md +113 -0
- package/.agent/skills/code-review/references/code-review-reception.md +209 -0
- package/.agent/skills/code-review/references/differential_review.md +59 -0
- package/.agent/skills/code-review/references/requesting-code-review.md +105 -0
- package/.agent/skills/code-review/references/spec_compliance.md +43 -0
- package/.agent/skills/code-review/references/verification-before-completion.md +139 -0
- package/.agent/skills/context-engineering/SKILL.md +68 -0
- package/.agent/skills/context-engineering/references/context-compression.md +84 -0
- package/.agent/skills/context-engineering/references/context-degradation.md +93 -0
- package/.agent/skills/context-engineering/references/context-fundamentals.md +75 -0
- package/.agent/skills/context-engineering/references/context-optimization.md +82 -0
- package/.agent/skills/context-engineering/references/evaluation.md +89 -0
- package/.agent/skills/context-engineering/references/memory-systems.md +88 -0
- package/.agent/skills/context-engineering/references/multi-agent-patterns.md +90 -0
- package/.agent/skills/context-engineering/references/project-development.md +97 -0
- package/.agent/skills/context-engineering/references/tool-design.md +86 -0
- package/.agent/skills/debugging/SKILL.md +60 -0
- package/.agent/skills/debugging/references/defense-in-depth.md +130 -0
- package/.agent/skills/debugging/references/root-cause-tracing.md +177 -0
- package/.agent/skills/debugging/references/systematic-debugging.md +295 -0
- package/.agent/skills/debugging/references/verification-before-completion.md +142 -0
- package/.agent/skills/designer/SKILL.md +159 -0
- package/.agent/skills/designer/concepts/apple-glass.md +48 -0
- package/.agent/skills/designer/concepts/aurora-gradients.md +26 -0
- package/.agent/skills/designer/concepts/bento-grids.md +14 -0
- package/.agent/skills/designer/concepts/claymorphism.md +27 -0
- package/.agent/skills/designer/concepts/neo-brutalism.md +32 -0
- package/.agent/skills/designer/data/app-interface.csv +31 -0
- package/.agent/skills/designer/data/charts.csv +26 -0
- package/.agent/skills/designer/data/colors.csv +162 -0
- package/.agent/skills/designer/data/design.csv +1776 -0
- package/.agent/skills/designer/data/icons.csv +106 -0
- package/.agent/skills/designer/data/landing.csv +35 -0
- package/.agent/skills/designer/data/products.csv +162 -0
- package/.agent/skills/designer/data/react-performance.csv +45 -0
- package/.agent/skills/designer/data/styles.csv +85 -0
- package/.agent/skills/designer/data/typography.csv +74 -0
- package/.agent/skills/designer/data/ui-reasoning.csv +162 -0
- package/.agent/skills/designer/data/ux-guidelines.csv +100 -0
- package/.agent/skills/designer/references/accessibility.md +172 -0
- package/.agent/skills/designer/references/branding.md +88 -0
- package/.agent/skills/designer/references/color-theory.md +139 -0
- package/.agent/skills/designer/references/creation.md +118 -0
- package/.agent/skills/designer/references/design-systems.md +219 -0
- package/.agent/skills/designer/references/frontend_design_aesthetics.md +57 -0
- package/.agent/skills/designer/references/layout.md +200 -0
- package/.agent/skills/designer/references/motion.md +92 -0
- package/.agent/skills/designer/references/review.md +100 -0
- package/.agent/skills/designer/references/trends.md +209 -0
- package/.agent/skills/designer/references/typography.md +190 -0
- package/.agent/skills/designer/scripts/remove_background.py +135 -0
- package/.agent/skills/designer/scripts/ui-search/__pycache__/core.cpython-314.pyc +0 -0
- package/.agent/skills/designer/scripts/ui-search/__pycache__/design_system.cpython-314.pyc +0 -0
- package/.agent/skills/designer/scripts/ui-search/core.py +217 -0
- package/.agent/skills/designer/scripts/ui-search/design_system.py +1067 -0
- package/.agent/skills/designer/scripts/ui-search/search.py +114 -0
- package/.agent/skills/designer/templates/design-motion-spec.md +30 -0
- package/.agent/skills/devops-engineer/SKILL.md +90 -0
- package/.agent/skills/devops-engineer/docker-compose/README.md +47 -0
- package/.agent/skills/devops-engineer/references/ci-cd-pipelines.md +76 -0
- package/.agent/skills/devops-engineer/references/cloud-providers.md +57 -0
- package/.agent/skills/devops-engineer/references/codebase-normalization.md +104 -0
- package/.agent/skills/devops-engineer/references/container-orchestration.md +69 -0
- package/.agent/skills/devops-engineer/references/iac-tools.md +63 -0
- package/.agent/skills/devops-engineer/references/observability-security.md +45 -0
- package/.agent/skills/devops-engineer/references/vercel-supabase.md +17 -0
- package/.agent/skills/devops-engineer/templates/release-notes.md +8 -0
- package/.agent/skills/frontend-developer/SKILL.md +125 -0
- package/.agent/skills/frontend-developer/react-nextjs/README.md +90 -0
- package/.agent/skills/frontend-developer/references/angular.md +52 -0
- package/.agent/skills/frontend-developer/references/composition_patterns.md +60 -0
- package/.agent/skills/frontend-developer/references/core-performance.md +68 -0
- package/.agent/skills/frontend-developer/references/modern-signals.md +43 -0
- package/.agent/skills/frontend-developer/references/react_performance_rules.md +55 -0
- package/.agent/skills/frontend-developer/references/vue-nuxt.md +55 -0
- package/.agent/skills/frontend-developer/scripts/validate_compliance.py +65 -0
- package/.agent/skills/frontend-developer/threejs/README.md +89 -0
- package/.agent/skills/frontend-developer/threejs/animation.md +552 -0
- package/.agent/skills/frontend-developer/threejs/fundamentals.md +488 -0
- package/.agent/skills/frontend-developer/threejs/geometry.md +548 -0
- package/.agent/skills/frontend-developer/threejs/interaction.md +660 -0
- package/.agent/skills/frontend-developer/threejs/lighting.md +481 -0
- package/.agent/skills/frontend-developer/threejs/loaders.md +623 -0
- package/.agent/skills/frontend-developer/threejs/materials.md +520 -0
- package/.agent/skills/frontend-developer/threejs/postprocessing.md +602 -0
- package/.agent/skills/frontend-developer/threejs/router.json +181 -0
- package/.agent/skills/frontend-developer/threejs/shaders.md +642 -0
- package/.agent/skills/frontend-developer/threejs/textures.md +628 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/lead-architect/SKILL.md +85 -0
- package/.agent/skills/lead-architect/references/application-architecture.md +70 -0
- package/.agent/skills/lead-architect/references/infrastructure.md +51 -0
- package/.agent/skills/lead-architect/references/process.md +42 -0
- package/.agent/skills/lead-architect/references/system-architecture.md +62 -0
- package/.agent/skills/lead-architect/references/web-fullstack.md +82 -0
- package/.agent/skills/lead-architect/templates/adr.md +62 -0
- package/.agent/skills/lead-architect/templates/rfc.md +46 -0
- package/.agent/skills/lead-architect/templates/sdd.md +62 -0
- package/.agent/skills/lead-architect/templates/technical-spec.md +61 -0
- package/.agent/skills/marketer/SKILL.md +66 -0
- package/.agent/skills/marketer/remotion-best-practices/SKILL.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/3d.md +86 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/animations.md +29 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/assets.md +78 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/audio.md +172 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/can-decode.md +75 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/charts.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/compositions.md +146 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/display-captions.md +126 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/extract-frames.md +229 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/fonts.md +152 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/gifs.md +138 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/images.md +130 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/lottie.md +68 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/measuring-text.md +143 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/sequencing.md +106 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/tailwind.md +11 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/text-animations.md +20 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/timing.md +179 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/transitions.md +122 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/trimming.md +53 -0
- package/.agent/skills/marketer/remotion-best-practices/rules/videos.md +171 -0
- package/.agent/skills/mcp-builder/SKILL.md +76 -0
- package/.agent/skills/mcp-builder/references/evaluation.md +602 -0
- package/.agent/skills/mcp-builder/references/mcp_best_practices.md +249 -0
- package/.agent/skills/mcp-builder/references/node_mcp_server.md +970 -0
- package/.agent/skills/mcp-builder/references/python_mcp_server.md +719 -0
- package/.agent/skills/mobile-developer/SKILL.md +83 -0
- package/.agent/skills/mobile-developer/api-routes/SKILL.md +389 -0
- package/.agent/skills/mobile-developer/building-ui/SKILL.md +335 -0
- package/.agent/skills/mobile-developer/building-ui/references/animations.md +220 -0
- package/.agent/skills/mobile-developer/building-ui/references/controls.md +270 -0
- package/.agent/skills/mobile-developer/building-ui/references/form-sheet.md +227 -0
- package/.agent/skills/mobile-developer/building-ui/references/gradients.md +106 -0
- package/.agent/skills/mobile-developer/building-ui/references/icons.md +213 -0
- package/.agent/skills/mobile-developer/building-ui/references/media.md +198 -0
- package/.agent/skills/mobile-developer/building-ui/references/route-structure.md +229 -0
- package/.agent/skills/mobile-developer/building-ui/references/search.md +248 -0
- package/.agent/skills/mobile-developer/building-ui/references/storage.md +121 -0
- package/.agent/skills/mobile-developer/building-ui/references/tabs.md +368 -0
- package/.agent/skills/mobile-developer/building-ui/references/visual-effects.md +197 -0
- package/.agent/skills/mobile-developer/building-ui/references/webgpu-three.md +605 -0
- package/.agent/skills/mobile-developer/cicd-workflows/SKILL.md +107 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/fetch.js +109 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/package.json +11 -0
- package/.agent/skills/mobile-developer/cicd-workflows/scripts/validate.js +84 -0
- package/.agent/skills/mobile-developer/data-fetching/SKILL.md +508 -0
- package/.agent/skills/mobile-developer/deployment/SKILL.md +207 -0
- package/.agent/skills/mobile-developer/deployment/references/app-store-metadata.md +479 -0
- package/.agent/skills/mobile-developer/deployment/references/ios-app-store.md +355 -0
- package/.agent/skills/mobile-developer/deployment/references/play-store.md +246 -0
- package/.agent/skills/mobile-developer/deployment/references/testflight.md +58 -0
- package/.agent/skills/mobile-developer/deployment/references/workflows.md +200 -0
- package/.agent/skills/mobile-developer/dev-client/SKILL.md +181 -0
- package/.agent/skills/mobile-developer/tailwind-setup/SKILL.md +501 -0
- package/.agent/skills/mobile-developer/upgrading-expo/SKILL.md +116 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/new-architecture.md +79 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/react-19.md +79 -0
- package/.agent/skills/mobile-developer/upgrading-expo/references/react-compiler.md +59 -0
- package/.agent/skills/mobile-developer/use-dom/SKILL.md +434 -0
- package/.agent/skills/modern-python/SKILL.md +122 -0
- package/.agent/skills/project-manager/SKILL.md +110 -0
- package/.agent/skills/project-manager/references/ba-collaboration.md +62 -0
- package/.agent/skills/project-manager/references/discovery_process.md +52 -0
- package/.agent/skills/project-manager/references/jobs_to_be_done.md +51 -0
- package/.agent/skills/project-manager/references/prd_development.md +52 -0
- package/.agent/skills/project-manager/references/rules-guide.md +55 -0
- package/.agent/skills/project-manager/references/skill-creation.md +98 -0
- package/.agent/skills/project-manager/references/strategic-frameworks.md +62 -0
- package/.agent/skills/project-manager/references/task-decomposition.md +194 -0
- package/.agent/skills/project-manager/references/workflows-guide.md +44 -0
- package/.agent/skills/project-manager/router.json +160 -0
- package/.agent/skills/project-manager/scripts/compare_skill.py +177 -0
- package/.agent/skills/project-manager/scripts/encoding_utils.py +36 -0
- package/.agent/skills/project-manager/scripts/init_skill.py +190 -0
- package/.agent/skills/project-manager/scripts/quick_validate.py +123 -0
- package/.agent/skills/project-manager/templates/pm-strategy-one-pager.md +6 -0
- package/.agent/skills/project-manager/templates/prd-strategic.md +38 -0
- package/.agent/skills/project-manager/templates/skill-questionnaire.md +118 -0
- package/.agent/skills/project-manager/templates/user-story-simple.md +14 -0
- package/.agent/skills/prompt-engineer/SKILL.md +319 -0
- package/.agent/skills/prompt-engineer/skill-creator/README.md +47 -0
- package/.agent/skills/qa-tester/SKILL.md +142 -0
- package/.agent/skills/qa-tester/assets/README.md +8 -0
- package/.agent/skills/qa-tester/references/accessibility_testing.md +35 -0
- package/.agent/skills/qa-tester/references/agent_browser.md +38 -0
- package/.agent/skills/qa-tester/references/automation/api_testing.md +23 -0
- package/.agent/skills/qa-tester/references/automation/best_practices.md +14 -0
- package/.agent/skills/qa-tester/references/automation/jest_vitest.md +26 -0
- package/.agent/skills/qa-tester/references/automation/playwright.md +30 -0
- package/.agent/skills/qa-tester/references/e2e_testing.md +46 -0
- package/.agent/skills/qa-tester/references/integration_testing.md +39 -0
- package/.agent/skills/qa-tester/references/performance_testing.md +44 -0
- package/.agent/skills/qa-tester/references/property_based_testing.md +44 -0
- package/.agent/skills/qa-tester/references/security_audit.md +53 -0
- package/.agent/skills/qa-tester/references/security_testing.md +30 -0
- package/.agent/skills/qa-tester/references/sharp_edges.md +49 -0
- package/.agent/skills/qa-tester/references/static_analysis.md +52 -0
- package/.agent/skills/qa-tester/references/supply_chain_audit.md +54 -0
- package/.agent/skills/qa-tester/references/test_case_standards.md +96 -0
- package/.agent/skills/qa-tester/references/test_report_template.md +32 -0
- package/.agent/skills/qa-tester/references/unit_testing.md +50 -0
- package/.agent/skills/qa-tester/references/visual_testing.md +32 -0
- package/.agent/skills/qa-tester/templates/uat-plan.md +34 -0
- package/.agent/skills/research-first/SKILL.md +118 -0
- package/.agent/skills-manifest.json +264 -0
- package/.agent/workflows/absorb.md +176 -0
- package/.agent/workflows/bootstrap.md +91 -0
- package/.agent/workflows/brainstorm.md +168 -0
- package/.agent/workflows/break-tasks.md +77 -0
- package/.agent/workflows/commit.md +349 -0
- package/.agent/workflows/custom-behavior.md +64 -0
- package/.agent/workflows/debug.md +65 -0
- package/.agent/workflows/development.md +49 -0
- package/.agent/workflows/documentation.md +221 -0
- package/.agent/workflows/gen-tests.md +53 -0
- package/.agent/workflows/guide.md +196 -0
- package/.agent/workflows/implement-feature.md +182 -0
- package/.agent/workflows/install-skill.md +193 -0
- package/.agent/workflows/qa.md +54 -0
- package/.agent/workflows/ui-ux-design.md +108 -0
- package/LICENSE +21 -0
- package/README.md +258 -0
- package/cli/index.js +345 -0
- package/cli/migrate-skills.js +113 -0
- package/cli/verify.js +291 -0
- package/package.json +49 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# E2E Testing Insights & Patterns
|
|
2
|
+
|
|
3
|
+
## Core Philosophy
|
|
4
|
+
|
|
5
|
+
**"Simulate the Real User"**
|
|
6
|
+
E2E tests don't care about your code; they care about your UI. They are the final gatekeeper before production.
|
|
7
|
+
|
|
8
|
+
## The Page Object Model (POM)
|
|
9
|
+
|
|
10
|
+
POM is mandatory for maintainable E2E suites. It decouples the _test logic_ from the _page structure_.
|
|
11
|
+
|
|
12
|
+
- **Page Class**: Contains selectors (`this.submitBtn`) and actions (`async submit()`).
|
|
13
|
+
- **Test File**: Reads like a user story (`await loginPage.login()`).
|
|
14
|
+
|
|
15
|
+
## Resilient Selectors
|
|
16
|
+
|
|
17
|
+
**Avoid Implementation Details**
|
|
18
|
+
|
|
19
|
+
- ❌ `div > .btn-primary` (Brittle: breaks if CSS changes)
|
|
20
|
+
- ✅ `getByRole('button', { name: 'Submit' })` (Resilient: relies on accessibility tree)
|
|
21
|
+
- ✅ `getByTestId('submit-order')` (Explicit contract)
|
|
22
|
+
|
|
23
|
+
## State Management
|
|
24
|
+
|
|
25
|
+
- **Login**: Don't log in via UI for every test. Use API calls to set the session cookie, then visit the page.
|
|
26
|
+
- **Data**: Create unique data per test (e.g., `user_${timestamp}`) to avoid collision.
|
|
27
|
+
|
|
28
|
+
## Example (Playwright)
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
// pages/CheckoutPage.ts
|
|
32
|
+
export class CheckoutPage {
|
|
33
|
+
constructor(private page: Page) {}
|
|
34
|
+
async placeOrder() {
|
|
35
|
+
await this.page.getByRole("button", { name: "Place Order" }).click();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// tests/checkout.spec.ts
|
|
40
|
+
test("Guest checkout flow", async ({ page }) => {
|
|
41
|
+
const checkout = new CheckoutPage(page);
|
|
42
|
+
await page.goto("/cart");
|
|
43
|
+
await checkout.placeOrder();
|
|
44
|
+
await expect(page.getByText("Thank you!")).toBeVisible();
|
|
45
|
+
});
|
|
46
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Integration Testing Insights & Patterns
|
|
2
|
+
|
|
3
|
+
## Core Philosophy
|
|
4
|
+
|
|
5
|
+
**"Verify the Handshake"**
|
|
6
|
+
Integration tests ensure that your modules speak the same language. The most critical integration is usually between your **Logic Layer** and your **Persistence Layer**.
|
|
7
|
+
|
|
8
|
+
## Scope of Integration
|
|
9
|
+
|
|
10
|
+
1. **Service + Database**: Does the ORM query actually work? adhere to constraints?
|
|
11
|
+
2. **Service + External API**: Does the adapter handle the 3rd party response format correctly?
|
|
12
|
+
3. **Controller + Service**: Does the HTTP layer correctly parse inputs before calling logic?
|
|
13
|
+
|
|
14
|
+
## Testing Strategy
|
|
15
|
+
|
|
16
|
+
1. **Real Database (Containerized)**: Use a real Postgres/MySQL container. Mocks can lie; databases don't.
|
|
17
|
+
2. **Transactional Rollbacks**: If possible, wrap tests in transactions that rollback, or truncate tables between tests.
|
|
18
|
+
3. **Seed Data**: Use factories (e.g., `UserFactory.create()`) to set up complex states quickly.
|
|
19
|
+
|
|
20
|
+
## Example (API + DB)
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
describe("POST /api/register", () => {
|
|
24
|
+
it("should persist user and return 201", () => {
|
|
25
|
+
// Arrange
|
|
26
|
+
const payload = { email: "test@example.com" };
|
|
27
|
+
|
|
28
|
+
// Act
|
|
29
|
+
const response = await api.post("/register", payload);
|
|
30
|
+
|
|
31
|
+
// Assert (Response)
|
|
32
|
+
expect(response.status).toBe(201);
|
|
33
|
+
|
|
34
|
+
// Assert (Persistence)
|
|
35
|
+
const dbUser = await db.users.find({ email: payload.email });
|
|
36
|
+
expect(dbUser).not.toBeNull();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Performance Testing Insights & Patterns
|
|
2
|
+
|
|
3
|
+
## Core Philosophy
|
|
4
|
+
|
|
5
|
+
**"Performance is a Feature"**
|
|
6
|
+
A slow system is a broken system. Performance testing establishes the baseline and catches regressions before they crash production.
|
|
7
|
+
|
|
8
|
+
## Metrics That Matter
|
|
9
|
+
|
|
10
|
+
1. **Latency**: Time to First Byte (TTFB) and Total Duration. (e.g., "95% of requests < 500ms")
|
|
11
|
+
2. **Throughput**: Requests Per Second (RPS) the system can handle.
|
|
12
|
+
3. **Error Rate**: Percentage of failed requests under load.
|
|
13
|
+
|
|
14
|
+
## Testing Types
|
|
15
|
+
|
|
16
|
+
1. **Load Testing**: Simulating expected peak traffic. (Can we handle Black Friday?)
|
|
17
|
+
2. **Stress Testing**: Finding the breaking point. (At what RPS does the DB crash?)
|
|
18
|
+
3. **Soak Testing**: Running load for distinct periods (e.g., 24h) to find memory leaks.
|
|
19
|
+
|
|
20
|
+
## Tools of Trade
|
|
21
|
+
|
|
22
|
+
- **k6**: Developer-friendly, scriptable in JS.
|
|
23
|
+
- **Artillery**: Good for testing Socket.io/WebSockets.
|
|
24
|
+
|
|
25
|
+
## Example (k6 Script)
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import http from "k6/http";
|
|
29
|
+
import { check, sleep } from "k6";
|
|
30
|
+
|
|
31
|
+
export const options = {
|
|
32
|
+
vus: 100, // Virtual Users
|
|
33
|
+
duration: "30s",
|
|
34
|
+
thresholds: {
|
|
35
|
+
http_req_duration: ["p(95)<500"], // 95% of requests must be faster than 500ms
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default function () {
|
|
40
|
+
const res = http.get("https://api.myapp.com/products");
|
|
41
|
+
check(res, { "is status 200": (r) => r.status === 200 });
|
|
42
|
+
sleep(1);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Property-Based Testing Guide
|
|
2
|
+
|
|
3
|
+
> Source: Trail of Bits — property-based-testing skill
|
|
4
|
+
|
|
5
|
+
Use PBT when you detect patterns where it provides stronger coverage than example-based tests.
|
|
6
|
+
|
|
7
|
+
## Auto-Detection Triggers
|
|
8
|
+
|
|
9
|
+
| Pattern | Property | Priority |
|
|
10
|
+
|---------|----------|----------|
|
|
11
|
+
| encode/decode pair | Roundtrip: `decode(encode(x)) == x` | HIGH |
|
|
12
|
+
| Pure function | Multiple properties | HIGH |
|
|
13
|
+
| Validator | Valid after normalize | MEDIUM |
|
|
14
|
+
| Sorting/ordering | Idempotence + ordering | MEDIUM |
|
|
15
|
+
| Normalization | Idempotence: `f(f(x)) == f(x)` | MEDIUM |
|
|
16
|
+
|
|
17
|
+
## Property Catalog
|
|
18
|
+
|
|
19
|
+
| Property | Formula | When |
|
|
20
|
+
|----------|---------|------|
|
|
21
|
+
| **Roundtrip** | `decode(encode(x)) == x` | Serialization pairs |
|
|
22
|
+
| **Idempotence** | `f(f(x)) == f(x)` | Normalization, formatting |
|
|
23
|
+
| **Invariant** | Property holds before/after | Any transformation |
|
|
24
|
+
| **Commutativity** | `f(a, b) == f(b, a)` | Set operations |
|
|
25
|
+
| **Oracle** | `new_impl(x) == reference(x)` | Optimization, refactoring |
|
|
26
|
+
| **No Exception** | No crash on valid input | Baseline property |
|
|
27
|
+
|
|
28
|
+
**Strength hierarchy**: No Exception → Type Preservation → Invariant → Idempotence → Roundtrip
|
|
29
|
+
|
|
30
|
+
## Libraries
|
|
31
|
+
|
|
32
|
+
| Language | Library |
|
|
33
|
+
|----------|---------|
|
|
34
|
+
| Python | Hypothesis |
|
|
35
|
+
| JavaScript | fast-check |
|
|
36
|
+
| Rust | proptest |
|
|
37
|
+
| Go | gopter |
|
|
38
|
+
| Java | jqwik |
|
|
39
|
+
|
|
40
|
+
## How to Suggest PBT
|
|
41
|
+
|
|
42
|
+
> "I notice `encode_message`/`decode_message` is a serialization pair. PBT with roundtrip property would provide stronger coverage. Want me to use that approach?"
|
|
43
|
+
|
|
44
|
+
If user declines → write good example-based tests, no further prompting.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Security Audit: Insecure Defaults Detection
|
|
2
|
+
|
|
3
|
+
> Source: Trail of Bits — insecure-defaults skill
|
|
4
|
+
|
|
5
|
+
Finds **fail-open** vulnerabilities where apps run insecurely with missing configuration.
|
|
6
|
+
|
|
7
|
+
## Key Distinction
|
|
8
|
+
- **Fail-open (CRITICAL):** `SECRET = env.get('KEY') or 'default'` → App runs with weak secret
|
|
9
|
+
- **Fail-secure (SAFE):** `SECRET = env['KEY']` → App crashes if missing
|
|
10
|
+
|
|
11
|
+
## Search Patterns
|
|
12
|
+
|
|
13
|
+
**Fallback secrets:**
|
|
14
|
+
- `getenv.*\) or ['"]` | `process\.env\.[A-Z_]+ \|\| ['"]` | `ENV\.fetch.*default:`
|
|
15
|
+
|
|
16
|
+
**Hardcoded credentials:**
|
|
17
|
+
- `password.*=.*['"][^'"]{8,}['"]` | `api[_-]?key.*=.*['"][^'"]+['"]`
|
|
18
|
+
|
|
19
|
+
**Weak defaults:**
|
|
20
|
+
- `DEBUG.*=.*true` | `AUTH.*=.*false` | `CORS.*=.*\*`
|
|
21
|
+
|
|
22
|
+
**Weak crypto:**
|
|
23
|
+
- `MD5|SHA1|DES|RC4|ECB` in security contexts
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
### 1. SEARCH — Find insecure defaults
|
|
28
|
+
Focus on `**/config/`, `**/auth/`, `**/database/`, and env files.
|
|
29
|
+
|
|
30
|
+
### 2. VERIFY — Check actual behavior
|
|
31
|
+
- When is this code executed?
|
|
32
|
+
- What happens if config variable is missing?
|
|
33
|
+
- Is there validation enforcing secure configuration?
|
|
34
|
+
|
|
35
|
+
### 3. CONFIRM — Production impact
|
|
36
|
+
- Production config provides the variable → Lower severity
|
|
37
|
+
- Production config missing → CRITICAL
|
|
38
|
+
|
|
39
|
+
### 4. REPORT — With evidence
|
|
40
|
+
```
|
|
41
|
+
Finding: Hardcoded JWT Secret Fallback
|
|
42
|
+
Location: src/auth/jwt.ts:15
|
|
43
|
+
Pattern: const secret = process.env.JWT_SECRET || 'default';
|
|
44
|
+
Verification: App starts without JWT_SECRET set
|
|
45
|
+
Exploitation: Attacker forges JWTs using 'default'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Rationalizations to Reject
|
|
49
|
+
|
|
50
|
+
- "It's just a development default" → If it reaches production code, it's a finding
|
|
51
|
+
- "The production config overrides it" → Verify prod config exists
|
|
52
|
+
- "This would never run without proper config" → Prove it with code trace
|
|
53
|
+
- "We'll fix it before release" → Document now; "later" rarely comes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Security Testing Insights & Patterns
|
|
2
|
+
|
|
3
|
+
## Core Philosophy
|
|
4
|
+
|
|
5
|
+
**"Trust No Input"**
|
|
6
|
+
Assume every input field, header, and parameter is an attack vector. Security testing proactively seeks to exploit these vectors.
|
|
7
|
+
|
|
8
|
+
## Key Attack Vectors
|
|
9
|
+
|
|
10
|
+
1. **XSS (Cross-Site Scripting)**:
|
|
11
|
+
- **Insight**: Browsers execute scripts reflected from the server.
|
|
12
|
+
- **Test**: Inject `<img src=x onerror=alert(1)>` into comments/profiles.
|
|
13
|
+
2. **SQL Injection (SQLi)**:
|
|
14
|
+
- **Insight**: Manipulating queries via input.
|
|
15
|
+
- **Test**: Input `' OR '1'='1` in search bars or login forms.
|
|
16
|
+
3. **IDOR (Insecure Direct Object References)**:
|
|
17
|
+
- **Insight**: Changing an ID in the URL (`/orders/5`) to access another user's data (`/orders/6`).
|
|
18
|
+
- **Test**: Login as User A, request User B's resource ID.
|
|
19
|
+
|
|
20
|
+
## Automation
|
|
21
|
+
|
|
22
|
+
- **SAST (Static Application Security Testing)**: Scan code for known vulnerabilities (e.g., `npm audit`, `SonarQube`).
|
|
23
|
+
- **DAST (Dynamic Application Security Testing)**: Attack the running app (e.g., `OWASP ZAP`).
|
|
24
|
+
|
|
25
|
+
## Checklist
|
|
26
|
+
|
|
27
|
+
- [ ] Are dependencies patched? (`npm audit`)
|
|
28
|
+
- [ ] Is Rate Limiting active?
|
|
29
|
+
- [ ] Are sensitive headers (Authorization) leaked in logs?
|
|
30
|
+
- [ ] Do 403 Forbidden errors leak implementation details?
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Sharp Edges: API Footgun Analysis
|
|
2
|
+
|
|
3
|
+
> Source: Trail of Bits — sharp-edges skill
|
|
4
|
+
|
|
5
|
+
Evaluates whether APIs, configs, and interfaces are resistant to developer misuse.
|
|
6
|
+
|
|
7
|
+
## Core Principle
|
|
8
|
+
**The pit of success**: Secure usage should be the path of least resistance.
|
|
9
|
+
|
|
10
|
+
## 6 Categories of Sharp Edges
|
|
11
|
+
|
|
12
|
+
### 1. Algorithm/Mode Selection Footguns
|
|
13
|
+
APIs that let devs choose algorithms invite choosing wrong ones.
|
|
14
|
+
- Detection: `algorithm`, `mode`, `cipher`, `hash_type` parameters
|
|
15
|
+
|
|
16
|
+
### 2. Dangerous Defaults
|
|
17
|
+
Defaults that are insecure, or zero/empty values that disable security.
|
|
18
|
+
- Ask: What happens with `timeout=0`? `max_attempts=0`? `key=""`?
|
|
19
|
+
|
|
20
|
+
### 3. Primitive vs. Semantic APIs
|
|
21
|
+
APIs exposing raw bytes instead of meaningful types invite confusion.
|
|
22
|
+
- Detection: Functions taking `bytes`/`string` for distinct security concepts
|
|
23
|
+
|
|
24
|
+
### 4. Configuration Cliffs
|
|
25
|
+
One wrong setting creates catastrophic failure with no warning.
|
|
26
|
+
- Detection: Boolean flags that disable security entirely
|
|
27
|
+
|
|
28
|
+
### 5. Silent Failures
|
|
29
|
+
Errors that don't surface, or success that masks failure.
|
|
30
|
+
- Detection: Functions returning booleans instead of throwing on security failures
|
|
31
|
+
|
|
32
|
+
### 6. Stringly-Typed Security
|
|
33
|
+
Security-critical values as plain strings enable injection.
|
|
34
|
+
- Detection: Permissions as comma-separated strings instead of enums
|
|
35
|
+
|
|
36
|
+
## 3 Adversary Types
|
|
37
|
+
|
|
38
|
+
1. **The Scoundrel** — Actively malicious (can they disable security via config?)
|
|
39
|
+
2. **The Lazy Developer** — Copy-pastes examples (is the first example secure?)
|
|
40
|
+
3. **The Confused Developer** — Misunderstands API (can parameters be swapped?)
|
|
41
|
+
|
|
42
|
+
## Severity
|
|
43
|
+
|
|
44
|
+
| Severity | Criteria |
|
|
45
|
+
|----------|----------|
|
|
46
|
+
| Critical | Default or obvious usage is insecure |
|
|
47
|
+
| High | Easy misconfiguration breaks security |
|
|
48
|
+
| Medium | Unusual but possible misconfiguration |
|
|
49
|
+
| Low | Requires deliberate misuse |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Static Analysis with Semgrep
|
|
2
|
+
|
|
3
|
+
> Source: Trail of Bits — static-analysis/semgrep skill
|
|
4
|
+
|
|
5
|
+
Run Semgrep scan with language detection and parallel execution.
|
|
6
|
+
|
|
7
|
+
## Essential Principles
|
|
8
|
+
|
|
9
|
+
1. **Always use `--metrics=off`** — prevent telemetry data leakage
|
|
10
|
+
2. **User must approve scan plan** — present rulesets before scanning
|
|
11
|
+
3. **Third-party rulesets required** — Trail of Bits, 0xdea, Decurity rules catch vendor-missing vulns
|
|
12
|
+
4. **Check for Semgrep Pro** — cross-file taint tracking catches ~250% more true positives
|
|
13
|
+
|
|
14
|
+
## Scan Modes
|
|
15
|
+
|
|
16
|
+
| Mode | Coverage | Findings |
|
|
17
|
+
|------|----------|----------|
|
|
18
|
+
| **Run all** | All rulesets, all severity | Everything |
|
|
19
|
+
| **Important only** | Pre/post-filtered | Security vulns, medium-high confidence |
|
|
20
|
+
|
|
21
|
+
## Quick Workflow
|
|
22
|
+
|
|
23
|
+
### 1. Detect languages + check Pro
|
|
24
|
+
```bash
|
|
25
|
+
semgrep --version
|
|
26
|
+
semgrep --pro --validate --config p/default 2>/dev/null && echo "Pro" || echo "OSS"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Select rulesets per language
|
|
30
|
+
Include official + third-party rules for each detected language.
|
|
31
|
+
|
|
32
|
+
### 3. Get user approval (HARD GATE)
|
|
33
|
+
Present exact rulesets, target, engine, and mode — wait for "yes".
|
|
34
|
+
|
|
35
|
+
### 4. Run parallel scans
|
|
36
|
+
One scan per language/ruleset combination. All in parallel.
|
|
37
|
+
|
|
38
|
+
### 5. Merge & report
|
|
39
|
+
Merge SARIF outputs, summarize by severity and category.
|
|
40
|
+
|
|
41
|
+
## Key Commands
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Basic scan
|
|
45
|
+
semgrep --config p/security-audit --metrics=off --sarif -o results.sarif .
|
|
46
|
+
|
|
47
|
+
# Important only
|
|
48
|
+
semgrep --config p/security-audit --metrics=off --severity MEDIUM --severity HIGH --severity CRITICAL .
|
|
49
|
+
|
|
50
|
+
# With third-party rules
|
|
51
|
+
semgrep --config p/security-audit --config "https://semgrep.dev/p/trailofbits" --metrics=off .
|
|
52
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Supply Chain Risk Audit
|
|
2
|
+
|
|
3
|
+
> Source: Trail of Bits — supply-chain-risk-auditor skill
|
|
4
|
+
|
|
5
|
+
Systematically evaluate all dependencies to identify risk of exploitation or takeover.
|
|
6
|
+
|
|
7
|
+
## Risk Criteria
|
|
8
|
+
|
|
9
|
+
A dependency is high-risk if:
|
|
10
|
+
|
|
11
|
+
| Factor | Description |
|
|
12
|
+
|--------|-------------|
|
|
13
|
+
| **Single maintainer** | Solo individual, not org-backed. Anonymous = higher risk |
|
|
14
|
+
| **Unmaintained** | No updates for long period, archived, or seeking new maintainers |
|
|
15
|
+
| **Low popularity** | Few GitHub stars/downloads relative to other deps |
|
|
16
|
+
| **High-risk features** | FFI, deserialization, third-party code execution |
|
|
17
|
+
| **Past CVEs** | High/critical severity CVEs, especially many relative to size |
|
|
18
|
+
| **No security contact** | No SECURITY.md, no security email listed |
|
|
19
|
+
|
|
20
|
+
## Workflow
|
|
21
|
+
|
|
22
|
+
### 1. Initial Setup
|
|
23
|
+
```bash
|
|
24
|
+
# List all direct dependencies
|
|
25
|
+
cat package.json | jq '.dependencies' # Node.js
|
|
26
|
+
# or: pip list --format=json | jq '.[].name' # Python
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. For Each Dependency
|
|
30
|
+
Use `gh` CLI to check:
|
|
31
|
+
- Stars count, last commit date
|
|
32
|
+
- Number of contributors
|
|
33
|
+
- Open security issues
|
|
34
|
+
- SECURITY.md presence
|
|
35
|
+
|
|
36
|
+
### 3. Report
|
|
37
|
+
For each high-risk dep:
|
|
38
|
+
- Risk factors identified
|
|
39
|
+
- Suggested alternatives (more popular, better maintained)
|
|
40
|
+
- Short justification
|
|
41
|
+
|
|
42
|
+
### 4. Summary
|
|
43
|
+
- Total deps scanned
|
|
44
|
+
- Count by risk factor
|
|
45
|
+
- Executive summary of security posture
|
|
46
|
+
- Top recommendations
|
|
47
|
+
|
|
48
|
+
## Example Output
|
|
49
|
+
```markdown
|
|
50
|
+
| Dependency | Risk Factors | Alternative |
|
|
51
|
+
|-----------|-------------|-------------|
|
|
52
|
+
| tiny-parser | Single maintainer, 12⭐, no SECURITY.md | safer-parser (org-backed, 5k⭐) |
|
|
53
|
+
| old-crypto | Unmaintained (2yr), 3 CVEs | node:crypto (built-in) |
|
|
54
|
+
```
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Test Case Standards & Templates
|
|
2
|
+
|
|
3
|
+
To ensure "detailed and specific" test testing, all test cases must follow these standards.
|
|
4
|
+
|
|
5
|
+
## 1. The Anatomy of a Perfect Test Case
|
|
6
|
+
|
|
7
|
+
A test case is not just a sentence; it is a script that a machine or a human can execute without ambiguity.
|
|
8
|
+
|
|
9
|
+
| Field | Description | Example |
|
|
10
|
+
| :------------------ | :------------------------------------------- | :----------------------------------------------------------------------------- |
|
|
11
|
+
| **ID** | Unique Identifier | `TC-AUTH-001` |
|
|
12
|
+
| **Title** | Concise summary including Condition & Result | `Login - Valid Credentials - Redirects to Dashboard` |
|
|
13
|
+
| **Priority** | P0 (Critical), P1 (High), P2 (Medium) | `P0` |
|
|
14
|
+
| **Type** | Functional, Security, UI, Performance, API | `Functional` |
|
|
15
|
+
| **Pre-conditions** | State required _before_ the test starts | 1. App is open<br>2. User is registered<br>3. User is logged out |
|
|
16
|
+
| **Test Data** | Specific data values used | email: `test@example.com`, pass: `Correct123!` |
|
|
17
|
+
| **Steps** | Numbered, atomic actions | 1. Click "Login" button<br>2. Enter email<br>3. Enter password<br>4. Submit |
|
|
18
|
+
| **Expected Result** | Verifiable outcome for _each_ critical step | 1. Login form appears<br>4. Dashboard loads within 2s, "Welcome" toast appears |
|
|
19
|
+
|
|
20
|
+
## 2. Granularity Rules
|
|
21
|
+
|
|
22
|
+
- **One Action per Step**: Do not combine actions.
|
|
23
|
+
- ❌ _Bad_: "Enter credentials and click login."
|
|
24
|
+
- ✅ _Good_:
|
|
25
|
+
1. Enter "user@example.com" in Email field.
|
|
26
|
+
2. Enter "password" in Password field.
|
|
27
|
+
3. Click "Sign In" button.
|
|
28
|
+
- **Specific Data**: Never use "valid data" or "random text".
|
|
29
|
+
- ❌ _Bad_: "Enter valid email."
|
|
30
|
+
- ✅ _Good_: "Enter `user_verified@domain.com`."
|
|
31
|
+
- **Verifiable Results**: Avoid vague outcomes.
|
|
32
|
+
- ❌ _Bad_: "It works."
|
|
33
|
+
- ✅ _Good_: "URL changes to `/dashboard`, and 'Logout' button is visible."
|
|
34
|
+
|
|
35
|
+
## 3. Test Case Templates
|
|
36
|
+
|
|
37
|
+
### Template A: UI/Functional Test
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
**ID**: TC-[Module]-[Number]
|
|
41
|
+
**Title**: [Action] - [Condition] -> [Outcome]
|
|
42
|
+
**Priority**: [P0/P1/P2]
|
|
43
|
+
**Pre-conditions**:
|
|
44
|
+
|
|
45
|
+
1. [State 1]
|
|
46
|
+
2. [State 2]
|
|
47
|
+
|
|
48
|
+
**Test Data**:
|
|
49
|
+
|
|
50
|
+
- [Field 1]: [Value]
|
|
51
|
+
- [Field 2]: [Value]
|
|
52
|
+
|
|
53
|
+
**Steps**:
|
|
54
|
+
|
|
55
|
+
1. [Step 1 execution]
|
|
56
|
+
2. [Step 2 execution]
|
|
57
|
+
|
|
58
|
+
**Expected Results**:
|
|
59
|
+
|
|
60
|
+
- [Verification 1]
|
|
61
|
+
- [Verification 2]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Template B: API Test
|
|
65
|
+
|
|
66
|
+
````markdown
|
|
67
|
+
**ID**: API-[Endpoint]-[Number]
|
|
68
|
+
**Title**: [Method] [Endpoint] - [Scenario]
|
|
69
|
+
**Priority**: P1
|
|
70
|
+
|
|
71
|
+
**Request**:
|
|
72
|
+
|
|
73
|
+
- Method: POST
|
|
74
|
+
- URL: `/api/v1/orders`
|
|
75
|
+
- Headers: `Authorization: Bearer <token>`
|
|
76
|
+
- Body:
|
|
77
|
+
```json
|
|
78
|
+
{ "item": "id_123", "qty": 1 }
|
|
79
|
+
```
|
|
80
|
+
````
|
|
81
|
+
|
|
82
|
+
**Expected Response**:
|
|
83
|
+
|
|
84
|
+
- Status Code: 201 Created
|
|
85
|
+
- Body Schema Match: `OrderResponse`
|
|
86
|
+
- DB Info: Record created in `orders` table
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## 4. Writing Best Practices
|
|
91
|
+
|
|
92
|
+
1. **Golden Path First**: Always write the "Happy Path" (Success case) first.
|
|
93
|
+
2. **Negative Testing**: Immediately follow with failure cases (Validation errors, Timeout, Bad Auth).
|
|
94
|
+
3. **Atomic Independence**: Tests should not depend on the "memory" of previous tests (unless explicitly an End-to-End flow).
|
|
95
|
+
4. **Clean Up**: If a test creates data (e.g., "Create User"), define the cleanup or use ephemeral environments.
|
|
96
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Test Execution Report
|
|
2
|
+
|
|
3
|
+
**Date**: {{DATE}}
|
|
4
|
+
**Environment**: {{ENVIRONMENT}} (e.g., Local, Staging)
|
|
5
|
+
**Commit**: {{COMMIT_HASH}}
|
|
6
|
+
|
|
7
|
+
## Executive Summary
|
|
8
|
+
|
|
9
|
+
- **Total Tests**: {{TOTAL}}
|
|
10
|
+
- **Passed**: {{PASSED}} ({{PASS_RATE}}%)
|
|
11
|
+
- **Failed**: {{FAILED}}
|
|
12
|
+
- **Skipped**: {{SKIPPED}}
|
|
13
|
+
- **Critical Defects Found**: {{CRITICAL_COUNT}}
|
|
14
|
+
|
|
15
|
+
## Failure Analysis
|
|
16
|
+
|
|
17
|
+
| Test ID | Failure Message | Root Cause | Resolution |
|
|
18
|
+
| :------------ | :------------------------------------ | :-------------------------- | :------------------------------------ |
|
|
19
|
+
| `TC-AUTH-002` | `Expected 'Dashboard', found 'Login'` | Auth token expiry logic bug | **Fixed**: Updated `auth.ts` logic |
|
|
20
|
+
| `TC-CART-005` | `Checkout button not clickable` | Z-index overlap | **Fixed**: Adjusted CSS in `cart.css` |
|
|
21
|
+
|
|
22
|
+
## Bug Resolution Log
|
|
23
|
+
|
|
24
|
+
(List of bugs fixed during this cycle)
|
|
25
|
+
|
|
26
|
+
1. Found [Active Bug] during `TC-AUTH-002`. Fixed in [File Link]. Verified Pass.
|
|
27
|
+
2. Found [Active Bug] during `TC-UI-009`. Fixed in [File Link]. Verified Pass.
|
|
28
|
+
|
|
29
|
+
## Recommendations
|
|
30
|
+
|
|
31
|
+
- [ ] Merge to production
|
|
32
|
+
- [ ] Requires manual review of [Specific Feature]
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Unit Testing Insights & Patterns
|
|
2
|
+
|
|
3
|
+
## Core Philosophy
|
|
4
|
+
|
|
5
|
+
**"Test Behavior, Not Implementation"**
|
|
6
|
+
Unit tests should verify _what_ the code does, not _how_ it does it. This makes refactoring safer.
|
|
7
|
+
|
|
8
|
+
## The AAA Pattern (Arrange, Act, Assert)
|
|
9
|
+
|
|
10
|
+
This is the gold standard for readability.
|
|
11
|
+
|
|
12
|
+
1. **Arrange**: meticulous setup of inputs and mocks.
|
|
13
|
+
2. **Act**: A single line of code triggering the function.
|
|
14
|
+
3. **Assert**: Clear verification of the output.
|
|
15
|
+
|
|
16
|
+
## Dealing with Dependencies
|
|
17
|
+
|
|
18
|
+
**Mock Everything External**
|
|
19
|
+
|
|
20
|
+
- Database calls? Mock them.
|
|
21
|
+
- API requests? Mock them.
|
|
22
|
+
- File system? Mock it.
|
|
23
|
+
If you touch the database, it's not a unit test (it's integration).
|
|
24
|
+
|
|
25
|
+
## Best Practices
|
|
26
|
+
|
|
27
|
+
1. **Descriptive Naming**: `it('should return 400 if email is invalid')` is better than `it('test error')`.
|
|
28
|
+
2. **One Concept Per Test**: Don't test validation and success in the same `it` block.
|
|
29
|
+
3. **Boundary Value Analysis**: Always test `0`, `1`, `Max`, `Max+1`, `null`, `undefined`.
|
|
30
|
+
|
|
31
|
+
## Example (Vitest)
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { describe, it, expect, vi } from "vitest";
|
|
35
|
+
import { calculateDiscount } from "./pricing.utils";
|
|
36
|
+
|
|
37
|
+
describe("Pricing Utils", () => {
|
|
38
|
+
it("should apply 10% discount for VIP users", () => {
|
|
39
|
+
// Arrange
|
|
40
|
+
const user = { type: "VIP" };
|
|
41
|
+
const price = 100;
|
|
42
|
+
|
|
43
|
+
// Act
|
|
44
|
+
const finalPrice = calculateDiscount(user, price);
|
|
45
|
+
|
|
46
|
+
// Assert
|
|
47
|
+
expect(finalPrice).toBe(90);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Visual Regression Testing
|
|
2
|
+
|
|
3
|
+
> **Optional Module**: Consult this guide when pixel-perfect UI stability is required.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Detect unintended visual changes (layout shifts, color changes, broken assets) that functional tests might miss.
|
|
8
|
+
|
|
9
|
+
## Strategy
|
|
10
|
+
|
|
11
|
+
1. **Golden Snapshots**: Commit "approved" screenshots of UI states to the repo.
|
|
12
|
+
2. **Comparison**: On test run, capture new screenshot and diff pixel-by-pixel.
|
|
13
|
+
3. **Threshold**: Allow a small % (e.g., 0.1%) difference for anti-aliasing noise.
|
|
14
|
+
|
|
15
|
+
## Implementation (Playwright)
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
test("profile card looks correct", async ({ page }) => {
|
|
19
|
+
await page.goto("/profile/123");
|
|
20
|
+
|
|
21
|
+
// Mask dynamic content (dates, usernames) to prevent flakes
|
|
22
|
+
await expect(page).toHaveScreenshot("profile-card.png", {
|
|
23
|
+
mask: [page.locator(".timestamp")],
|
|
24
|
+
maxDiffPixelRatio: 0.01,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Best Practices
|
|
30
|
+
|
|
31
|
+
- **Dockerize**: Run visual tests in Docker to ensure font rendering consistency across OSs.
|
|
32
|
+
- **Component Level**: Prefer Visual Testing at the Storybook/Component level (using Percy/Chromatic) over full page E2E screenshots.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# User Acceptance Test (UAT) Plan
|
|
2
|
+
|
|
3
|
+
## 1. Overview
|
|
4
|
+
|
|
5
|
+
- **Feature**: ...
|
|
6
|
+
- **Version**: ...
|
|
7
|
+
- **Testers**: [List of Business Users]
|
|
8
|
+
- **Environment**: Staging / UAT Sandbox
|
|
9
|
+
|
|
10
|
+
## 2. Test Strategy
|
|
11
|
+
|
|
12
|
+
- **Scope**: Verification of "Happy Path" and key business rules.
|
|
13
|
+
- **Out of Scope**: Load testing, Security penetration testing.
|
|
14
|
+
- **Entry Criteria**: QA Pass, Critical bugs fixed.
|
|
15
|
+
- **Exit Criteria**: 100% Critical cases passed, Sign-off from Product Owner.
|
|
16
|
+
|
|
17
|
+
## 3. Test Cases
|
|
18
|
+
|
|
19
|
+
| ID | Description | Steps | Expected Result | Actual Result | Status (Pass/Fail) |
|
|
20
|
+
| :----- | :--------------- | :------------------------------------- | :-------------------------------- | :------------ | :----------------- |
|
|
21
|
+
| UAT-01 | Login successful | 1. Enter valid creds<br>2. Click Login | Redirect to Dashboard | | |
|
|
22
|
+
| UAT-02 | Purchase item | 1. Add to cart<br>2. Checkout | Order Confirmation Email received | | |
|
|
23
|
+
|
|
24
|
+
## 4. Defect Log (Template)
|
|
25
|
+
|
|
26
|
+
| Defect ID | Severity | Description | Steps to Reproduce | Assigned To |
|
|
27
|
+
| :-------- | :------- | :---------------------------------- | :----------------- | :---------- |
|
|
28
|
+
| BUG-101 | High | Checkout crashes on currency switch | ... | Dev Team |
|
|
29
|
+
|
|
30
|
+
## 5. Sign-off
|
|
31
|
+
|
|
32
|
+
- [ ] I confirm the system meets business requirements.
|
|
33
|
+
- **Name**: ...
|
|
34
|
+
- **Date**: ...
|