Dealing with Emails

Dealing with Emails

testRigor supports sending emails as well as receiving and validating emails

You can specify both “from” and “to”, but that’s not necessary. If “from” wasn’t specified – address will default to “noreply@testrigor-mail.com”
send email to "name@domain.com" with subject "Test" and body "Hi, this is a test"
check that email from "name@domain.com" is delivered
Checking email will also automatically open and render it as an HTML page in a desktop browser window. See examples below:
check that two emails to "user@domain.com" and "Confirm" in subject were delivered
check that one or more emails to "user@domain.com" and "Confirm" in subject were delivered
check that email to saved value "newEmail" was received
check that email to saved value "newEmail" from "admin@domain.com" and "Confirm" in subject was received
check that email to saved value "newEmail" and "<regular expression>" in subject was received
If you need to render the message in the browser of the same mobile device where you test your app of website (if tested on a device), e.g. – when validating a sign up test case, or just need to validate how the email will look like on a mobile device, you can specify that as well:
check that email to "user@domain.com" and "Confirm" in subject was received and show in mobile
In some cases you might also need to verify that an email was not sent out:
check that email from "name@domain.com" was not delivered
testRigor also supports attachments, both from a URL as well as from a saved value (from Test Data section in the main menu). Both “from” and “to” addresses can be filled in from a saved value as well.
send email from "senderEmail" to "recepientEmail" with  subject "Test", and  body "Hi, this is a test", and attachment from saved value "Sample File"
send email from "sender@domain.com" to "recipient@domain.com" with  subject "Test", and  body "Hi, this is a test", and attachment "http://online.com/file/name.pdf" Make sure the file is available online without username or password though

Notes:

  1. If the email count is not specified, testRigor will assume that only one message is expected. Multiple emails are treated as an error; so in order to avoid receiving the error message, specify the number of emails that should be expected or simply inform the system that more than one can be sent out:
    check that one or more emails to saved value "recepientEmail" were received
  2. The best practice is to always generate a new unique email address, since an email sent by one test case can be consumed by another one.
  3. If you want to send out an email from a customer’s domain and validate it, you can use the following address: <user>@testrigor-mail.com, where <user> can be any string. In order to avoid overlap it is recommended that the user handle will contain the customer name and some random part, e.g. hfynerifj@testrigor-mail.com.
  4. The user is expected to add some wait time before checking email. This check action will validate delivery, but not wait for the message to arrive. For example:
    wait 2 minutes
  5. Once the action has been executed successfully, the message is deleted from the mailbox and rendered in a new tab. Adding multiple emails will be marked as an error, but each one will be rendered in a separate tab. You can switch between tabs using switch to tab "1", switch to tab "2", etc. Note that old content will stay in the tab before the first rendered email message. In most cases it is tab “1”, unless you open more tabs.
  6. Each email tab is rendered as an html page, so you can use any action that you would use on an html page. There are a few useful element ids that will help getting specific parts of an email:
    • “message-froms” – a list of “From” addresses (usually one address)
    • “message-subject” – subject line
    • “message-date” – message sent date and time in Pacific Time zone.
    • “message-tos” – a list of “To” addresses
    • “message-ccs” – a list of “CC” addresses
    • “message-bccs” – a list of “BCC” addresses
    • “message-reply-to” – “Reply To” address
    • “message-text” – the message text
    • “message-attachments” – a list of attachments (file names only)
    check "message-subject" contains "test"
  7. If you want to check again, you need to re-send the mail. Your custom actions cannot contain multiple “check” actions for the same message.
  8. Multiple recipients can be separated with “and”:
    send email to saved value "newEmail" and saved value "newEmail_2" with subject "Test" and body "Hi"
  9. All messages sent to @testrigor-mail.com will be deleted after 24 hours, whether checked or not.

Test your knowledge

The email will not be sent.
The address will default to “noreply@testrigor-mail.com”
The system will throw an error.
The “to” address will be used as the “from” address.

check that email to “user@domain.com” and “Confirm” in subject was received and view on mobile
mobile view: check that email to “user@domain.com” and “Confirm” in subject was received
check that email to “user@domain.com” and “Confirm” in subject was received and show in mobile
check that mobile email to “user@domain.com” and “Confirm” in subject was received

check that email to saved value “newEmail” is not successful from “name@domain.com”
check that email from “noreply@testrigor-mail.com” not sent
verify mail is not sent to “name@domain.com”
check that email from “name@domain.com” was not delivered