YOU54F / cypress-plugins

A home for various Cypress Plugins

Home Page:https://cypress-plugins.saf.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cypress slack report not showing skipped tests

Shubham1406220 opened this issue · comments

In our cypress tests, few are getting skipped in the mochawesome report it shows the skipped count but when send the notification on slack it doesn't show the skipped test count
image

The code doesn't consider the skipped count, so that is why you don't see it

const parsedData = JSON.parse(rawdata.toString());
const reportStats = parsedData.stats;
const totalSuites = reportStats.suites;
const totalTests = reportStats.tests;
const totalPasses = reportStats.passes;
const totalFailures = reportStats.failures;
const totalDuration = reportStats.duration;
if (totalTests === undefined || totalTests === 0) {
reportStats.status = "error";
} else if (totalFailures > 0 || totalPasses === 0) {
reportStats.status = "failed";
} else if (totalFailures === 0) {
reportStats.status = "passed";
}
return {
totalSuites,
totalTests,
totalPasses,
totalFailures,
totalDuration,
reportFile,
status: reportStats.status,
};
};

duplicate of #1218