Open alhajiry opened 1 year ago
The same question. Any updates?
Can you give me a small repo with a reproducible example?
https://github.com/triori/badeball_cypress-if
This is a small repo with three of useless test.
The modules and structure used are the same as in my work project.
You can run it like npx cypress run
and at the end of failed test log you can see
cy:command ✔ task cypress-cucumber-preprocessor:test-step-finished, Object{4}
cy:command ✔ task cypress-cucumber-preprocessor:test-case-finished, Object{3}
This happens only with cypress-if
module.
I don't see anything that is obviously wrong, and debugging this problem is beyond the time I have right now. Any help with this is appreciated
I opened issue in the @badeball git hub, maybe his answer will be important.
https://github.com/badeball/cypress-cucumber-preprocessor/issues/1175#issuecomment-2040111626
I tried to use cypress-if, which looks amazing, solves a ton of problems, and gives much more flexibility, but I have the same problem with my logs. And now we are faced with a problem in our team. These logs greatly interfere with the use of this plugin. We have stopped its further implementation for now because we are trying to understand how much such logs complicate the daily work of the entire team. The question is about disconnection. Which I really wouldn’t want because this plugin is very useful.
Started using cypress-if and it's amazing, but this issue makes extremely hard to analyze results. Is there any updates?
I tried to use cypress-if, thanks for this update but I also have problems with the logs as mentioned here
While working with cypress-if, I faced the issue related to flooding of logs. I really don't want to break with cypress-if, but this problem is making my job very difficult
Sorry everyone, no updates, the https://github.com/triori/badeball_cypress-if repo is good, but there is way too much going on for me to immediately see the problem :( Anyone wants to look into it and find the root problem? I would be open to a PR with a fix
@bahmutov unfortunately I don't have enough time for full investigation but in badeball module that I use, the log for some tasks is off:
function taskTestStepFinished(
context: CompositionContext,
testStepfinished: messages.TestStepFinished
) {
if (context.isTrackingState) {
cy.task(
TASK_TEST_STEP_FINISHED,
testStepfinished satisfies ITaskTestStepFinished,
{
log: false
}
);
}
}
but you fully overwrite all kind of tasks:
Cypress.Commands.overwrite('task', function (task, args, options) {
debug('cy.task %o', { args, options })
const cmd = cy.state('current')
if (cmd) {
debug(cmd)
const next = cmd.attributes.next
if (isIfCommand(next)) {
// disable the built-in assertion
return task(args, options).then(
(taskResult) => {
debug('internal task result', taskResult)
return taskResult
},
(error) => {
debug('task error', error)
cmd.attributes.error = error
},
)
}
}
return task(args, options)
})
Could it be the root of our problem?
I noticed that when I import cypress-if to project that have cucumber-preprocessor from @badeball installed and then runs the test, Cypress will log something like this :
fyi : I don't use any hooks like Before, AfterEach, etc.