Set up Outlook for tests
Last updated
Last updated
Built-in variables solve multiple problems of testing user sign-up and logging in.
Test case: as a user, I go to the homepage and click "sign up" button. I enter my email and password. I receive a verification email. I click the link. I use previous email and password to log in.
We're going to use variables to solve a number of problems
How to get a unique random email address
How to receive the email with the authorization link
How to use previously generated unique email and password in the login form
Register a new account in an email provider that supports plus aliasing or sub-addressing ex. Outlook or iCloud mail.
Important! Don't use Gmail as BugBug extension will fail in the Gmail app because of a bug caused by Chromium
Let's assume you registered such an email acmeautomation@outlook.com
Your emails may be at first classified as "junk mail", but later Outlook may just put them in your inbox and organize them into a conversation. To prevent this unpredictable behavior you need to change a few switches in the Outlook settings
Add BugBug email to safe addresses to prevent junk email classification
Disable the conversation view in Outlook settings
Disable the Focused inbox
Create a new test and start recording. When you're about to enter the registered email address, remember to use the plus aliasing and add a random text after the "+" symbol for example acmeautomation+12345@outlook.com
We're going to replace this suffix later with a variable!
During the recording, open a new tab and access your email inbox. Use your normal email address without the +12345
part in the email log-in form.
Find the email with the authorization link.
Don't forget to check the junk email folder! To prevent that we recommend that you add BugBug email to "safe emails" in Outlook settings.
Important! Make sure you click the subject line of the email! BugBug needs to always open the most recent email, so your selector here needs to click the first email with a specific subject line, for example //SPAN[normalize-space(text())="
Finish your sign-up"]
Now just click the Button with the authorization link and continue recording.
In the login form to your app, remember to again use the email address with the plus alias acmeautomation+12345@outlook.com
Now finish the recording. We now need to replace the recorded texts with variables manually.
If you run the test without using variables, it will fail because you will get a validation "This email already exists".
We need to have a unique email address every time we run this test.
To do this, you can use a built-in variable testRunId
In the test find all the steps that use acmeautomation+12345@outlook.com
and replace it with acmeautomation+{{testRunId}}@outlook.com
Every time you run the test, you will see that a new unique email address is typed in the registration and login fields.
You will see a computed value in the step details.