playwright-utils
Playwright utils for test code repos of our customers
Utilities
- Default config for Playwright projects
- Custom reporter
- Highlight user actions
- Custom fixture to wrap around that
- Vision capabilities
locator.query
API
- Captcha
- Email automation
Email automation
Example usage
Dynamic email
This dynamically generates a random email address that can
be used for the test (e.g. invite a new user).
import { EmailClient } from "@empiricalrun/playwright-utils";
const client = new EmailClient();
const address = client.getAddress();
const email = await client.waitForEmail();
Static email
This uses a known (static) email that can be used to login
into an application.
This needs an email id (e.g. test-login-user
). The email id
is appended with the domain (managed internally) to get the full
email address.
import { EmailClient } from "@empiricalrun/playwright-utils";
const emailId = `test-login-user`;
const client = new EmailClient({ emailId });
const address = client.getAddress();
const email = await client.waitForEmail();
const loginCode = email.codes[0];