Skip to content

Commit

Permalink
deleted innecesary dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mflorlorenzo committed Jul 9, 2024
1 parent fb3d38a commit 96a38ea
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,18 @@ Cypress.on("uncaught:exception", (err, runnable) => {
});

//For Reports
import 'cypress-mochawesome-reporter/register'
import addContext from 'mochawesome/addContext'
import "cypress-mochawesome-reporter/register";

const titleToFileName = (title) =>
title.replace(/[:\/]/g, '')
const titleToFileName = (title) => title.replace(/[:\/]/g, "");

Cypress.on('test:after:run', (test, runnable) => {
if (test.state === 'failed') {
let parent = runnable.parent
let filename = ''
Cypress.on("test:after:run", (test, runnable) => {
if (test.state === "failed") {
let parent = runnable.parent;
let filename = "";
while (parent && parent.title) {
filename = `${titleToFileName(
parent.title,
)} -- ${filename}`
parent = parent.parent
filename = `${titleToFileName(parent.title)} -- ${filename}`;
parent = parent.parent;
}
filename += `${titleToFileName(
test.title,
)} (failed).png`
/*addContext( { test }, `../screenshots/${Cypress.spec.name}/${filename}`,
),
addContext({ test }, `../videos/${Cypress.spec.name}.mp4`)*/
filename += `${titleToFileName(test.title)} (failed).png`;
}
})
});

0 comments on commit 96a38ea

Please sign in to comment.