Constructs an AgenticHandler.
LLM provider service for sending prompts.
Function to build page context (same as buildPageContext).
Builds a complete AI PageContext from the current Playwright page state.
Playwright Page instance (or any structural equivalent).
Readonly Praman configuration (used for timeout).
AiResponse<PageContext> — matches the shape returned by
discoverPage(), potentially enriched with ui5Version.
Combines bulk control discovery with UI5 version detection. The UI5 version
is read via a separate page.evaluate() call and merged into the returned
PageContext only when it is available. If the version call fails (e.g. the
page is not a UI5 application), the context is still returned successfully
without ui5Version.
Uses config.controlDiscoveryTimeout as the discovery timeout.
Registry of available Praman capabilities.
Optional registry of reusable test recipes (defaults to a new RecipeRegistry).
Generate a test for a natural language scenario.
Natural language description of the test scenario.
Playwright page (or structural equivalent).
AiResponse<AiGeneratedTest> with steps and generated TypeScript code.
Returns AiResponse<AiGeneratedTest> — both natural language steps AND runnable TypeScript code.
Each step is executed separately via interpretStep(step: string): Promise<AiResponse<void>>
which maps step text to Praman fixture calls using the CapabilityRegistry.
This two-phase design (generate → execute) enables checkpoint/resume (AgenticCheckpoint): if step 3 fails, re-execute from step 3 without re-generating the full step list.
Execute a single natural language step by mapping it to Praman fixture calls.
Natural language step description.
Playwright page (or structural equivalent).
AiResponse<void> indicating success or failure.
Resume from a previously saved checkpoint.
Session ID of the checkpoint to retrieve.
The checkpoint if found, or undefined.
Serialize current execution checkpoint for resumability.
Checkpoint state to save.
Suggest next actions given the current page state.
Current page context snapshot.
AiResponse<string[]> containing action suggestions.
Autonomous test operation handler with checkpoint-based resumability.
Remarks
Orchestrates LLM calls, capability lookups, and checkpoint management for AI-driven test generation. All methods return
AiResponse<T>envelopes — never throw on LLM errors.Intent
Execute autonomous SAP UI5 test operations
Capability
ai-agentic-handler
Sap Module
All
Example