how to send emails of generated HTML reports in cypress #28258
Unanswered
Willingdon1113
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
36
tasksendMail, This will be output to email address
AFTER ALL (FAILED)
1
tasksendMail, This will be output to email address
CypressError
cy.task('sendMail') failed with the following error:
The task 'sendMail' was not handled in the setupNodeEvents method. The following tasks are registered: log
Fix this in your setupNodeEvents method here:
C:\xampp\htdocs\automation-testing\Cypress_Automation\cypress.config.js
Because this error occurred during a after all hook we are skipping all of the remaining tests.Learn more
cypress/support/e2e.js:31:8
29 |
30 | after(() => {
I got this error when runs script
const { defineConfig } = require('cypress')
module.exports = defineConfig({
// setupNodeEvents can be defined in either
// the e2e or component configuration
e2e: {
setupNodeEvents(on, config) {
on('task', {
log(message) {
console.log(message)
},
})
this is my cypress.config.js file
after(() => {
cy.task('sendMail', 'This will be output to email address')
.then(result => console.log(result));
})
this is my e2e.js file
const sendAnEmail = (message) => {
}
module.exports = (on, config) => {
on('task', {
sendMail (message) {
return sendAnEmail(message);
}
})
}
This is my commands.js file
Beta Was this translation helpful? Give feedback.
All reactions