Skip to main content
Version: 1.x

Fixture Reference

Praman provides 15 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
ui5NavigationtestNavigation11 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, .quality, .warehouse, .assetManagement, .hr
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
nativeDialogstestDiagnosticsRecords native alert/confirm/prompt/beforeunload dialogs; can answer them on request (Playwright 1.63+)
webStoragetestBrowser StateTyped localStorage / sessionStorage helpers — seed, getItem, items, size (Playwright 1.61+)
pramanConfigworkerInfrastructureFrozen config (loaded once per worker)
pramanLoggertestInfrastructureTest-scoped pino logger
rootLoggerworkerInfrastructureWorker-scoped root logger
tracerworkerInfrastructureOpenTelemetry tracer (NoOp when disabled, real when openTelemetry: true)
meterworkerInfrastructureOpenTelemetry meter for metrics (NoOp when disabled, real when metrics: true)
browserBindtestCLI IntegrationPRAMAN_BIND=1 exposes browser to CLI agents via browser.bind() (Playwright 1.59+)
odatatestDataStandalone OData fixture — getModelData, getEntityCount, fetchCSRFToken, etc. (same API as ui5.odata)
visualRegressiontestTestingScreenshot comparison with FLP chrome masking — compareScreenshot(), maskFLPChrome()
screencasttestCLI IntegrationChapter markers, action overlays, control highlighting, frame streaming via page.screencast (Playwright 1.59+)

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(
{ semanticObject: 'PurchaseOrder', action: '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(await sapAuth.isAuthenticated(page)).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();
});

CLI Integration Fixtures​

Browser Bind: browserBind​

Opt-in via PRAMAN_BIND=1. Exposes the test browser to Playwright CLI agents.

// PRAMAN_BIND=1 npx playwright test
test('agent-assisted test', async ({ browserBind }) => {
if (browserBind.bound) {
console.info('Agent can connect at:', browserBind.endpointUrl);
// CLI agent inspects live UI while test pauses...
}
});

See Browser Bind & Screencast for full details.

Screencast: screencast​

Chapter annotations and frame streaming for Playwright 1.59+ screencasts.

test('recorded test', async ({ screencast, ui5 }) => {
await screencast.showChapter('Setup');
await ui5.click({ id: 'editBtn' });

await screencast.showChapter('Fill Form');
await ui5.fill({ id: 'nameInput' }, 'ACME Corp');

await screencast.showActions({ enabled: true });
});

See Browser Bind & Screencast for full details.

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
});

Native Dialogs: nativeDialogs​

Records the browser's own dialogs — alert, confirm, prompt, beforeunload. Not sap.m.Dialog: for UI5 dialogs use ui5.dialog. The two share a word and nothing else.

Why this exists: Praman already offers ui5.odata.hasPendingChanges() to detect unsaved changes before navigating, precisely to avoid the browser's data-loss warning. That warning is a native beforeunload dialog, and until now Playwright auto-dismissed it where no test could see it.

Detect-only by default​

import { nativeDialogTest } from 'playwright-praman';

nativeDialogTest('navigating away raises no surprise warning', async ({ page, nativeDialogs }) => {
await page.goto('/app#/edit');
await page.goto('/app#/list');

expect(nativeDialogs.records).toEqual([]); // nothing was auto-dismissed
});

Installing the fixture changes nothing: it attaches only dialogclosed, so Playwright keeps auto-dismissing exactly as before. Records are attached to the test as native-dialogs JSON whenever a dialog appeared.

Answering dialogs — opt in deliberately​

nativeDialogTest('discards unsaved changes on exit', async ({ page, nativeDialogs }) => {
nativeDialogs.register({ name: 'discard', types: ['beforeunload'], action: 'accept' });

await page.goto('/app#/edit');
await page.goto('/app#/list');
});

:::warning Registering a rule makes Praman responsible for every dialog

Playwright auto-dismisses native dialogs only while no dialog listener exists. Calling register() attaches one, and from then on any dialog left unanswered freezes the page — every later action times out with no useful error.

Praman guarantees this cannot happen: a dialog whose type no rule covers, or whose rule has hit its times cap, is dismissed and logged at warn rather than ignored. The warn is the signal that your policy is incomplete.

:::

Version support​

CapabilityRequires
Recording dialogs (records, the attachment)Playwright 1.63+ (dialogclosed)
Answering dialogs (register)the 1.57 floor — page.on('dialog') is long-standing

Below 1.63 recording degrades to silence and logs at debug, rather than throwing: there is no floor equivalent for watching a dialog without taking responsibility for it, and observation is additive, so a test that only wants diagnostics still runs.

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);