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.
BetaResume from a previously saved checkpoint.
Session ID of the checkpoint to retrieve.
The checkpoint if found, or undefined.
Beta — checkpoint serialization format may change in minor releases.
Returns the in-memory checkpoint. For cross-process resume, first load from disk and call saveCheckpoint before calling this method.
BetaSave an execution checkpoint for later resumability.
Checkpoint state to save (see AgenticCheckpoint for JSON schema).
Beta — checkpoint serialization format may change in minor releases.
Stores the checkpoint in an in-memory Map keyed by checkpoint.sessionId.
Retrieve via resumeFromCheckpoint.
For cross-process persistence, serialize with JSON.stringify(checkpoint)
before saving to disk, then restore with
handler.saveCheckpoint(JSON.parse(stored) as AgenticCheckpoint).
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
pramanAI.agentic
Sap Module
All
Example