Playwright MailSlurp testing

Playwright MailSlurp testing

MailSlurp integrates easily with existing Playwright projects. Simple add the NodeJS, Java, CSharp or Python MailSlurp package to your test environment and you can create email addresses, send and receive emails, and send and receive TXT messages.

Examples

Loading examples...

Resources

Tutorial

Get started

In order to use MailSlurp in your Playwright tests you need to do two things:

  • Obtain and configure an API KEY
  • Install the MailSlurp client library for your language

Javascript

bash
npm install --save mailslurp-client

CSharp

bash
dotnet add package mailslurp

Java

For Maven add:

xml
<!-- place inside the <dependencies> block -->
<dependency>
<groupId>com.mailslurp</groupId>
<artifactId>mailslurp-client-java</artifactId>
<version>LATEST</version>
<type>pom</type>
</dependency>

For gradle add:

kotlin
dependencies {
implementation("com.mailslurp:mailslurp-client-java")
}

Python

bash
pip install mailslurp-client

Use MailSlurp within your tests

You can now use MailSlurp to create email addresses, send and receive emails, and send and receive TXT messages. Here is an example of how to use MailSlurp in a Playwright test:

text
Loading...

Example projects

For more examples see the [MailSlurp examples repository] or the following: