Using Emails in Test Scenarios with WolfPack

Introduction

Welcome to the world of automated testing with WolfPack! In this section, we’ll explore an essential and powerful feature of the platform: email integration in your test scenarios. This functionality allows you to test complex workflows involving email sending and receiving, such as account creation, email validation, or automated notifications.

Using emails in your tests significantly improves functional coverage while seamlessly integrating into your existing scenarios. Whether you’re new to automation or an expert, this feature is designed to simplify your workflow and make your tests more robust.

Why integrate emails into your tests?

Many modern web applications rely on email interactions, whether it’s to confirm a registration, reset a password, or send alerts. Automating the testing of these features is essential to ensure they work properly.

With WolfPack, you can include dedicated email steps directly in your test scenarios. This allows you to verify not only the reception of emails but also their content and even interact with them (such as clicking on a validation link). Here’s why this feature is indispensable:

  • Validate critical workflows: Easily test processes like registration, password recovery, or any case requiring email interactions.
  • Simplify complex tests: WolfPack automatically manages email reception and display, letting you focus on business assertions.
  • Flexibility and customization: Create dynamic email addresses tailored to each test or project, ensuring smooth execution.

Key use cases

1. Account creation

A common scenario is account validation during registration. For example:

  • Navigate to the registration page.
  • Fill out the form with your information.
  • Validate the reception of a confirmation email.
  • Click on the link to activate the account.
  • Verify that the user is redirected to the correct page.

2. Automated notifications

Test alerts sent by your application, such as:

  • When a user performs an important action.
  • To notify about an account update or status change.

3. Password reset

This scenario includes:

  • A step to request a password reset.
  • Receiving an email containing a secure link.
  • Verifying that the link works and redirects correctly.

These are just a glimpse of the possibilities. With WolfPack, the scenarios are limitless!

How does it work?

WolfPack’s email management is built on three key elements:

1. Dynamic email addresses

WolfPack automatically generates email addresses based on your projects. For example:

  • anything_${projectId}@mail.wolfpackqa.com

This flexibility allows you to customize the addresses according to your needs:

  • Static address: Use the same address for all tests in a project.
  • Test-specific address: Use a unique address for each execution with variables like {{testRunId}}.
  • Recurring job address: Generate addresses tailored to scheduled tasks with {{jobId}}.

2. Email reception and display

When an email is sent to an address like @mail.wolfpackqa.com, it’s automatically associated with the corresponding project. Two usage modes are available:

  • Recording mode: All received emails are displayed, allowing you to decide whether to use them.
  • Play mode: Emails are displayed only if a "An email is received" step is defined and the filters (sender, receiver, subject) are correct.

3. Seamless integration into your tests

When an email is received and matches the defined criteria, it is displayed directly in the browser during the test execution. You can then:

  • Click on links to continue the scenario.
  • Perform assertions on the content (text, attachments, etc.).

Example scenario

Let’s take a concrete example: testing account creation on an application.

  1. Navigate to the registration page
    • Step: "Go to URL"
    • Parameter: https://app.example.com/signup
  2. Fill out the form
    • Step: "Type Text"
    • Parameters:
      • input[name="email"]: test_${testRunId}@mail.wolfpackqa.com
      • input[name="password"]: password123
  3. Submit the form
    • Step: "Click"
    • Parameter: button[type="submit"]
  4. Receive the email
    • Step: "An email is received"
    • Parameters:
      • Sender: noreply@example.com
      • Subject: "Activate your account"
  5. Interact with the email
    • Step: "Click"
    • Parameter: Link in the email.
  6. Validate the redirection
    • Step: "Assert URL Address"
    • Parameter: /account-activated

This scenario can be easily configured in WolfPack without requiring additional setup.

Advanced email management

Filters

To avoid interference, you can apply filters to:

  • The sender: Ensure that only emails from a specific address are used.
  • The recipient: Verify that the email is sent to the correct project address.
  • The subject: Isolate specific emails among multiple received ones.

Environment variables

Variables like {{testRunId}} or {{jobId}} allow you to customize emails in advanced ways, ensuring their uniqueness while simplifying management.

User interface

WolfPack’s interface simplifies email interaction:

  • Recording mode: A pop-up window displays emails in real-time. You can click on a link or close the window to ignore the email.
  • Play mode: Emails are displayed only if the "An email is received" step’s conditions are met.

Local or cloud execution

Whether you run your tests locally or in the cloud, email management works identically. No additional configuration is required. As long as an email is sent to an @mail.wolfpackqa.com address associated with the correct project, it will automatically be available in the test context.

Conclusion

Integrating emails into your test scenarios with WolfPack unlocks endless possibilities for automating and validating complex workflows. Whether you’re testing simple account validation or advanced notification systems, this feature ensures precise and reliable tests.

Thanks to its ease of use, customization options, and seamless integration, WolfPack turns email-related testing into a simple and efficient task. Try it now and see how this feature can enrich your testing scenarios!

If you have any questions or need help configuring your tests, our team is here to support you. 😊

utilisation-des-emails-dans-les-scenarios-de-test-avec-wolfpack