synapse-hub 2.2.3 → 2.4.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/.agents/agents/failure-analyst.md +11 -0
- package/.agents/agents/live-explorer.md +28 -0
- package/.agents/agents/orchestrator.md +20 -4
- package/.agents/agents/pom-crafter.md +12 -0
- package/.agents/agents/quality-gatekeeper.md +19 -4
- package/.agents/agents/test-runner.md +11 -0
- package/.agents/rules/communication-style.md +40 -0
- package/.agents/rules/context-engineering.md +23 -0
- package/.agents/rules/git-push-protocol.md +11 -17
- package/.agents/rules/graphify.md +14 -14
- package/.agents/rules/lessons-learned.md +3 -3
- package/.agents/rules/mandatory-playwright-live.md +29 -29
- package/.agents/rules/mobile_appium_rules.md +132 -0
- package/.agents/rules/performance_testing_rules.md +74 -0
- package/.agents/rules/skill-precedence.md +1 -1
- package/.agents/rules/systematic-debugging.md +6 -6
- package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +64 -215
- package/.agents/skills/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +12 -0
- package/.agents/skills/antigravity-test-sentinel/SKILL.md +3 -3
- package/.agents/skills/antigravity-test-sentinel/examples/dod_gate_policy.json +11 -0
- package/.agents/skills/api-network-mocking-interception/SKILL.md +1 -1
- package/.agents/skills/api-network-mocking-interception/examples/network_route_stub.json +9 -0
- package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +9 -9
- package/.agents/skills/api-spec-to-e2e-matrix/examples/sample_openapi.json +19 -0
- package/.agents/skills/architecture-decision-records/SKILL.md +35 -412
- package/.agents/skills/architecture-decision-records/examples/0001-record-architecture-decisions.md +12 -0
- package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +4 -1
- package/.agents/skills/auth-session-and-cookie-manager/examples/storage_state_sample.json +11 -0
- package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +80 -186
- package/.agents/skills/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +13 -0
- package/.agents/skills/bats-testing-patterns/SKILL.md +1 -1
- package/.agents/skills/bats-testing-patterns/examples/cli_runner_test.bats +6 -0
- package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -614
- package/.agents/skills/clean-pom-crafter/SKILL.md +21 -3
- package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -28
- package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -138
- package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +2 -2
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +9 -0
- package/.agents/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +9 -7
- package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +5 -5
- package/.agents/skills/db-state-verifier-and-seeder/examples/db_fixture_seed.json +12 -0
- package/.agents/skills/e2e-testing-patterns/SKILL.md +1 -1
- package/.agents/skills/e2e-testing-patterns/examples/playwright_sharded_config.ts +12 -0
- package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -522
- package/.agents/skills/failure-autopsy-and-healing/SKILL.md +17 -3
- package/.agents/skills/failure-autopsy-and-healing/examples/sample_junit_failure.xml +8 -0
- package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -64
- package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -56
- package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +98 -98
- package/.agents/skills/file-and-report-validator/SKILL.md +1 -1
- package/.agents/skills/file-and-report-validator/examples/sample_export_schema.json +14 -0
- package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +3 -3
- package/.agents/skills/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +11 -0
- package/.agents/skills/gherkin-to-suite/SKILL.md +103 -0
- package/.agents/skills/gherkin-to-suite/examples/checkout.feature +39 -0
- package/.agents/skills/gherkin-to-suite/examples/suite_report_sample.json +334 -0
- package/.agents/skills/github-actions-templates/SKILL.md +47 -304
- package/.agents/skills/github-actions-templates/examples/matrix_test_pipeline.yml +8 -0
- package/.agents/skills/graphify-impact-analyzer/SKILL.md +6 -6
- package/.agents/skills/graphify-impact-analyzer/examples/dependency_blast_radius.json +8 -0
- package/.agents/skills/katalon-cli-runner/SKILL.md +2 -2
- package/.agents/skills/katalon-cli-runner/examples/headless_kre_exec.sh +3 -0
- package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -209
- package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -155
- package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -67
- package/.agents/skills/lam-script-generator/SKILL.md +42 -1
- package/.agents/skills/lam-script-generator/examples/user_story_sample.md +8 -0
- package/.agents/skills/lean-code-ladder/SKILL.md +83 -0
- package/.agents/skills/lean-code-ladder/examples/ladder_walkthrough.md +37 -0
- package/.agents/skills/meta-prompt-crafter/SKILL.md +107 -0
- package/.agents/skills/meta-prompt-crafter/examples/qa_prompt_template.md +35 -0
- package/.agents/skills/persistent-planning-files/SKILL.md +108 -0
- package/.agents/skills/persistent-planning-files/examples/task_plan_example.md +56 -0
- package/.agents/skills/playwright-live-interaction/SKILL.md +49 -1
- package/.agents/skills/playwright-live-interaction/examples/live_probe_script.js +5 -0
- package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -160
- package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -75
- package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -388
- package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -134
- package/.agents/skills/playwright-webapp-testing/SKILL.md +93 -0
- package/.agents/skills/playwright-webapp-testing/examples/server_lifecycle_playwright.py +63 -0
- package/.agents/skills/rbt-manual-testing/SKILL.md +150 -0
- package/.agents/skills/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +25 -0
- package/.agents/skills/security-dast-sentinel/SKILL.md +57 -135
- package/.agents/skills/security-dast-sentinel/examples/dast_scan_config.json +10 -0
- package/.agents/skills/self-healing-locator/SKILL.md +24 -10
- package/.agents/skills/self-healing-locator/examples/aom_diff_sample.json +16 -0
- package/.agents/skills/skillspector-security-guard/SKILL.md +32 -90
- package/.agents/skills/skillspector-security-guard/examples/safe_mcp_config.json +12 -0
- package/.agents/skills/surgical-coding-principles/SKILL.md +89 -0
- package/.agents/skills/surgical-coding-principles/examples/surgical_vs_scope_creep.md +46 -0
- package/.agents/skills/synthetic-test-data-generator/SKILL.md +3 -3
- package/.agents/skills/synthetic-test-data-generator/examples/idempotent_data_recipe.json +9 -0
- package/.agents/skills/systematic-debugging/SKILL.md +100 -0
- package/.agents/skills/systematic-debugging/examples/four_phase_case.md +44 -0
- package/.agents/skills/test-driven-development/SKILL.md +114 -0
- package/.agents/skills/test-driven-development/examples/red_green_refactor_qa.md +78 -0
- package/.agents/skills/token-and-context-optimizer/SKILL.md +1 -1
- package/.agents/skills/token-and-context-optimizer/examples/distilled_log_sample.txt +3 -0
- package/.agents/skills/verification-before-completion/SKILL.md +100 -0
- package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +46 -0
- package/.agents/skills/visual-regression-sentinel/SKILL.md +21 -1
- package/.agents/skills/visual-regression-sentinel/examples/visual_mask_rules.json +9 -0
- package/.agents/skills/wcag-audit-patterns/SKILL.md +3 -3
- package/.agents/skills/wcag-audit-patterns/examples/wcag_compliance_checklist.json +10 -0
- package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -541
- package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +1 -1
- package/.agents/skills/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +6 -0
- package/.agents/templates/completion_report.md +57 -57
- package/.agents/workflows/analyze_requirement_document.md +18 -0
- package/.agents/workflows/export_testcases_excel.md +32 -0
- package/.agents/workflows/generate_combinatorial_test_data.md +28 -0
- package/.agents/workflows/generate_cross_module_test_plan.md +37 -0
- package/.agents/workflows/generate_manual_testcases_rbt.md +56 -0
- package/.agents/workflows/generate_requirements_from_website.md +25 -0
- package/.agents/workflows/generate_testcases_from_requirements.md +21 -0
- package/.agents/workflows/graphify.md +10 -10
- package/.agents/workflows/verify.md +2 -2
- package/.cursor/rules/language.mdc +7 -7
- package/.cursor/rules/synapse-qa.mdc +23 -0
- package/.cursorrules +7 -0
- package/.pre-commit-hooks.yaml +14 -0
- package/.windsurfrules +7 -0
- package/AGENTS.md +54 -15
- package/CLAUDE.md +35 -12
- package/LICENSE +30 -0
- package/NOTICE +180 -0
- package/README.en.md +325 -0
- package/README.md +247 -512
- package/action.yml +51 -0
- package/benchmarks/qa_eval/README.md +71 -0
- package/benchmarks/qa_eval/build_dataset.py +677 -0
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-06_api_contract_drift.json +22 -0
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-07_api_contract_drift.json +22 -0
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-08_api_contract_drift.json +22 -0
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-09_api_contract_drift.json +22 -0
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-10_api_contract_drift.json +22 -0
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-21_fake_pass_tautology.json +21 -0
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-22_fake_pass_tautology.json +21 -0
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-23_fake_pass_tautology.json +21 -0
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-24_fake_pass_tautology.json +21 -0
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-25_fake_pass_tautology.json +21 -0
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-01_locator_drift.json +23 -0
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-02_locator_drift.json +23 -0
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-03_locator_drift.json +23 -0
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-04_locator_drift.json +23 -0
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-05_locator_drift.json +23 -0
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-16_stale_and_mutation.json +22 -0
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-17_stale_and_mutation.json +22 -0
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-18_stale_and_mutation.json +22 -0
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-19_stale_and_mutation.json +22 -0
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-20_stale_and_mutation.json +23 -0
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-11_timing_and_race.json +22 -0
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-12_timing_and_race.json +22 -0
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-13_timing_and_race.json +22 -0
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-14_timing_and_race.json +22 -0
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-15_timing_and_race.json +22 -0
- package/benchmarks/qa_eval/eval_runner.py +418 -0
- package/benchmarks/qa_eval/reports/AB_METHODOLOGY_REPORT.md +83 -0
- package/benchmarks/qa_eval/reports/BENCHMARK_REPORT.md +69 -0
- package/benchmarks/qa_eval/reports/eval_results.json +105 -0
- package/bin/agent-qa.js +10 -3
- package/docs/ARCHITECTURE.md +107 -0
- package/docs/CI_CD_INTEGRATION.md +94 -0
- package/docs/CLI_REFERENCE.md +157 -0
- package/docs/CONTRIBUTING.md +91 -0
- package/docs/PLUGIN_DEVELOPMENT_GUIDE.md +126 -0
- package/docs/TOKEN_QUOTA_PLAYBOOK.md +41 -0
- package/docs/adopted-ecosystem-tools.md +87 -0
- package/docs/schemas/synapse.config.schema.json +64 -0
- package/examples/cypress-ecommerce-suite/README.md +45 -0
- package/examples/cypress-ecommerce-suite/cypress/e2e/checkout.cy.js +17 -0
- package/examples/cypress-ecommerce-suite/cypress/pages/BasePage.js +29 -0
- package/examples/cypress-ecommerce-suite/cypress/pages/CartPage.js +51 -0
- package/examples/cypress-ecommerce-suite/cypress.config.js +13 -0
- package/examples/cypress-ecommerce-suite/package.json +13 -0
- package/examples/katalon-suite/Keywords/pages/BasePage.groovy +19 -0
- package/examples/katalon-suite/Keywords/pages/DashboardPage.groovy +29 -0
- package/examples/katalon-suite/Keywords/pages/LoginPage.groovy +45 -0
- package/examples/katalon-suite/Profiles/default.glbl +12 -0
- package/examples/katalon-suite/README.md +18 -0
- package/examples/katalon-suite/Scripts/Auth/TC_LoginSuccess/Script1234567890.groovy +12 -0
- package/examples/katalon-suite/Scripts/Dashboard/TC_ViewSummary/Script1234567891.groovy +15 -0
- package/examples/katalon-suite/katalon_suite.prj +21 -0
- package/examples/playwright-crm-suite/README.md +40 -0
- package/examples/playwright-crm-suite/package.json +14 -0
- package/examples/playwright-crm-suite/pages/BasePage.ts +37 -0
- package/examples/playwright-crm-suite/pages/CustomerPage.ts +57 -0
- package/examples/playwright-crm-suite/pages/LoginPage.ts +32 -0
- package/examples/playwright-crm-suite/playwright.config.ts +27 -0
- package/examples/playwright-crm-suite/tests/auth.spec.ts +22 -0
- package/examples/playwright-crm-suite/tests/customers.spec.ts +33 -0
- package/examples/plugins/sample-custom-plugin/README.md +14 -0
- package/examples/plugins/sample-custom-plugin/plugin.json +16 -0
- package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/SKILL.md +29 -0
- package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/examples/audit_fixture.json +8 -0
- package/examples/plugins/sample-custom-plugin/tools/custom_security_headers.py +125 -0
- package/examples/practices/README.md +22 -0
- package/examples/practices/requirements/crm/requirements_contracts.md +292 -0
- package/examples/practices/requirements/crm/requirements_customers.md +462 -0
- package/examples/practices/requirements/crm/requirements_login.md +202 -0
- package/examples/practices/requirements/crm/requirements_projects.md +396 -0
- package/examples/practices/requirements/crm/requirements_tasks.md +343 -0
- package/examples/practices/requirements/ecommerce/requirements_category_brand.txt +402 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-1/2026-04-03_04-28-27.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-1/KAN-1_requirement.md +52 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-19.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-57.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-4/KAN-4_requirement.md +119 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-5_overview.md +9 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-08.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-23.png +0 -0
- package/examples/practices/requirements/jira/KAN-5/KAN-6/KAN-6_requirement.md +32 -0
- package/examples/practices/testcases/api/book_management_api_test_cases.md +144 -0
- package/examples/practices/testcases/api/user_management_api_test_cases.md +139 -0
- package/examples/practices/testcases/crm/test_cases_crm_login.md +148 -0
- package/examples/practices/testcases/crm/test_cases_customers.md +156 -0
- package/examples/pytest-api-suite/README.md +45 -0
- package/examples/pytest-api-suite/conftest.py +31 -0
- package/examples/pytest-api-suite/pages/user_api_client.py +36 -0
- package/examples/pytest-api-suite/requirements.txt +2 -0
- package/examples/pytest-api-suite/tests/test_user_api.py +44 -0
- package/examples/selenium-suite/README.md +18 -0
- package/examples/selenium-suite/pages/base_page.py +27 -0
- package/examples/selenium-suite/pages/login_page.py +29 -0
- package/examples/selenium-suite/pages/order_page.py +25 -0
- package/examples/selenium-suite/pytest.ini +6 -0
- package/examples/selenium-suite/requirements.txt +2 -0
- package/examples/selenium-suite/tests/test_login.py +10 -0
- package/examples/selenium-suite/tests/test_order.py +10 -0
- package/package.json +22 -7
- package/scripts/generate_skill_examples.py +244 -0
- package/scripts/install.ps1 +112 -0
- package/scripts/install_global_plugin.ps1 +94 -0
- package/scripts/install_global_plugin.sh +49 -0
- package/scripts/lint_skills.ps1 +57 -0
- package/scripts/package_dist.py +323 -0
- package/scripts/setup.sh +59 -0
- package/scripts/update_hub.ps1 +19 -0
- package/scripts/update_hub.sh +15 -0
- package/skills_manifest.json +209 -6
- package/synapse.config.json +30 -0
- package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +7 -7
- package/templates/PROJECT_STATE_TEMPLATE.md +1 -1
- package/templates/ai_bridges/CLAUDE.md +33 -16
- package/templates/ai_bridges/copilot-instructions.md +14 -21
- package/templates/ai_bridges/cursor_synapse_qa.mdc +17 -20
- package/templates/ai_bridges/windsurfrules +21 -21
- package/templates/ci/github-actions-synapse.yml +71 -4
- package/templates/welcome.html.tmpl +1674 -0
- package/tools/.infer_baseline.json +1102 -0
- package/tools/TOOLS_RUNBOOK.md +92 -130
- package/tools/__init__.py +26 -0
- package/tools/agent_canary.py +501 -501
- package/tools/analyze_project.py +31 -17
- package/tools/api_fuzzer.py +278 -6
- package/tools/author_integrity.py +6 -6
- package/tools/auto_heal.py +1 -1
- package/tools/browser_helpers.js +105 -7
- package/tools/bug_reporter.py +31 -1
- package/tools/bump_version.py +23 -3
- package/tools/cache_resolver.py +248 -14
- package/tools/check_env.py +55 -14
- package/tools/check_version_sync.py +153 -0
- package/tools/ci_healing_hook.py +1 -1
- package/tools/cli.py +263 -13
- package/tools/count_tokens.py +1257 -0
- package/tools/dashboard_generator.py +2638 -0
- package/tools/db_sandbox.py +198 -20
- package/tools/e2e_flow_prober.ps1 +12 -64
- package/tools/e2e_flow_prober.py +99 -0
- package/tools/e2e_flow_prober.sh +4 -0
- package/tools/export_postman_collection.py +29 -7
- package/tools/flaky_detector.py +4 -3
- package/tools/generate_allure_report.ps1 +12 -29
- package/tools/generate_allure_report.py +77 -0
- package/tools/generate_allure_report.sh +4 -0
- package/tools/generate_jmx_plan.py +299 -68
- package/tools/generate_test_reports.ps1 +12 -134
- package/tools/generate_test_reports.py +133 -0
- package/tools/generate_test_reports.sh +4 -0
- package/tools/gherkin_suite.py +758 -0
- package/tools/git_pre_commit_guard.py +12 -6
- package/tools/goldfish_review.py +366 -0
- package/tools/heal_pr_automator.py +1 -1
- package/tools/heuristic_locator_matcher.py +170 -21
- package/tools/infer_linter.py +612 -70
- package/tools/jtl_analyzer.py +1 -1
- package/tools/lint_ai_docs.py +64 -0
- package/tools/matrix_sharder.py +1 -1
- package/tools/mcp_excel_server.ps1 +12 -250
- package/tools/mcp_excel_server.py +249 -0
- package/tools/mcp_excel_server.sh +4 -0
- package/tools/mcp_server.py +368 -144
- package/tools/md_to_xlsx.py +307 -0
- package/tools/micro_mutator.py +300 -69
- package/tools/omni_transpiler.py +2 -2
- package/tools/output_formatter.py +128 -0
- package/tools/pinpoint_failure.py +88 -88
- package/tools/project_state.py +2 -2
- package/tools/repo_map.py +1 -1
- package/tools/safety_firewall.py +197 -33
- package/tools/setup_project.py +294 -30
- package/tools/skillspector.py +8 -8
- package/tools/spec_drift_sentinel.py +439 -0
- package/tools/sync_agent_rules.py +248 -0
- package/tools/telemetry_correlator.py +45 -0
- package/tools/test_impact.py +51 -12
- package/tools/tms_sync_bridge.py +21 -5
- package/tools/universal_ir.py +3 -0
- package/tools/update_sentinel.py +87 -15
- package/tools/verify_all.ps1 +13 -0
- package/tools/verify_all.py +463 -79
- package/tools/visual_diff_canvas.py +1 -0
- package/tools/visual_som_helper.py +1 -1
- package/tools/watch_mode.py +305 -0
- package/tools/welcome_page.py +291 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: failure-autopsy-and-healing
|
|
3
|
-
description: "Triage test failures from JUnit XML/screenshots and heal broken Page Class locators."
|
|
3
|
+
description: "Triage test failures from JUnit XML/screenshots and heal broken Page Class locators. Use when diagnosing failed test runs and producing closed-loop healing plans."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Failure Autopsy & Auto-Healing (Diagnostic & Self-Healing Engine)
|
|
@@ -21,7 +21,7 @@ flowchart LR
|
|
|
21
21
|
|
|
22
22
|
1. **Zero-Token Triage:** Pinpoint failed line and cause instantly (<50 tokens):
|
|
23
23
|
```bash
|
|
24
|
-
python3 tools/pinpoint_failure.py
|
|
24
|
+
python3 ~/.zcode/synapse-hub/tools/pinpoint_failure.py
|
|
25
25
|
# or bash .agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh
|
|
26
26
|
```
|
|
27
27
|
2. **Visual Autopsy:** Inspect the latest error screenshot to immediately detect: disabled buttons, missing required fields, UI overlaps, or obscuring modal backdrops.
|
|
@@ -49,4 +49,18 @@ flowchart LR
|
|
|
49
49
|
|
|
50
50
|
- [**Diagnostic & Healing Matrix (`healing_matrix.md`)**](references/healing_matrix.md): Concrete code prescriptions for disabled buttons, boundary overlaps, `ElementClickInterceptedException`, `StaleElementReferenceException`, and 4 flaky test root causes.
|
|
51
51
|
- [**Fast-Fix Triad & Runtime Helper (`tools/browser_helpers.js`)**](tools/browser_helpers.js): In-browser diagnosis engine via `window.__qa` (`audit`, `heal`, `clickSafe`, `hud`).
|
|
52
|
-
- **Automated Triage Script:** `python3 tools/pinpoint_failure.py` and `scripts/triage_failures.sh`.
|
|
52
|
+
- **Automated Triage Script:** `python3 ~/.zcode/synapse-hub/tools/pinpoint_failure.py` and `scripts/triage_failures.sh`.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 4. Boundary vs `self-healing-locator` (Do Not Confuse)
|
|
57
|
+
|
|
58
|
+
- **This skill** = the general physician: accepts ANY failed test run, performs
|
|
59
|
+
root-cause analysis (JUnit XML, logs, screenshots), queries the memory cache,
|
|
60
|
+
files the bug ticket, and produces a full healing plan (which may involve
|
|
61
|
+
environment, data, timing, or code fixes).
|
|
62
|
+
- **`self-healing-locator`** = the orthopedic specialist: one failure class only
|
|
63
|
+
— broken locators/stale elements. Its matching cascade is *dispatched by*
|
|
64
|
+
this skill's plan when the RCA concludes "locator drift".
|
|
65
|
+
- Rule of thumb: if the failure reason is not yet known, start here; only after
|
|
66
|
+
the RCA says "locator broke" hand the repair to `self-healing-locator`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<testsuites>
|
|
3
|
+
<testsuite name="AuthenticationSuite" tests="1" failures="1">
|
|
4
|
+
<testcase name="testLoginFailure" classname="AuthTest">
|
|
5
|
+
<failure message="Timeout 30000ms exceeded waiting for locator('#submit-btn')" type="ElementNotFoundError"/>
|
|
6
|
+
</testcase>
|
|
7
|
+
</testsuite>
|
|
8
|
+
</testsuites>
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# Enterprise Automation Failure Diagnostic & Healing Matrix
|
|
2
|
-
|
|
3
|
-
Reference documentation for the `failure-autopsy-and-healing` skill.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. Diagnostic & Healing Matrix
|
|
8
|
-
|
|
9
|
-
| Visual / Exception Symptom | Root Cause | Groovy POM Healing Patch |
|
|
10
|
-
| :--- | :--- | :--- |
|
|
11
|
-
| **Save button `[ ✓ ]` disabled / dimmed** | Angular Reactive Form missed change detection or missing required field (`*`). | `WebElement el = findElement(By.cssSelector("input[formcontrolname='code']"))`<br>`jsSetInput(el, uniqueCode)` |
|
|
12
|
-
| **Alert: *"Phạm vi giữa các khu/cụm không hợp lệ"*** | OpenLayers polygon overlaps previously saved boundary data. | `Actions actions = new Actions(driver)`<br>`actions.moveToElement(viewport, -180, -80).click().perform()` |
|
|
13
|
-
| **`ElementClickInterceptedException`** | Modal overlay `.p-component-overlay` fading out but still blocking clicks. | `((JavascriptExecutor) driver).executeScript("arguments[0].click();", element)` |
|
|
14
|
-
| **Red Toast: *"Mã đã tồn tại"*** | Non-unique test data colliding with existing records. | `String code = BasePage.uniqueCode("CCN_")` |
|
|
15
|
-
| **`StaleElementReferenceException`** | Angular DOM re-rendered after API response, detaching element. | `for (int i = 0; i < 3; i++) { try { findElement(by).click(); break; } catch (StaleElementReferenceException e) { sleep(500) } }` |
|
|
16
|
-
| **`TimeoutException` (Waiting for table/button)** | Loading overlay `.p-blockui` or spinner `.p-progress-spinner` blocking UI. | `waitForElementNotVisible(By.cssSelector(".p-blockui, .p-progress-spinner"), 10)` |
|
|
17
|
-
| **PrimeNG Dropdown value not applied** | Clicked `p-dropdown` but overlay panel `.p-dropdown-panel` has not rendered. | `waitForElementVisible(By.cssSelector(".p-dropdown-panel"), 5)`<br>`findElement(By.xpath("//li[contains(., '" + text + "')]")).click()` |
|
|
18
|
-
| **Blank Screenshot** | Browser crashed before capturing UI (OOM or lost WebDriver session). | Inspect `console0.log`, kill zombie drivers (`pkill -f chromedriver`), restart session. |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## 2. Four Flaky Test Root Causes & Cures
|
|
23
|
-
|
|
24
|
-
| Flaky Root Cause | Symptom | Curing Strategy (Root Fix) |
|
|
25
|
-
|---|---|---|
|
|
26
|
-
| **1. Unstable Locator** | Random failures due to CSS refactoring or dynamic hashes | Enforce Master Priority Map: switch to `[formcontrolname]`, `[data-testid]`; forbid positional XPaths. |
|
|
27
|
-
| **2. Timing & Race Condition** | Fails under network latency; clicks before Angular finishes render | Replace all hard sleeps with Smart Wait: `waitForElementVisible`, wait for `.p-blockui` / `.p-progress-spinner` to hide. |
|
|
28
|
-
| **3. Test Data Conflict** | Fails on parallel or repeated runs due to duplicate codes | Enforce `BasePage.uniqueCode(prefix)` with epoch timestamps. |
|
|
29
|
-
| **4. Environment Dependency** | Fails due to expired session or stale browser cache | Use `LoginPage.ensureLoggedIn()` before every script. |
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 3. Fast-Fix Triad (Zero-Token Diagnostic & Targeted Healing Workflow)
|
|
34
|
-
|
|
35
|
-
To maximize fix speed and minimize token consumption without degrading test fidelity, follow this 3-step loop:
|
|
36
|
-
|
|
37
|
-
### Step 1: Zero-Token Pinpoint (CLI Log Extraction)
|
|
38
|
-
Never read entire JUnit XML reports (>50KB). Extract failed test cases, exception reasons, and file line numbers in <50 tokens:
|
|
39
|
-
```bash
|
|
40
|
-
python3 tools/pinpoint_failure.py Reports/<timestamp>/<suite>/JUnit_Report.xml
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Step 2: Instant Form & DOM Audit (Playwright MCP Recipe 15)
|
|
44
|
-
When a test fails because a button is disabled (e.g. Save `[ ✓ ]`), never guess which field is invalid. Execute Recipe 15 via `browser_run_code_unsafe` on the active live page:
|
|
45
|
-
```javascript
|
|
46
|
-
() => {
|
|
47
|
-
const invalids = Array.from(document.querySelectorAll('form .ng-invalid, input.ng-invalid, p-dropdown.ng-invalid'));
|
|
48
|
-
return invalids.map(el => ({
|
|
49
|
-
tag: el.tagName,
|
|
50
|
-
name: el.getAttribute('name') || el.getAttribute('formcontrolname') || el.id,
|
|
51
|
-
classes: el.className
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
This instantly highlights missing required inputs, pattern mismatches, or invalid dropdowns.
|
|
56
|
-
|
|
57
|
-
### Step 3: Targeted Single-TC Re-test (Zero Waste)
|
|
58
|
-
Never rerun an entire Test Suite to verify a 1-line locator or timing fix. Rerun only the targeted test case:
|
|
59
|
-
```bash
|
|
60
|
-
# Via KRE CLI (License mode):
|
|
61
|
-
katalonc -noSplash -runMode=console -projectPath="." -retry=0 -testCasePath="Test Cases/TC-xxx" -browserType="Chrome (headless)"
|
|
62
|
-
|
|
63
|
-
# Or verify live flow in 2 seconds via Playwright MCP script.
|
|
64
|
-
```
|
|
1
|
+
# Enterprise Automation Failure Diagnostic & Healing Matrix
|
|
2
|
+
|
|
3
|
+
Reference documentation for the `failure-autopsy-and-healing` skill.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Diagnostic & Healing Matrix
|
|
8
|
+
|
|
9
|
+
| Visual / Exception Symptom | Root Cause | Groovy POM Healing Patch |
|
|
10
|
+
| :--- | :--- | :--- |
|
|
11
|
+
| **Save button `[ ✓ ]` disabled / dimmed** | Angular Reactive Form missed change detection or missing required field (`*`). | `WebElement el = findElement(By.cssSelector("input[formcontrolname='code']"))`<br>`jsSetInput(el, uniqueCode)` |
|
|
12
|
+
| **Alert: *"Phạm vi giữa các khu/cụm không hợp lệ"*** | OpenLayers polygon overlaps previously saved boundary data. | `Actions actions = new Actions(driver)`<br>`actions.moveToElement(viewport, -180, -80).click().perform()` |
|
|
13
|
+
| **`ElementClickInterceptedException`** | Modal overlay `.p-component-overlay` fading out but still blocking clicks. | `((JavascriptExecutor) driver).executeScript("arguments[0].click();", element)` |
|
|
14
|
+
| **Red Toast: *"Mã đã tồn tại"*** | Non-unique test data colliding with existing records. | `String code = BasePage.uniqueCode("CCN_")` |
|
|
15
|
+
| **`StaleElementReferenceException`** | Angular DOM re-rendered after API response, detaching element. | `for (int i = 0; i < 3; i++) { try { findElement(by).click(); break; } catch (StaleElementReferenceException e) { sleep(500) } }` |
|
|
16
|
+
| **`TimeoutException` (Waiting for table/button)** | Loading overlay `.p-blockui` or spinner `.p-progress-spinner` blocking UI. | `waitForElementNotVisible(By.cssSelector(".p-blockui, .p-progress-spinner"), 10)` |
|
|
17
|
+
| **PrimeNG Dropdown value not applied** | Clicked `p-dropdown` but overlay panel `.p-dropdown-panel` has not rendered. | `waitForElementVisible(By.cssSelector(".p-dropdown-panel"), 5)`<br>`findElement(By.xpath("//li[contains(., '" + text + "')]")).click()` |
|
|
18
|
+
| **Blank Screenshot** | Browser crashed before capturing UI (OOM or lost WebDriver session). | Inspect `console0.log`, kill zombie drivers (`pkill -f chromedriver`), restart session. |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 2. Four Flaky Test Root Causes & Cures
|
|
23
|
+
|
|
24
|
+
| Flaky Root Cause | Symptom | Curing Strategy (Root Fix) |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| **1. Unstable Locator** | Random failures due to CSS refactoring or dynamic hashes | Enforce Master Priority Map: switch to `[formcontrolname]`, `[data-testid]`; forbid positional XPaths. |
|
|
27
|
+
| **2. Timing & Race Condition** | Fails under network latency; clicks before Angular finishes render | Replace all hard sleeps with Smart Wait: `waitForElementVisible`, wait for `.p-blockui` / `.p-progress-spinner` to hide. |
|
|
28
|
+
| **3. Test Data Conflict** | Fails on parallel or repeated runs due to duplicate codes | Enforce `BasePage.uniqueCode(prefix)` with epoch timestamps. |
|
|
29
|
+
| **4. Environment Dependency** | Fails due to expired session or stale browser cache | Use `LoginPage.ensureLoggedIn()` before every script. |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 3. Fast-Fix Triad (Zero-Token Diagnostic & Targeted Healing Workflow)
|
|
34
|
+
|
|
35
|
+
To maximize fix speed and minimize token consumption without degrading test fidelity, follow this 3-step loop:
|
|
36
|
+
|
|
37
|
+
### Step 1: Zero-Token Pinpoint (CLI Log Extraction)
|
|
38
|
+
Never read entire JUnit XML reports (>50KB). Extract failed test cases, exception reasons, and file line numbers in <50 tokens:
|
|
39
|
+
```bash
|
|
40
|
+
python3 tools/pinpoint_failure.py Reports/<timestamp>/<suite>/JUnit_Report.xml
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 2: Instant Form & DOM Audit (Playwright MCP Recipe 15)
|
|
44
|
+
When a test fails because a button is disabled (e.g. Save `[ ✓ ]`), never guess which field is invalid. Execute Recipe 15 via `browser_run_code_unsafe` on the active live page:
|
|
45
|
+
```javascript
|
|
46
|
+
() => {
|
|
47
|
+
const invalids = Array.from(document.querySelectorAll('form .ng-invalid, input.ng-invalid, p-dropdown.ng-invalid'));
|
|
48
|
+
return invalids.map(el => ({
|
|
49
|
+
tag: el.tagName,
|
|
50
|
+
name: el.getAttribute('name') || el.getAttribute('formcontrolname') || el.id,
|
|
51
|
+
classes: el.className
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
This instantly highlights missing required inputs, pattern mismatches, or invalid dropdowns.
|
|
56
|
+
|
|
57
|
+
### Step 3: Targeted Single-TC Re-test (Zero Waste)
|
|
58
|
+
Never rerun an entire Test Suite to verify a 1-line locator or timing fix. Rerun only the targeted test case:
|
|
59
|
+
```bash
|
|
60
|
+
# Via KRE CLI (License mode):
|
|
61
|
+
katalonc -noSplash -runMode=console -projectPath="." -retry=0 -testCasePath="Test Cases/TC-xxx" -browserType="Chrome (headless)"
|
|
62
|
+
|
|
63
|
+
# Or verify live flow in 2 seconds via Playwright MCP script.
|
|
64
|
+
```
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
# QA Investigation & Root-Cause Analysis Protocol
|
|
2
|
-
|
|
3
|
-
*(Inherited from `fugazi/test-automation-skills-agents`)*
|
|
4
|
-
|
|
5
|
-
A file-backed, evidence-first investigation journal protocol for diagnosing failing and flaky automation test cases in enterprise automation projects.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 1. Core Principles
|
|
10
|
-
|
|
11
|
-
1. **Context Window is Volatile RAM; Filesystem is Persistent Disk:**
|
|
12
|
-
- Long triage sessions cause context drift. All goals, hypotheses, and evidence must be logged in markdown.
|
|
13
|
-
2. **Discovered Classification, Not Presumed:**
|
|
14
|
-
- Never assume upfront whether a failure is a Flaky test, an AUT Defect, or a Test Infrastructure issue. The classification is a finding discovered through evidence.
|
|
15
|
-
3. **No Guesswork / No Blind Fixes:**
|
|
16
|
-
- Every fix must address a proven root cause, not a symptom.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 2. Four-Phase Investigation Cycle
|
|
21
|
-
|
|
22
|
-
```mermaid
|
|
23
|
-
flowchart TD
|
|
24
|
-
P1["<b>Phase 1: Reproduction & Triage</b><br/>• Run single-TC isolated re-test<br/>• Classify: Intermittent (Flaky) vs Deterministic (Bug)"]
|
|
25
|
-
P2["<b>Phase 2: Evidence Collection</b><br/>• Extract CLI logs & stack trace<br/>• Inspect Screenshots/FAILED_*.png<br/>• Capture network & timing data"]
|
|
26
|
-
P3["<b>Phase 3: Hypothesis & Root Cause</b><br/>• Form testable hypothesis<br/>• Isolate: Timing vs Stale DOM vs AUT defect"]
|
|
27
|
-
P4["<b>Phase 4: Targeted Fix & Validation</b><br/>• Apply Clean POM Page Class fix<br/>• Validate 3x consecutive runs<br/>• Run verify_all.py DoD check"]
|
|
28
|
-
|
|
29
|
-
P1 --> P2 --> P3 --> P4
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Phase 1: Reproduction & Triage
|
|
33
|
-
- Run the failing test in isolation using the targeted single-TC runner.
|
|
34
|
-
- Determine failure pattern:
|
|
35
|
-
- **Deterministic Bug:** Fails 100% of the time with identical stack trace.
|
|
36
|
-
- **Intermittent Flaky:** Passes sometimes, fails under load/timing variations.
|
|
37
|
-
- **Environment Blocker:** Fails on 401/403 session expiration or network timeout.
|
|
38
|
-
|
|
39
|
-
### Phase 2: Evidence Collection
|
|
40
|
-
- Collect ground-truth artifacts:
|
|
41
|
-
1. CLI log excerpt around the failure point.
|
|
42
|
-
2. Failure screenshot in `Screenshots/FAILED_<TestCaseId>_*.png`.
|
|
43
|
-
3. Form audit state (e.g. disabled Save button, red validation borders).
|
|
44
|
-
4. Redact any sensitive credentials or personal tokens.
|
|
45
|
-
|
|
46
|
-
### Phase 3: Hypothesis Formulation
|
|
47
|
-
- Check the 4 most common failure archetypes:
|
|
48
|
-
- **Archetype A (PrimeNG Toast Collision):** Previous toast covers the button. Cure: `dismissToast()`.
|
|
49
|
-
- **Archetype B (Stale Element / Angular Re-render):** DOM re-created mid-click. Cure: Re-fetch locator with `BasePage.x()`.
|
|
50
|
-
- **Archetype C (Dialog Backdrop Overlay):** `cdk-overlay-backdrop` blocks click. Cure: Wait for backdrop fade-out.
|
|
51
|
-
- **Archetype D (Real AUT Defect):** Backend HTTP 500 or constraint violation. Cure: Log to `KNOWN_ISSUES.md`.
|
|
52
|
-
|
|
53
|
-
### Phase 4: Targeted Fix & Validation
|
|
54
|
-
- Implement fix exclusively inside Page Classes in `Keywords/<namespace>/pages/` or `pages/` (never in `Scripts/`).
|
|
55
|
-
- Validate stability across multiple runs.
|
|
56
|
-
- Run `python3 tools/verify_all.py` to confirm zero regressions.
|
|
1
|
+
# QA Investigation & Root-Cause Analysis Protocol
|
|
2
|
+
|
|
3
|
+
*(Inherited from `fugazi/test-automation-skills-agents`)*
|
|
4
|
+
|
|
5
|
+
A file-backed, evidence-first investigation journal protocol for diagnosing failing and flaky automation test cases in enterprise automation projects.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Core Principles
|
|
10
|
+
|
|
11
|
+
1. **Context Window is Volatile RAM; Filesystem is Persistent Disk:**
|
|
12
|
+
- Long triage sessions cause context drift. All goals, hypotheses, and evidence must be logged in markdown.
|
|
13
|
+
2. **Discovered Classification, Not Presumed:**
|
|
14
|
+
- Never assume upfront whether a failure is a Flaky test, an AUT Defect, or a Test Infrastructure issue. The classification is a finding discovered through evidence.
|
|
15
|
+
3. **No Guesswork / No Blind Fixes:**
|
|
16
|
+
- Every fix must address a proven root cause, not a symptom.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. Four-Phase Investigation Cycle
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
flowchart TD
|
|
24
|
+
P1["<b>Phase 1: Reproduction & Triage</b><br/>• Run single-TC isolated re-test<br/>• Classify: Intermittent (Flaky) vs Deterministic (Bug)"]
|
|
25
|
+
P2["<b>Phase 2: Evidence Collection</b><br/>• Extract CLI logs & stack trace<br/>• Inspect Screenshots/FAILED_*.png<br/>• Capture network & timing data"]
|
|
26
|
+
P3["<b>Phase 3: Hypothesis & Root Cause</b><br/>• Form testable hypothesis<br/>• Isolate: Timing vs Stale DOM vs AUT defect"]
|
|
27
|
+
P4["<b>Phase 4: Targeted Fix & Validation</b><br/>• Apply Clean POM Page Class fix<br/>• Validate 3x consecutive runs<br/>• Run verify_all.py DoD check"]
|
|
28
|
+
|
|
29
|
+
P1 --> P2 --> P3 --> P4
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Phase 1: Reproduction & Triage
|
|
33
|
+
- Run the failing test in isolation using the targeted single-TC runner.
|
|
34
|
+
- Determine failure pattern:
|
|
35
|
+
- **Deterministic Bug:** Fails 100% of the time with identical stack trace.
|
|
36
|
+
- **Intermittent Flaky:** Passes sometimes, fails under load/timing variations.
|
|
37
|
+
- **Environment Blocker:** Fails on 401/403 session expiration or network timeout.
|
|
38
|
+
|
|
39
|
+
### Phase 2: Evidence Collection
|
|
40
|
+
- Collect ground-truth artifacts:
|
|
41
|
+
1. CLI log excerpt around the failure point.
|
|
42
|
+
2. Failure screenshot in `Screenshots/FAILED_<TestCaseId>_*.png`.
|
|
43
|
+
3. Form audit state (e.g. disabled Save button, red validation borders).
|
|
44
|
+
4. Redact any sensitive credentials or personal tokens.
|
|
45
|
+
|
|
46
|
+
### Phase 3: Hypothesis Formulation
|
|
47
|
+
- Check the 4 most common failure archetypes:
|
|
48
|
+
- **Archetype A (PrimeNG Toast Collision):** Previous toast covers the button. Cure: `dismissToast()`.
|
|
49
|
+
- **Archetype B (Stale Element / Angular Re-render):** DOM re-created mid-click. Cure: Re-fetch locator with `BasePage.x()`.
|
|
50
|
+
- **Archetype C (Dialog Backdrop Overlay):** `cdk-overlay-backdrop` blocks click. Cure: Wait for backdrop fade-out.
|
|
51
|
+
- **Archetype D (Real AUT Defect):** Backend HTTP 500 or constraint violation. Cure: Log to `KNOWN_ISSUES.md`.
|
|
52
|
+
|
|
53
|
+
### Phase 4: Targeted Fix & Validation
|
|
54
|
+
- Implement fix exclusively inside Page Classes in `Keywords/<namespace>/pages/` or `pages/` (never in `Scripts/`).
|
|
55
|
+
- Validate stability across multiple runs.
|
|
56
|
+
- Run `python3 tools/verify_all.py` to confirm zero regressions.
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Triage Failures Script for Enterprise Automation
|
|
3
|
-
# Cross-platform: Compatible with macOS, Linux CI, and Windows Git Bash
|
|
4
|
-
|
|
5
|
-
WORKSPACE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
|
|
6
|
-
SCREENSHOT_DIR="$WORKSPACE_DIR/Screenshots"
|
|
7
|
-
REPORTS_DIR="$WORKSPACE_DIR/Reports"
|
|
8
|
-
|
|
9
|
-
echo "=========================================================="
|
|
10
|
-
echo " 🔬 ENTERPRISE FAILURE AUTOPSY & TRIAGE SCANNER (CROSS-PLATFORM)"
|
|
11
|
-
echo " Workspace: $WORKSPACE_DIR"
|
|
12
|
-
echo "=========================================================="
|
|
13
|
-
|
|
14
|
-
# 1. Quét báo cáo JUnit XML gần nhất
|
|
15
|
-
LATEST_JUNIT=$(find "$REPORTS_DIR" -type f -name "JUnit_Report.xml" 2>/dev/null | sort -r | head -n 1)
|
|
16
|
-
|
|
17
|
-
if [ -n "$LATEST_JUNIT" ]; then
|
|
18
|
-
echo "📊 Báo cáo JUnit gần nhất: $(basename "$(dirname "$LATEST_JUNIT")")/JUnit_Report.xml"
|
|
19
|
-
FAILED_JUNIT_TESTS=$(grep -B 1 '<failure' "$LATEST_JUNIT" 2>/dev/null | grep '<testcase' | sed -n 's/.*name="\([^"]*\)".*/\1/p')
|
|
20
|
-
if [ -n "$FAILED_JUNIT_TESTS" ]; then
|
|
21
|
-
echo "🚨 Các Test Cases báo FAILED trong JUnit XML:"
|
|
22
|
-
echo "$FAILED_JUNIT_TESTS" | while read -r tc; do
|
|
23
|
-
echo " ❌ $tc"
|
|
24
|
-
done
|
|
25
|
-
echo "----------------------------------------------------------"
|
|
26
|
-
else
|
|
27
|
-
echo "✅ Không phát hiện ca thất bại nào trong JUnit XML gần nhất."
|
|
28
|
-
echo "----------------------------------------------------------"
|
|
29
|
-
fi
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
# 2. Quét ảnh chụp FAILED_*.png
|
|
33
|
-
if [ ! -d "$SCREENSHOT_DIR" ]; then
|
|
34
|
-
echo "ℹ️ Không tìm thấy thư mục Screenshots. Dự án đang sạch lỗi!"
|
|
35
|
-
exit 0
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
FAILED_COUNT=$(find "$SCREENSHOT_DIR" -maxdepth 1 -name "FAILED_*.png" 2>/dev/null | wc -l | tr -d ' ')
|
|
39
|
-
|
|
40
|
-
if [ "$FAILED_COUNT" -eq "0" ]; then
|
|
41
|
-
echo "✅ Tuyệt vời! Không có ảnh lỗi nào trong $SCREENSHOT_DIR."
|
|
42
|
-
exit 0
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
echo "⚠️ Phát hiện $FAILED_COUNT ảnh lỗi kịch bản gần nhất:"
|
|
46
|
-
echo "----------------------------------------------------------"
|
|
47
|
-
|
|
48
|
-
# Hàm lấy thông tin file đa nền tảng (hỗ trợ Linux GNU stat, macOS BSD stat và fallback ls)
|
|
49
|
-
list_recent_screenshots() {
|
|
50
|
-
if stat --version 2>&1 | grep -q "GNU"; then
|
|
51
|
-
# Linux (GNU stat)
|
|
52
|
-
find "$SCREENSHOT_DIR" -maxdepth 1 -name "FAILED_*.png" -type f -exec stat -c "%Y %y %n" {} + 2>/dev/null | \
|
|
53
|
-
sort -rn | head -n 10 | awk '{print $1, $2, $3, $NF}'
|
|
54
|
-
elif stat -f "%m" . >/dev/null 2>&1; then
|
|
55
|
-
# macOS / BSD stat
|
|
56
|
-
find "$SCREENSHOT_DIR" -maxdepth 1 -name "FAILED_*.png" -type f -exec stat -f "%m %Sm %N" -t "%Y-%m-%d %H:%M:%S" {} + 2>/dev/null | \
|
|
57
|
-
sort -rn | head -n 10
|
|
58
|
-
else
|
|
59
|
-
# Fallback (POSIX ls)
|
|
60
|
-
ls -lt "$SCREENSHOT_DIR"/FAILED_*.png 2>/dev/null | head -n 10 | awk '{print "0", $6, $7, $NF}'
|
|
61
|
-
fi
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
list_recent_screenshots | while read -r epoch date time filepath; do
|
|
65
|
-
filename=$(basename "$filepath")
|
|
66
|
-
|
|
67
|
-
# Ánh xạ Page Class gợi ý dựa trên mã Test Case (Dynamic Pattern Matching)
|
|
68
|
-
suggested_page="BasePage.groovy"
|
|
69
|
-
if [[ "$filename" =~ TC-([0-9]+) ]]; then
|
|
70
|
-
tc_num="${BASH_REMATCH[1]}"
|
|
71
|
-
if [ "$tc_num" -ge 1 ] && [ "$tc_num" -le 7 ]; then
|
|
72
|
-
suggested_page="TargetPlanPage.groovy"
|
|
73
|
-
elif [ "$tc_num" -ge 8 ] && [ "$tc_num" -le 12 ]; then
|
|
74
|
-
suggested_page="LoginPage.groovy"
|
|
75
|
-
elif [ "$tc_num" -ge 13 ] && [ "$tc_num" -le 16 ]; then
|
|
76
|
-
suggested_page="UserAdminPage.groovy"
|
|
77
|
-
elif [ "$tc_num" -ge 17 ] && [ "$tc_num" -le 28 ]; then
|
|
78
|
-
suggested_page="CommonCategoryPage.groovy"
|
|
79
|
-
elif [ "$tc_num" -ge 29 ] && [ "$tc_num" -le 92 ]; then
|
|
80
|
-
suggested_page="IndustryCategoryPage.groovy"
|
|
81
|
-
elif [ "$tc_num" -ge 93 ] && [ "$tc_num" -le 122 ]; then
|
|
82
|
-
suggested_page="PlanningPage.groovy"
|
|
83
|
-
elif [ "$tc_num" -ge 123 ] && [ "$tc_num" -le 247 ]; then
|
|
84
|
-
suggested_page="DataMiningPage.groovy"
|
|
85
|
-
elif [ "$tc_num" -ge 248 ] && [ "$tc_num" -le 249 ]; then
|
|
86
|
-
suggested_page="ReportPage.groovy"
|
|
87
|
-
elif [ "$tc_num" -ge 250 ] && [ "$tc_num" -le 259 ]; then
|
|
88
|
-
suggested_page="TokenMgmtPage.groovy"
|
|
89
|
-
fi
|
|
90
|
-
fi
|
|
91
|
-
|
|
92
|
-
echo "📸 [$date $time] $filename"
|
|
93
|
-
echo " -> Đường dẫn ảnh : $filepath"
|
|
94
|
-
echo " -> Page Class cần vá : Keywords/pages/$suggested_page"
|
|
95
|
-
done
|
|
96
|
-
|
|
97
|
-
echo "----------------------------------------------------------"
|
|
98
|
-
echo "💡 Gợi ý AI: Dùng tool read_file mở ảnh hoặc dùng Playwright Live giữ nguyên browser để xác thực và vá Page Class."
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Triage Failures Script for Enterprise Automation
|
|
3
|
+
# Cross-platform: Compatible with macOS, Linux CI, and Windows Git Bash
|
|
4
|
+
|
|
5
|
+
WORKSPACE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
|
|
6
|
+
SCREENSHOT_DIR="$WORKSPACE_DIR/Screenshots"
|
|
7
|
+
REPORTS_DIR="$WORKSPACE_DIR/Reports"
|
|
8
|
+
|
|
9
|
+
echo "=========================================================="
|
|
10
|
+
echo " 🔬 ENTERPRISE FAILURE AUTOPSY & TRIAGE SCANNER (CROSS-PLATFORM)"
|
|
11
|
+
echo " Workspace: $WORKSPACE_DIR"
|
|
12
|
+
echo "=========================================================="
|
|
13
|
+
|
|
14
|
+
# 1. Quét báo cáo JUnit XML gần nhất
|
|
15
|
+
LATEST_JUNIT=$(find "$REPORTS_DIR" -type f -name "JUnit_Report.xml" 2>/dev/null | sort -r | head -n 1)
|
|
16
|
+
|
|
17
|
+
if [ -n "$LATEST_JUNIT" ]; then
|
|
18
|
+
echo "📊 Báo cáo JUnit gần nhất: $(basename "$(dirname "$LATEST_JUNIT")")/JUnit_Report.xml"
|
|
19
|
+
FAILED_JUNIT_TESTS=$(grep -B 1 '<failure' "$LATEST_JUNIT" 2>/dev/null | grep '<testcase' | sed -n 's/.*name="\([^"]*\)".*/\1/p')
|
|
20
|
+
if [ -n "$FAILED_JUNIT_TESTS" ]; then
|
|
21
|
+
echo "🚨 Các Test Cases báo FAILED trong JUnit XML:"
|
|
22
|
+
echo "$FAILED_JUNIT_TESTS" | while read -r tc; do
|
|
23
|
+
echo " ❌ $tc"
|
|
24
|
+
done
|
|
25
|
+
echo "----------------------------------------------------------"
|
|
26
|
+
else
|
|
27
|
+
echo "✅ Không phát hiện ca thất bại nào trong JUnit XML gần nhất."
|
|
28
|
+
echo "----------------------------------------------------------"
|
|
29
|
+
fi
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# 2. Quét ảnh chụp FAILED_*.png
|
|
33
|
+
if [ ! -d "$SCREENSHOT_DIR" ]; then
|
|
34
|
+
echo "ℹ️ Không tìm thấy thư mục Screenshots. Dự án đang sạch lỗi!"
|
|
35
|
+
exit 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
FAILED_COUNT=$(find "$SCREENSHOT_DIR" -maxdepth 1 -name "FAILED_*.png" 2>/dev/null | wc -l | tr -d ' ')
|
|
39
|
+
|
|
40
|
+
if [ "$FAILED_COUNT" -eq "0" ]; then
|
|
41
|
+
echo "✅ Tuyệt vời! Không có ảnh lỗi nào trong $SCREENSHOT_DIR."
|
|
42
|
+
exit 0
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo "⚠️ Phát hiện $FAILED_COUNT ảnh lỗi kịch bản gần nhất:"
|
|
46
|
+
echo "----------------------------------------------------------"
|
|
47
|
+
|
|
48
|
+
# Hàm lấy thông tin file đa nền tảng (hỗ trợ Linux GNU stat, macOS BSD stat và fallback ls)
|
|
49
|
+
list_recent_screenshots() {
|
|
50
|
+
if stat --version 2>&1 | grep -q "GNU"; then
|
|
51
|
+
# Linux (GNU stat)
|
|
52
|
+
find "$SCREENSHOT_DIR" -maxdepth 1 -name "FAILED_*.png" -type f -exec stat -c "%Y %y %n" {} + 2>/dev/null | \
|
|
53
|
+
sort -rn | head -n 10 | awk '{print $1, $2, $3, $NF}'
|
|
54
|
+
elif stat -f "%m" . >/dev/null 2>&1; then
|
|
55
|
+
# macOS / BSD stat
|
|
56
|
+
find "$SCREENSHOT_DIR" -maxdepth 1 -name "FAILED_*.png" -type f -exec stat -f "%m %Sm %N" -t "%Y-%m-%d %H:%M:%S" {} + 2>/dev/null | \
|
|
57
|
+
sort -rn | head -n 10
|
|
58
|
+
else
|
|
59
|
+
# Fallback (POSIX ls)
|
|
60
|
+
ls -lt "$SCREENSHOT_DIR"/FAILED_*.png 2>/dev/null | head -n 10 | awk '{print "0", $6, $7, $NF}'
|
|
61
|
+
fi
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
list_recent_screenshots | while read -r epoch date time filepath; do
|
|
65
|
+
filename=$(basename "$filepath")
|
|
66
|
+
|
|
67
|
+
# Ánh xạ Page Class gợi ý dựa trên mã Test Case (Dynamic Pattern Matching)
|
|
68
|
+
suggested_page="BasePage.groovy"
|
|
69
|
+
if [[ "$filename" =~ TC-([0-9]+) ]]; then
|
|
70
|
+
tc_num="${BASH_REMATCH[1]}"
|
|
71
|
+
if [ "$tc_num" -ge 1 ] && [ "$tc_num" -le 7 ]; then
|
|
72
|
+
suggested_page="TargetPlanPage.groovy"
|
|
73
|
+
elif [ "$tc_num" -ge 8 ] && [ "$tc_num" -le 12 ]; then
|
|
74
|
+
suggested_page="LoginPage.groovy"
|
|
75
|
+
elif [ "$tc_num" -ge 13 ] && [ "$tc_num" -le 16 ]; then
|
|
76
|
+
suggested_page="UserAdminPage.groovy"
|
|
77
|
+
elif [ "$tc_num" -ge 17 ] && [ "$tc_num" -le 28 ]; then
|
|
78
|
+
suggested_page="CommonCategoryPage.groovy"
|
|
79
|
+
elif [ "$tc_num" -ge 29 ] && [ "$tc_num" -le 92 ]; then
|
|
80
|
+
suggested_page="IndustryCategoryPage.groovy"
|
|
81
|
+
elif [ "$tc_num" -ge 93 ] && [ "$tc_num" -le 122 ]; then
|
|
82
|
+
suggested_page="PlanningPage.groovy"
|
|
83
|
+
elif [ "$tc_num" -ge 123 ] && [ "$tc_num" -le 247 ]; then
|
|
84
|
+
suggested_page="DataMiningPage.groovy"
|
|
85
|
+
elif [ "$tc_num" -ge 248 ] && [ "$tc_num" -le 249 ]; then
|
|
86
|
+
suggested_page="ReportPage.groovy"
|
|
87
|
+
elif [ "$tc_num" -ge 250 ] && [ "$tc_num" -le 259 ]; then
|
|
88
|
+
suggested_page="TokenMgmtPage.groovy"
|
|
89
|
+
fi
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
echo "📸 [$date $time] $filename"
|
|
93
|
+
echo " -> Đường dẫn ảnh : $filepath"
|
|
94
|
+
echo " -> Page Class cần vá : Keywords/pages/$suggested_page"
|
|
95
|
+
done
|
|
96
|
+
|
|
97
|
+
echo "----------------------------------------------------------"
|
|
98
|
+
echo "💡 Gợi ý AI: Dùng tool read_file mở ảnh hoặc dùng Playwright Live giữ nguyên browser để xác thực và vá Page Class."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: file-and-report-validator
|
|
3
|
-
description: "Validate downloaded and uploaded files (Excel, CSV, PDF) schemas and tabular integrity."
|
|
3
|
+
description: "Validate downloaded and uploaded files (Excel, CSV, PDF) schemas and tabular integrity. Use when validating exported files or reports against a schema."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# File & Report Validator Skill
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flaky-test-sentinel-and-quarantine
|
|
3
|
-
description: "Detect non-deterministic flaky tests, calculate flakiness scores, and manage quarantine."
|
|
3
|
+
description: "Detect non-deterministic flaky tests, calculate flakiness scores, and manage quarantine. Use when detecting flaky tests and managing quarantine lifecycles."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Flaky Test Sentinel & Quarantine Protocol
|
|
@@ -73,10 +73,10 @@ This repository provides an automated flakiness analyzer in `tools/flaky_detecto
|
|
|
73
73
|
### Running 5-Iteration Flakiness Benchmark
|
|
74
74
|
```bash
|
|
75
75
|
# Run a specific test script 5 consecutive times to benchmark stability
|
|
76
|
-
|
|
76
|
+
synapse flaky --repeat 5 --cmd "npm test -- tests/e2e/TC-104.spec.ts"
|
|
77
77
|
|
|
78
78
|
# Or parse existing test execution history
|
|
79
|
-
|
|
79
|
+
synapse flaky --reports "reports/**/junit*.xml"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Output Report (`reports/quarantine_board.json`):
|