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

Should actions triggered through Cypress.main automatically queue up? #2

Closed
bahmutov opened this issue Dec 29, 2017 · 1 comment
Closed

Comments

@bahmutov
Copy link
Owner

bahmutov commented Dec 29, 2017

in this test

it('changes state by invoking action', () => {
    // the component's actions are referenced in Cypress.main
    Cypress.main.toggle()
    cy.get('.toggle').should('be.checked')
    // the action happens synchronously
    // but Cypress commands are queued
    // thus toggle again only after previous cy.get... has passed
    cy.then(() => {
      Cypress.main.toggle()
    })
    cy.get('.toggle').should('not.be.checked')
  })

Cypress.main.toggle() is called synchronously, but previous cypress command has not finished yet - it is queued up. Thus the second toggle has to be placed into the cy.then to make sure previous check button has finished. Maybe we can wrap actions attached to Cypress.main with cy.then inside mount function?

@bahmutov
Copy link
Owner Author

Version 1.2.0 has been published to NPM. The full release note can be found at cypress-hyperapp-unit-test/releases/tag/v1.2.0.

Tip: safely upgrade dependency cypress-hyperapp-unit-test in your project using next-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant