Skip to main content

Fixture Reference

Praman provides 12 fixture modules merged into a single test object via Playwright's mergeTests().

Import​

import { test, expect } from 'playwright-praman';

Fixture Summary​

FixtureScopeTypeDescription
ui5testCoreControl discovery, interaction, .table, .dialog, .date, .odata sub-namespaces
ui5NavigationtestNavigation9 FLP navigation methods
btpWorkZonetestNavigationDual-frame BTP WorkZone manager
sapAuthtestAuthenticationSAP authentication (6 strategies)
fetestFiori Elements.listReport, .objectPage, .table, .list helpers
pramanAItestAIPage discovery, agentic handler, LLM, vocabulary
intenttestBusiness.procurement, .sales, .finance, .manufacturing, .masterData
ui5ShelltestFLPShell header (home, user menu)
ui5FootertestFLPPage footer bar (Save, Edit, Delete, etc.)
flpLockstestFLPSM12 lock management with auto-cleanup
flpSettingstestFLPUser settings reader (language, date format)
testDatatestDataTemplate-based data generation with auto-cleanup
pramanConfigworkerInfrastructureFrozen config (loaded once per worker)
pramanLoggertestInfrastructureTest-scoped pino logger
rootLoggerworkerInfrastructureWorker-scoped root logger
tracerworkerInfrastructureOpenTelemetry tracer (NoOp when disabled)

Auto-Fixtures​

These fixtures fire automatically without being requested in the test signature:

Auto-FixtureScopePurpose
playwrightCompatworkerPlaywright version compatibility checks
selectorRegistrationworkerRegisters ui5= custom selector engine
matcherRegistrationworkerRegisters 10 custom UI5 matchers
requestInterceptortestBlocks WalkMe, analytics, overlay scripts
ui5StabilitytestAuto-waits for UI5 stability after navigation

Core Fixture: ui5​

The main fixture for control discovery and interaction.

Control Discovery​

test('discover controls', async ({ ui5 }) => {
// Single control
const btn = await ui5.control({ id: 'saveBtn' });

// Multiple controls
const buttons = await ui5.controls({ controlType: 'sap.m.Button' });

// Interaction shortcuts
await ui5.click({ id: 'submitBtn' });
await ui5.fill({ id: 'nameInput' }, 'John Doe');
await ui5.select({ id: 'countrySelect' }, 'US');
await ui5.check({ id: 'agreeCheckbox' });
await ui5.clear({ id: 'searchField' });
});

Sub-Namespaces​

test('sub-namespaces', async ({ ui5 }) => {
// Table operations
const rows = await ui5.table.getRows('poTable');
const count = await ui5.table.getRowCount('poTable');

// Dialog management
await ui5.dialog.waitFor();
await ui5.dialog.confirm();

// Date/time operations
await ui5.date.setDatePicker('startDate', new Date('2026-01-15'));

// OData model access
const data = await ui5.odata.getModelData('/PurchaseOrders');
});
test('navigation', async ({ ui5Navigation }) => {
await ui5Navigation.navigateToApp('PurchaseOrder-manage');
await ui5Navigation.navigateToTile('Create Purchase Order');
await ui5Navigation.navigateToIntent('PurchaseOrder', 'create', { plant: '1000' });
await ui5Navigation.navigateToHome();
await ui5Navigation.navigateBack();

const hash = await ui5Navigation.getCurrentHash();
});

Auth Fixture: sapAuth​

test('auth control', async ({ sapAuth, page }) => {
await sapAuth.login(page, { url, username, password, strategy: 'basic' });
expect(sapAuth.isAuthenticated()).toBe(true);
// Auto-logout on teardown
});

Fiori Elements Fixture: fe​

test('FE patterns', async ({ fe }) => {
await fe.listReport.setFilter('Status', 'Active');
await fe.listReport.search();
await fe.listReport.navigateToItem(0);

const title = await fe.objectPage.getHeaderTitle();
await fe.objectPage.clickEdit();
await fe.objectPage.clickSave();
});

AI Fixture: pramanAI​

test('AI discovery', async ({ pramanAI }) => {
const context = await pramanAI.discoverPage({ interactiveOnly: true });
const result = await pramanAI.agentic.generateTest(
'Create a purchase order for vendor 100001',
page,
);
});

Intent Fixture: intent​

test('business intents', async ({ intent }) => {
await intent.procurement.createPurchaseOrder({
vendor: '100001',
material: 'MAT-001',
quantity: 10,
plant: '1000',
});

await intent.finance.postVendorInvoice({
vendor: '100001',
amount: 5000,
currency: 'EUR',
});
});
test('shell and footer', async ({ ui5Shell, ui5Footer }) => {
await ui5Shell.expectShellHeader();
await ui5Footer.clickEdit();
// ... edit form fields ...
await ui5Footer.clickSave();
await ui5Shell.clickHome();
});

Lock Management: flpLocks​

test('lock management', async ({ flpLocks }) => {
const count = await flpLocks.getNumberOfLockEntries('TESTUSER');
// Auto-cleanup on teardown
await flpLocks.deleteAllLockEntries('TESTUSER');
});

Test Data: testData​

test('test data', async ({ testData }) => {
const po = testData.generate({
documentNumber: '{{uuid}}',
createdAt: '{{timestamp}}',
vendor: '100001',
});
await testData.save('po-input.json', po);
// Auto-cleanup on teardown
});

Standalone Usage​

Individual fixture modules can be imported for lighter setups:

import { coreTest } from 'playwright-praman';
import { authTest } from 'playwright-praman';
import { mergeTests } from '@playwright/test';

// Compose only what you need
const test = mergeTests(coreTest, authTest);