Skip to content

@saflib/playwright


@saflib/playwright

Utilities for Playwright tests.

Interfaces

InterfaceDescription
ScreenshotOptionsOptions for the attachScreenshot function.

Variables

VariableDescription
tightAndroidViewportDimensions for a small Android device, for E2E testing the mobile experience.

Functions

FunctionDescription
attachScreenshotAttach a screenshot to the test report. Use throughout tests to create a visual record of the user journey for easier review.
chooseVuetifySelectOptionThe Vuetify select component is a bit tricky with Playwright, so this is a convenience function for choosing an option. Matches when the option label contains option, or when option contains the visible label (handles truncated dropdown text ending in ). Waits for options to appear after open (async item sources like form pickers).
cleanScreenshotsClean up screenshots from the previous test run. Call this at the beginning of your test.
getByStringConvenience function for getting an element by an ElementString. Use this as much as possible, as it really helps avoid spending a bunch of time debugging string matching issues.
getUniqueEmailConvenience function for generating a unique email for tests.
getUniqueIdConvenience function for generating a unique user ID for tests.