Plugin to send email after execution with results.
- Get execution details using
pytest_terminal_summary()
hook - Build html template
- Send's email for respective recipients
-
Install
pytest-email
Case 1: Using pip
pip install pytest-email
Case 2: Using
setup.py
(clone repo and run command in root)python setup.py install
Case 3: Install from git (changes in master)
pip install git+https://github.com/adiralashiva8/pytest-email
-
Execute test's normally using options
pytest --euname="username" --epwd="XXXXX" --efrom="from@gmail.com" --eto="test1@gmail.com,test2@gmail.com"
By default send email is false, users need to enable send email by using following command
pytest --esend=True
Email options:
-> --euname - Email user name or id (for auth) -> --epwd - Email user password -> --efrom - sender email id -> --eto - Recipients email ids -> --esmtp - Email server smtp -> --esubject - Email subject -> --eorg - Organization name to include in email -> --esend - Send email based on input -> --eanon - Do not use SMTP auth -> --eforcessl - If set, force secure connection when SSL is required and starttls is not supported
USAGE
pytest --esend=True --euname="test@gmail.com" --epwd="XXXXX" --eto="test1@gmail.com,test2@gmail.com" --esubject="ABC Project Execution" --eorg="MyCompany" --esmtp="smtp.xxxx.4578"
Sample Report
Following test counts:
- Total
- Passed
- Failed
- Skipped
- Error
- XPassed
- XFailed
- Duration
Future: Failed test information
Thanks for using pytest-email!
If you have any questions / suggestions / comments on this, please feel free to reach me at
- Email:
adiralashiva8@gmail.com
- LinkedIn:
shivaprasadadirala
- Twitter:
@ShivaAdirala
Credits
⭐ repo if you like it