CIA Compliance Manager API Documentation - v1.1.6
    Preparing search index...

    Function createWidgetTestId

    • Widget-scoped test ID generator factory Creates a factory object with methods to generate consistent test IDs for all elements within a widget.

      Parameters

      • widgetName: string

        Name of the widget (will be normalized to kebab-case)

      Returns WidgetTestIds

      Object with methods to generate scoped test IDs

      const COST_IDS = createWidgetTestId('cost-estimation');
      COST_IDS.root // 'widget-cost-estimation'
      COST_IDS.section('capex') // 'widget-cost-estimation-section-capex'
      COST_IDS.button('submit') // 'widget-cost-estimation-button-submit'
      COST_IDS.value('total') // 'widget-cost-estimation-value-total'
      COST_IDS.label('amount') // 'widget-cost-estimation-label-amount'
      COST_IDS.header() // 'widget-cost-estimation-header'
      COST_IDS.header('main') // 'widget-cost-estimation-header-main'