Skip to main content

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

npm install --save mailslurp-client

CSharp

dotnet add package mailslurp

Java

For Maven add:

<!-- 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:

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

Python

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:

Loading...

Example projects

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