- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
Web application journeys often involve emails being triggered and sent to users’ mailboxes, such as an email verification after account creation, an email sent to reset forgotten passwords, an email sent to notify order confirmation, or an email confirmation after contact form submission.
Maintaining a great user experience on your website includes ensuring that your application’s email mechanisms are working properly.
To add an email variable called EMAIL
:
The email variable generates a unique mailbox maintained by Datadog at every test execution, which enables your browser tests to run without conflicts.
Once you have created an email variable, you can confirm the email was sent correctly after an in-app trigger.
Click Start Recording and record all of the steps leading up to the email being triggered with your email variable. Click the hand icon in a variable to inject its value into the text input of a form or field.
After recording your steps to complete the form, click the Sign Up button to trigger an email notification. An email tailored to this recording session is sent to the Datadog mailbox, for example, 838-n3q-q2y.6238933596@synthetics.dtdg.co
.
To confirm that the email was sent, click Assertion and select Test that an email was received. To ensure your email follows specific guidelines for content, you can add additional verifications on the subject and body.
In this example, the assertion is successful if the email subject is Welcome to Shopist!
, the body contains the sentence Your verification code is...
, and the verification code matches the \d{1,6}
regex pattern.
To have your browser test navigate through links inside sent emails:
In this example, the browser test looks into the Welcome to Shopist
email, clicks the Verify your email by clicking here
link, and confirms the user registration mechanism is working as expected.
As the final step to your browser test, create an assertion to confirm that the div
content triggers the proper account verification. For example, the page contains Your account is now verified
.
Additional helpful documentation, links, and articles: