Email Actions
DevAssure’s Email Test Actions enable seamless testing of email workflows, such as account verification, notifications, and transactional emails. These actions allow users to dynamically create test email accounts, fetch emails, and validate their content to ensure robust functionality.
Action | Description |
---|---|
Create new mail ID with (prefix) | Creates a new email address with the specified prefix and configured sub domain. |
Create new mail ID) | Creates a new random email address with the configured sub-domain. |
Get last email for (mail ID) | Fetches the most recent email received by the specified email address. |
Wait for email for (mail ID) within (duration) milliseconds | Waits for a new email to arrive in the specified mailbox within the given duration |
Wait for email for (mail ID) matching (from) (subject) within (duration) milliseconds | Waits for a specific email matching the sender and subject to arrive within the given duration. |
Get email subject (email)) | Extracts the subject line from the specified email. |
Get email text content (email) | Retrieves the text content/body of the specified email |
Get email from address (email) | Extracts the sender’s email address from the specified email |
Delete all emails for (mail ID)) | Deletes all emails associated with the specified email address. |
Open email in browser email | Opens the specified email in a web browser to visually verify its content or layout. |
Create new mail ID with (prefix)
Creates a new email address with the specified prefix.
-
Usage: Generate test-specific email addresses to isolate test data.
#create a new Automation mail id with prefix
Create new mail id with prefix devassure -
Arguments:
- prefix (String): The desired prefix for the email address.
-
Returns: Returns the created email address. (Reference screenshot as above)
- eg : [email protected]
Create new mail ID
Creates a new random email address with the configured sub-domain
-
Usage: Use for generating anonymous email addresses for testing.
mailId= Create new mail id
-
Returns: Returns the created email address. (Reference screenshot as above)
Get last email for (mail ID)
Fetches the most recent email received by the specified email address.
-
Usage: Retrieve the latest email for validation purposes.
email = Get last email for [email protected]
-
Arguments:
- mail ID : The email address to fetch the last email for
Wait for email for (mail ID) within (duration) milliseconds
Waits for a new email to arrive in the specified mailbox within the given duration.
-
Usage: Useful for testing delayed or asynchronous email triggers.
mailId= Create new mail id
Wait for email for mailId within 5000 -
Arguments:
-
mail ID: The email address to monitor.
-
duration (Integer): Maximum wait time in milliseconds.
-
Wait for email for (mail ID) matching (from) (subject) within (duration) milliseconds
Waits for a specific email matching the sender and subject to arrive within the given duration.
-
Usage: Ensure specific emails are received as expected.
Wait for email for matching from regex .*@example\.com subject regex ^Order Confirmation$ within 5000 milliseconds
This waits for an email from any address ending in @example.com with the subject Order Confirmation within 5000 milliseconds.
-
Arguments:
-
mail ID : The email address to monitor.
-
from : Expected sender email address.
-
subject: Expected subject line of the email.
-
duration : Maximum wait time in milliseconds.
-
You can test your regex string at Regex Tester. This is a useful tool to see if your regex pattern matches the text you intend it to.
Get email subject (email)
Extracts the subject line from the specified email.
-
Usage:
Validate the subject of the received email.
emailSubject = Get last email for [email protected]
subject = Get email subject emailSubject -
Arguments:
- email: The email object to extract the subject from.
Get email text content (email)
Retrieves the text content/body of the specified email.
-
Usage:
Validate the content of the email body.
emailContent = Get last email for [email protected]
content = Get email text content emailContent -
Arguments:
- email: The email object to extract the content from.
Get email from address (email)
Extracts the sender’s email address from the specified email.
-
Usage:
Verify the source of the received email.
emaiAddress = Get last email for [email protected]
from_address = Get email from address emailAddress -
Arguments:
- email: The email object to extract the sender's address from
Delete all emails for (mail ID)
Deletes all emails associated with the specified email address.
-
Usage:
Clear inbox for fresh testing scenarios
Delete all emails for mailId1
-
Arguments:
- mail ID: The email ID whose emails are to be deleted.
Open email in browser email
This action opens the specified email in a web browser to visually verify its content or layout.
-
Usage:
This action is useful for verifying email content in its rendered format, especially for HTML emails. It allows teams to check email appearance, links, and other interactive elements directly in a browser environment.
Open email in browser email_1
-
Arguments:
- email: The email object to be opened in browser