-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix issue where command is never fully ended and following assertions are displayed incorrectly #7734
Conversation
… a command and the previous command in a hook was a cy.then
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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 can't recreate this issue in 4.8.0 or the develop
branch. Are you sure this wasn't introduced in #7356 itself? Can you provide the repro example for the original issue?
I tried using before
hooks, tried moving the before
hook around the suites...
Below is what I'm seeing in develop
branch.
context('closing commands', () => {
beforeEach(function () {
})
it('properly closes commands', () => {
expect(true).to.be.true
})
})
context('closing commands', () => {
beforeEach(function () {
cy.visit('index.html')
})
it('properly closes commands', () => {
expect(true).to.be.true
})
})
@jennifer-shehane I may have described the actual cause of the issue incorrectly. I've since updated the original issue with what I believe to be the actual cause of the bug. I also realized that this issue was only occuring when I put an |
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.
Looks good 👍
What this green dash means? |
@Saibamen It is used to indicate that the command is a 'child' command, that there is a parent above it. |
User facing changelog
Fixes an issue where an assertion log would be displayed as a child while really a parent if no commands were issued in the
beforeEach
loop.Additional details
Fixes an internal issue where commands would not be properly closed after executing.
How has the user experience changed?
Notice green dash to the left of "assert"
Before:
After:
PR Tasks