Skip to main content
Version: 1.x

Examples

Complete, runnable Praman test examples demonstrating real SAP UI5 test patterns.

Each example is a self-contained Playwright spec file that you can copy into your project and adapt.

Prerequisites

All examples assume:

  • Praman is installed (npm install -D playwright-praman @playwright/test)
  • Authentication is handled via a setup project
  • storageState is configured in playwright.config.ts
  • Environment variables (SAP_BASE_URL, SAP_USERNAME, SAP_PASSWORD) are set

Available Examples

ExampleWhat It Demonstrates
Auth SetupOnPrem, BTP SAML, and Office 365 authentication strategies
Basic TestControl discovery by type and property, ui5.press()
Dialog HandlingOpen, interact, confirm, and dismiss SAP UI5 dialogs
Table OperationsSmartTable rows, OData binding, getContextByIndex()
Hybrid LoginPlaywright native for login + Praman UI5 for app testing
Gold Standard BOM E2EFull end-to-end BOM flow with value helps, dropdowns, and form submission
BTP Multi-Tenant AuthBTP Work Zone multi-tenant auth, tenant switching, session isolation
OData CRUD OperationsOData V4 read, create, update, delete with CSRF tokens and model state
Fiori ElementsList Report filter/search, Object Page edit/save, variant management
Intent APIBusiness-oriented intents: fillField, clickButton, domain functions
Vocabulary DiscoveryFuzzy term matching, domain loading, selector resolution, autocomplete

Running Examples

# Copy an example into your test directory
cp node_modules/playwright-praman/examples/basic-test.spec.ts tests/

# Run it
npx playwright test tests/basic-test.spec.ts --headed

Key Patterns

Every example follows Praman's mandatory patterns:

  1. Single import: import { test, expect } from 'playwright-praman'
  2. Praman fixtures for all UI5 elements -- never page.click('#__...')
  3. test.step() for structured reporting
  4. searchOpenDialogs: true for controls inside dialogs
  5. ui5.fill() (or setValue() + fireChange() + waitForUI5()) for inputs