Skip to main content
Version: 1.x

Variable: SAP_LOCKS

const SAP_LOCKS: object

Conventional lock names for state SAP tests actually share.

Type Declaration​

flpSettings​

readonly flpSettings: "sap:flp-settings"

FLP user settings — language, timezone, date/number format.

testData​

readonly testData: "sap:test-data"

The shared test-data directory, whose cleanup is recursive.

testUser​

readonly testUser: "sap:test-user"

A single named SAP test user shared across a suite.

Remarks​

Each entry corresponds to a contention source verified in the code, not a guess:

  • flpSettings — FLP user settings (language, timezone, number format). FLPSettingsHandler is read-only, so it is the victim here rather than the cause: a test that changes the language through the FLP UI corrupts a concurrent reader. Lock the test that mutates.
  • testUser — a single named SAP user shared by a suite. Logging in, personalizing, or holding a transaction affects every other test using it.
  • testData — TestDataHandler.cleanup() calls rm(baseDir, { recursive: true, force: true }). Without a lock, one worker's teardown deletes another worker's fixtures mid-test.

For a specific business object use sapObjectLock instead, so two tests editing different purchase orders still run in parallel.

Example​

import { SAP_LOCKS } from 'playwright-praman';

test('cleans up fixtures', { lock: SAP_LOCKS.testData }, async () => { ... });