solutions
PyTest email + SMS testing API
Receive email and TXT message codes in Pytest python automated tests
Create and control unlimited real email accounts and phone numbers using MailSlurp's free Python APIs and PyTest integrations.
Real users, real tests
Use real user accounts during automated quality assurance testing in pytest to ensure that functionality actually functions.
inbox_controller = mailslurp_client.InboxControllerApi(api_client)
inbox = inbox_controller.create_inbox()
assert "@mailslurp" in inbox.email_address
begin_signup_with_email_address(inbox.email_address)
Never flaky
MailSlurp has powerful wait methods to hold open test connections until verification codes are received and emails can be verified.
wait_controller = mailslurp_client.WaitForControllerApi(api_client)
email = wait_controller.wait_for_matching_first_email(
inbox_id=inbox.id,
match_options=mailslurp_client.MatchOptions(matches=[mailslurp_client.MatchOption(
field="SUBJECT",
should="CONTAIN",
value="Verify acount"
)]),
unread_only=True,
timeout=60000
)
assert email.subject == "Verify acount"
Extract content, confirm users
Use built-in pattern matching and code extraction to fetch out confirmation codes and links to test user verification end-to-end.
email_controller = mailslurp_client.EmailControllerApi(api_client)
pattern = "Your code is: (\\d{6})"
_, code = email_controller.get_email_content_match(
email_id=email.id,
content_match_options=mailslurp_client.ContentMatchOptions(pattern)
).matches
finish_signup_with_code(code)
Better than the rest
Don't waste time trying to integrate SMTP or Gmail providers into your workflow. MailSlurp is fast, reliable, and built for testing. That means your team can concentrate on what it does best - delivering results.