-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: (studio) remove itGrep lines from stack trace when determining invocationDetails
#32699
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
base: develop
Are you sure you want to change the base?
Conversation
… invocationDetails
cypress
|
||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
astone123/fix-itgrep-trace
|
| Run status |
|
| Run duration | 19m 56s |
| Commit |
|
| Committer | Adam Stone-Lord |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
15
|
|
|
1102
|
|
|
4
|
|
|
26755
|
| View all changes introduced in this branch ↗︎ | |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
45.61%
|
|
|---|---|
|
|
187
|
|
|
161
|
Accessibility
97.98%
|
|
|---|---|
|
|
4 critical
8 serious
2 moderate
2 minor
|
|
|
101
|
|
@mschile @mabela416 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it locally and it works
| } | ||
| } | ||
|
|
||
| // if the stack includes the 'itGrep' function, remove any lines that include it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely good to reference what itGrep is and where it is coming from (same with above) https://github.com/cypress-io/cypress/blob/develop/npm/grep/src/register.ts#L77. people who aren't familiar with @cypress/grep will struggle to understand what this means.
The other concern I have is that there could be something legitimate in the stack that has itGrep in it that we want to capture but are omitting it here. Or is this only considered when trying to calculate the row/column in the spec file where the error occurred?
Additional details
This PR fixes the invocation details when
ithas been re-written asitGrepwhich happens in the@cypress/grepand@bahmutov/cy-grepplugins. This allows us to determine the correct invocation details for the test.Steps to test
I tested this with the
@bahmutov/cy-greppackage. Install the package and register it in your support file in accordance with the documentation. Open Cypress Studio by clicking the "edit in studio" button next to a test. Verify that the test content is loaded correctly and you can edit and save the test as expected.How has the user experience changed?
Users of
@bahmutov/cy-greppackage can now use studio as intendedPR Tasks
cypress-documentation?type definitions?Note
Removes
itGrepframes from error stacks to correctly resolve invocation details, with a unit test covering grep-modified stacks.stackWithGrepLinesRemovedto filter lines containingitGrep.getInvocationDetailsto dropitGrepframes after trimming to spec frames.getSourcePosition.Written by Cursor Bugbot for commit b6bc0f5. This will update automatically on new commits. Configure here.