Integrate mabl's advanced testing features directly into your Playwright test suites to extend functionality and create richer, more comprehensive tests.
With the @mablhq/playwright-tools
package, you can use the following advanced mabl functionality in your Playwright tests:
- Email testing: Create and use temporary and permanent mabl Mailbox addresses to validate email testing scenarios.
- GenAI Assertions: Create complex assertions without complex code to validate images, text, and chatbot interactions.
- Login scenarios and MFA: Securely store and manage test credentials in the mabl cloud, and automate login flows that require two-factor authentication codes to complete a login.
- Database queries: Manage and validate test environment databases without having to install database drivers or manage test environment networking.
- PDF testing: Open PDF documents downloaded during test execution in a Playwright tab as testable HTML and validate the contents of the PDF.
Before you start
To use the @mablhq/playwright-tools
package, you will need:
- Playwright 1.43.1 or greater - see Playwright requirements for more information.
- Your mabl workspace ID - available in Settings > Workspace in the mabl app
- A mabl API key of type "Command Line Interface" - workspace owners can create and manage API keys in Settings > APIs in the mabl app
Install playwright-tools
Install the @mablhq/playwright-tools
package:
npm install @mablhq/playwright-tools -D
TypeScript
@mablhq/playwright-tools can be installed from NPM. No additional packages are required to use the tools with TypeScript. All types are included with the package.
Try it out
To integrate mabl functionality into your Playwright Test Fixtures and use across an entire test suite, import and call the createMablFixtures
function inside the Playwright extend
function.
For more examples on how to add mabl steps to your Playwright test suites, check out the mabl-playwright-integrations GitHub repo.