Praman — AI-First SAP UI5 Test Automation Platform - v1.0.1
    Preparing search index...

    Function buildPageContext

    • Builds a complete AI PageContext from the current Playwright page state.

      Parameters

      • page: DiscoveryPage

        Playwright Page instance (or any structural equivalent).

      • config: Readonly<PramanConfig>

        Readonly Praman configuration (used for timeout).

      Returns Promise<AiResponse<PageContext>>

      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.

      Build AI context from current page UI5 state

      ai-context-building

      All

      import { buildPageContext } from '#ai/context-builder.js';

      const response = await buildPageContext(page, config);
      if (response.status === 'success') {
      logger.info('UI5 version:', response.data.ui5Version ?? 'unknown');
      logger.info('Controls found:', response.data.controls.length);
      }