Closed ms-carterk closed 1 year ago
You could build this fairly easily in node env. See the integration section in the docs where you can do this...
backstop('test')
.then(() => {
// test successful
}).catch(() => {
// test failed
});
thank you!
const gulp = require("gulp"); const backstop = require("backstopjs"); const nodemailer = require("nodemailer");
const transporter = nodemailer.createTransport({ service: "gmail", // e.g., 'gmail' auth: { user: "sending@email.com", pass: "password", }, }); gulp.task("backstop-test", function () { return backstop("test") .then(() => { console.log("Test successful"); const mailOptions = { from: "sending@email.com", to: "to@email.com", subject: "BackstopJS Test Successful", text: "The BackstopJS test was successful.", html: "
The BackstopJS test was successful.
", }; return transporter.sendMail(mailOptions); }) .catch(() => { console.log("Test failed"); const mailOptions = { from: "sending@email.com", to: "to@email.com", subject: "BackstopJS Test Failed", text: "The BackstopJS test failed.", html: "The BackstopJS test failed.
", }; return transporter.sendMail(mailOptions); }); });
I want to be able to walk away from my desk while the test runs. Is it possible to integrate a way to send an email after the test is done?