Provide full stack trace on custom command failure #15581
Labels
stage: proposal 💡
No work has been done of this issue
type: enhancement
Requested enhancement of existing feature
type: error message
What would you like?
I would like to see the full stack trace when a custom command fails.
At the moment I see this:
So I can see the line in the custom command that failed and I can see which command was invoked, but I cannot see which line in the test was the command called from.
I'm pretty sure we already get a full stack trace for Cypress's built-in commands, taking you all the way back to the line of the test that caused them. For example if
cy.click()
fails to click an element, you get a larger stack trace including the line in the test that called the click method that failed, so I wish we would get the same just with custom commands.Why is this needed?
It would improve the usability of custom commands since it's time consuming to find the line on the test calling the command that failed, especially if the same test invokes the same custom command multiple times.
An example would be, we wrote a custom command that interacts with our modals and automatically selects an item from a modal with a specific data attribute tag. Because we have a lot of modals this command gets invoked multiple times per test, making it hard to figure out which exact command in the test caused the error without having to look at the logs backwards, especially if we are trying to debug an error from a CI.
The text was updated successfully, but these errors were encountered: