playwright-utam
v0.1.1
Published
Run UTAM page objects on Playwright — Salesforce's UI Test Automation Model on Playwright's runner
Maintainers
Readme
playwright-utam
Run UTAM page objects on Playwright.
This package implements @utam/core's Driver and Element contracts over Playwright's
Page/ElementHandle APIs. Compiled UTAM page objects depend only on those contracts, so
the official salesforce-pageobjects
library and page objects compiled from your own .utam.json files work unchanged.
Usage
import { test, expect } from 'playwright-utam';
import Accordion from 'salesforce-pageobjects/lightning/pageObjects/accordion';
test('accordion', async ({ page, utam }) => {
await page.goto(url);
const accordion = await utam.load(Accordion);
const section = await accordion.getAccordionSectionByTitle('Details');
await section.toggle();
expect(await section.isActive()).toBe(true);
});Or without the fixture:
import { createUtamLoader } from 'playwright-utam';
const utam = createUtamLoader(page, { driverConfig: { explicitTimeout: 10_000 } });
const accordion = await utam.load(Accordion);Notes
- Shadow DOM: element finds are light-DOM scoped on purpose; UTAM page objects declare shadow boundaries explicitly and the adapter honors them.
- Timeouts:
explicitTimeout(waits),implicitTimeout(element finds), andpollingIntervalmirror UTAM's WebdriverIO service defaults. - Web only: mobile (Appium) contexts are not supported.
- The
e2e/directory contains the adapter's own test suite, including a full.utam.json → utam compiler → Playwrightpipeline example and coverage for every documented UTAM pattern: shadow boundaries, filters, compose, frames, slots/containers, draggable actions, stale-element recovery, andbeforeLoadinterception.
