salesforce-utam
v0.1.1
Published
Salesforce testing for Playwright: passwordless sf CLI auth, Lightning fixtures, and Salesforce's official UTAM page objects
Maintainers
Readme
salesforce-utam
Salesforce testing for Playwright, built on
playwright-utam: passwordless org authentication through the
sf CLI, Lightning-aware fixtures and navigation, and the full
UTAM page-object ecosystem.
Usage
import { test, expect } from 'salesforce-utam';
import HighlightsPanel from 'salesforce-pageobjects/force/pageObjects/highlightsPanel';
test.use({ sfOptions: { targetOrg: 'my-org' } });
test('record page', async ({ sf, utam }) => {
await sf.goToRecord('Account', accountId);
const highlights = await utam.load(HighlightsPanel);
expect(await highlights.getPrimaryField()).toContain('Acme');
});Requires the Salesforce CLI with an authenticated org:
npm install --global @salesforce/cli
sf org login web --alias my-orgWhat's included
test/expect— Playwright test extended withsf(logged-in Lightning page helper),sfOrg(connection info), andutam(UTAM loader) fixtures.SalesforcePage—login,goToPath,goToRecord,goToObjectHome,goToApp,waitForReady(spinner-settled),waitForToast.salesforceStorageState— produce astorageStatefile for Playwright projects.getOrgConnection/frontdoorUrl— sf CLI session plumbing.soql/createRecord/deleteRecord— CLI-backed test-data helpers.
Authentication uses the CLI's access token via frontdoor.jsp (the mechanism behind
sf org open); no username or password ever appears in test code.
