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

Fix issue where command is never fully ended and following assertions are displayed incorrectly #7734

Merged
merged 4 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/driver/cypress/integration/cypress/cy_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ describe('driver/src/cypress/cy', () => {
$(doc.body).empty().html(body)
})

// https://github.com/cypress-io/cypress/issues/7731
// NOTE: this must remain the first test in the file
// or it will not properly check for the described issue
context('closing commands', () => {
beforeEach(function () {
this.logs = []

cy.on('log:added', (attrs, log) => {
this.logs.push(log)
})

return null
})

it('properly closes commands', function () {
expect(true).to.be.true
expect(this.logs.length).to.be.equal(1)
expect(this.logs[0].toJSON()).to.have.property('type', 'parent')
})
})

context('hard deprecated private props', () => {
it('throws on accessing props', () => {
const fn = () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/driver/src/cypress/cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ const create = function (specWindow, Cypress, Cookies, state, config, log) {
// also reset recentlyReady back to null
state('recentlyReady', null)

// we're finished with the current command
// so set it back to null
state('current', null)

state('subject', subject)

return subject
Expand Down