Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide full stack trace on custom command failure #15581

Open
azerkail opened this issue Mar 19, 2021 · 1 comment
Open

Provide full stack trace on custom command failure #15581

azerkail opened this issue Mar 19, 2021 · 1 comment
Labels
stage: proposal 💡 No work has been done of this issue type: enhancement Requested enhancement of existing feature type: error message

Comments

@azerkail
Copy link

azerkail commented Mar 19, 2021

What would you like?

I would like to see the full stack trace when a custom command fails.
At the moment I see this:
image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: proposal 💡 No work has been done of this issue type: enhancement Requested enhancement of existing feature type: error message
Projects
None yet
Development

No branches or pull requests

2 participants