Back to Cypress

Access the component

npm/vue/cypress/component/advanced/access-component/README.md

15.18.1396 B
Original Source

Access the component

If you need to access the mounted component from test, a reference is available at Cypress.vue after the mount finishes (asynchronously).

js
mount(...)
.then(() => {
  Cypress.vue.<prop> = ...
  // or call a method
  Cypress.vue.<method()
})
// then check the UI
cy.contains(...)

See component Message.vue and message-spec.js