@saflib/playwright
@saflib/playwright
Utilities for Playwright tests.
Interfaces
| Interface | Description |
|---|---|
| ScreenshotOptions | Options for the attachScreenshot function. |
Variables
| Variable | Description |
|---|---|
| tightAndroidViewport | Dimensions for a small Android device, for E2E testing the mobile experience. |
Functions
| Function | Description |
|---|---|
| attachScreenshot | Attach a screenshot to the test report. Use throughout tests to create a visual record of the user journey for easier review. |
| chooseVuetifySelectOption | The 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). |
| cleanScreenshots | Clean up screenshots from the previous test run. Call this at the beginning of your test. |
| getByString | Convenience 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. |
| getUniqueEmail | Convenience function for generating a unique email for tests. |
| getUniqueId | Convenience function for generating a unique user ID for tests. |