This repository provides examples, tools, and utilities for integrating Mabl and Playwright.
To install the @mablhq/playwright-tools
package, you will need:
- Playwright 1.43.1 or greater
- Your mabl workspace ID
- A mabl API key of type "Command Line Interface"
- Credential ID - create mabl credentials and get the ID
- Database ID - create a database connection and get the ID
Note: This example project assumes that the database has a
pets
table.
The best way to use this demo project is to create a .env
file in the root of the project with the following content:
MABL_API_KEY=your_api_key
MABL_WORKSPACE_ID=your_workspace_id
DATABASE_ID=your_database_id
MABL_CREDENTIALS_ID=your_credentials_id
Create a temporary email address, send a test email, and open it to verify that the email is received with the correct details:
mabl-playwright-integrations/tests/mabl-demos/email.spec.ts
Lines 8 to 22 in 10ad925
Evaluate the state of the page https://www.mabl.com
with a GenAI Assertion:
mabl-playwright-integrations/tests/mabl-demos/genAi.spec.ts
Lines 7 to 14 in 10ad925
Run a database query step to retrieve 15 rows from a "pets" table column using a connection from your mabl workspace:
mabl-playwright-integrations/tests/mabl-demos/database.spec.ts
Lines 8 to 12 in 10ad925
Download and validate the contents of a PDF from the mabl sandbox
mabl-playwright-integrations/tests/mabl-demos/pdf.spec.ts
Lines 15 to 31 in 10ad925
Log in with mabl MFA credentials
mabl-playwright-integrations/tests/mabl-demos/credentials.spec.ts
Lines 11 to 13 in 10ad925