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
storageStateis configured inplaywright.config.ts- Environment variables (
SAP_BASE_URL,SAP_USERNAME,SAP_PASSWORD) are set
Available Examples
| Example | What It Demonstrates |
|---|---|
| Auth Setup | OnPrem, BTP SAML, and Office 365 authentication strategies |
| Basic Test | Control discovery by type and property, ui5.press() |
| Dialog Handling | Open, interact, confirm, and dismiss SAP UI5 dialogs |
| Table Operations | SmartTable rows, OData binding, getContextByIndex() |
| Hybrid Login | Playwright native for login + Praman UI5 for app testing |
| Gold Standard BOM E2E | Full end-to-end BOM flow with value helps, dropdowns, and form submission |
| BTP Multi-Tenant Auth | BTP Work Zone multi-tenant auth, tenant switching, session isolation |
| OData CRUD Operations | OData V4 read, create, update, delete with CSRF tokens and model state |
| Fiori Elements | List Report filter/search, Object Page edit/save, variant management |
| Intent API | Business-oriented intents: fillField, clickButton, domain functions |
| Vocabulary Discovery | Fuzzy 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:
- Single import:
import { test, expect } from 'playwright-praman' - Praman fixtures for all UI5 elements -- never
page.click('#__...') test.step()for structured reportingsearchOpenDialogs: truefor controls inside dialogsui5.fill()(orsetValue()+fireChange()+waitForUI5()) for inputs