Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
testcafe-reporter-smtp
Advanced tools
Changelog
[0.1.0] - 2021-06-29
Readme
###testcafe-reporter-smtp
This is a reporter for TestCafe. It sends the output of the test as an email via SMTP.
##Purpose Once configured the reporter builds an email (HTML and text format) and sends via an SMTP service. This means your test results will be emailed to you in a nicely formatted email.
##Setup instructions
$ npm install testcafe-reporter-smtp
Configuration is taken from two sources:
The aim is that you can specify the below configuration parameters either entirely in your local environment variables, or in the config file on disk, or a mixture of both.
.env
.nodemailer
secure option (see Security and TLS below)require("os").userInfo()
nodemailer
logger option, causes verbose output on the consoleYou probably want the connection to your SMTP server to be encrypted using TLS. From the nodemailer
documentation:
secure – if true the connection will use TLS when connecting to server. If false (the default) then TLS is used if server supports the STARTTLS extension. In most cases set this value to true if you are connecting to port 465. For port 587 or 25 keep it false
So, if you leave out TESTCAFE_SMTP_SECURE
, the reporter will make a plaintext connection to your server, but if it responds with STARTTLS then the connection will be upgraded to encryption using TLS before authentication is performed.
Run the unit tests, which set a dummy SMTP hostname that causes the reporter to not actually send the email it has built.
$ npm test
The unit test uses Mocha, and does not actually invoke a Testcafe test run or send any emails.
You can run TestCafe with testcafe-reporter-smtp either via the command line, or via a test runner.
You must have an SMTP server available to test and a username on it, e.g. gmail.com with your Google credentials.
cd into your test project.
Edit or create the .env
file by adding the following required variables:
Alternatively, call the config file anything you want and set TESTCAFE_SMTP_CONFIG_FILE=<filename>
.
$ testcafe chrome 'path/to/test/file.js' --reporter smtp
Please Note: The command line testcafe
binary executes a forced process stop once the test has finished running, which will probably terminate before the SMTP communication has completed. You may have better results using the runner API below.
When you use TestCafe API, you can pass the reporter name to the reporter()
method:
const createTestCafe = require('testcafe');
let runner = null;
let testcafe = null;
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
runner = tc.createRunner();
return runner
.src('index.ts') // This is the test fixture to run
.browsers(['chrome'])
.reporter('smtp') // This tells it to look for testcafe-reporter-smtp
.run()
.then(failedCount => {
console.log('Runner finished, failedCount: ', failedCount);
testcafe.close();
})
.catch(error => {
console.error('Caught error: ', error);
});
});
##Further Documentation TestCafe Reporter Plugins
FAQs
TestCafe SMTP reporter plugin.
The npm package testcafe-reporter-smtp receives a total of 29 weekly downloads. As such, testcafe-reporter-smtp popularity was classified as not popular.
We found that testcafe-reporter-smtp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.