Repository navigation
feat: feature added failure intelligence - #177
PUSHPAK-JAISWAL wants to merge 3 commits into
Conversation
|
@shossain786 i know this is a large change feel free to send it back if required please take your time in reviving this. If Any changes please let me know. Also i have tested it on my side and works ok. |
|
@PUSHPAK-JAISWAL Thanks for picking up #138. Before we merge, could you make these changes?
Everything else looks good, and CI is green. Please push the changes and I'll re-check. |
|
@PUSHPAK-JAISWAL I will start on the changes in some time. |
…my, and cause visibility (seleniumboot#138) - Prioritize exception class chain over message text so missing elements with capabilities dumps are classified as LOCATOR_NOT_FOUND rather than NAVIGATION_ERROR - Map bare TIMEOUT to UNKNOWN across code, documentation, and tests - Flatten FailureClassifier control flow for readability and maintainability - Retain and surface underlying failure cause for flaky tests (e.g. Flaky (Locator not found)) - Clarify newly failing assertion remediation to account for updated requirements or expectations - Remove completed line for open tracking issue seleniumboot#138 from ROADMAP.md
All 752 tests are passing green. |
What & why
Bridges the gap from "a test failed" to "I know why and what to do", delivering zero-configuration, 100% local, deterministic Failure Intelligence that works out of the box on the first run with no AI or API key required.
Background & Problem
Prior to this PR:
FailureCategory:LOCATOR_NOT_FOUND,TIMEOUT,STALE_ELEMENT, etc.) without high-level triage categorization (Product bug,Test bug,Environment,Flaky).ai.failureAnalysis: true), prompts contained freeform stack traces and unstructured instructions without baseline deterministic classifications, yielding unstructured free text.PASSED_ON_RETRY,INTERMITTENT) was tracked in metrics history but not factored into high-level failure triage.Changes Made
High-Level Failure Classification (
FailureType):FailureTypeenum:PRODUCT_BUG,TEST_BUG,ENVIRONMENT,FLAKY, andUNKNOWN.FailureCategorywith deterministic mapping viadefaultType()and initial remediation viadefaultAction():ASSERTION_MISMATCHPRODUCT_BUGLOCATOR_NOT_FOUND,ELEMENT_NOT_INTERACTABLE,STALE_ELEMENTTEST_BUGNAVIGATION_ERROR,BROWSER_CRASHENVIRONMENTTIMEOUT,UNKNOWNUNKNOWNFailureClassifier.classify(TestTiming, TestStatus):PASSED_ON_RETRYorINTERMITTENTare promoted toFLAKY.NEWLY_FAILINGmaintain their underlying failure type with an explicit regression note.Context-Aware Prescriptive Guidance ("Suggested Action"):
FailureClassifiersynthesizes concrete next steps without AI:LOCATOR_NOT_FOUND/ELEMENT_NOT_INTERACTABLE: extracts the failing selector and advises verifying DOM state and auto-waiting conditions.5xxresponses: detects backend service failures and shifts triage from locator fixes to backend endpoint health.NAVIGATION_ERROR/BROWSER_CRASH: advises checking network reachability, DNS, or WebDriver/browser binary compatibility.HTML Report & Export Integration:
failure-type-badgebadges and prominentfailure-actioncallouts in failure detail rows and same-cause group panels.failureTypeandsuggestedActionunder each test entry alongsidefailureCategoryandfailureEvidence.[FailureType]andSuggested Action:for direct triage in CI build logs.Structured AI Analyzer Prompt:
AiFailureAnalyzerto pass the local rule-basedFailureTypeand suggested action into Claude/OpenAI/Gemini prompts as a baseline, prompting for structured output:Classification: <PRODUCT_BUG | TEST_BUG | ENVIRONMENT | FLAKY>Root Cause: <1-2 sentences>Suggested Fix: <concrete next step>Cucumber Lifecycle Guard:
CucumberHooks.checkCucumberQuarantinewithSeleniumBootContext.isInitialized()so unbootstrapped unit tests inCucumberQuarantineTestdon't silently swallow quarantine exceptions.Documentation & Changelog:
docs-site/docs/guides/failure-intelligence.mdcovering the four pillars, taxonomy, remediation, root-cause grouping, and opt-in AI enrichment.docs-site/docs/reporting/html-report.mdandROADMAP.md.### UnreleasedinCHANGELOG.mdanddocs-site/docs/changelog.md.Closes #138
Type of change
CucumberHooks)Checklist
mvn test/mvn clean verify— 748 tests run, 0 failures, 0 skipped)FailureClassifierTest,FailureDetailTest,FailureDetailReportTest,FailureDetailExportTest,AiFailureAnalyzerPromptTest)@SeleniumBootApipublic APIs (all previousFailureClassifier.classify/Resultconstructors preserved via backward-compatible overloads)docs-site/docs/guides/failure-intelligence.md,docs-site/docs/reporting/html-report.md,ROADMAP.md,CHANGELOG.md)Notes for reviewers
FailureClassifier.Resultrecords and previous single-argument/two-argumentclassify(...)signatures remain fully functional, supplying sensible defaults fortypeandsuggestedAction.FailureClassifierTest, calls toFailureClassifier.classify(null, null)were disambiguated toclassify((String) null, (String) null)to avoid compiler ambiguity with the new(TestTiming, TestStatus)overload.