Open
Description
Current behavior
Currently, the mount
commands compose additional Cypress commands which makes the mount functions act more like user defined custom commands than first class Cypress commands.
Desired behavior
We should strive to eliminate all of the cy.wait
, cy.then
, etc. calling from within our mount commands:
- https://github.com/cypress-io/cypress/blob/develop/npm/react/src/createMount.ts#L70-L81
- https://github.com/cypress-io/cypress/blob/develop/npm/vue/src/index.ts#L399-L426
- https://github.com/cypress-io/cypress/blob/develop/npm/svelte/src/mount.ts#L59-L75
- https://github.com/cypress-io/cypress/blob/develop/npm/angular/src/mount.ts#L491-L518
Rather than doing all of the waiting, etc., we should listen to the framework mount events to know when the component has been fully inserted into the DOM and ready to run tests against.
The driver for this is to ensure that the stack trace we get for the mount command traces back to where cy.mount
is called in a spec file, rather than in some .then
callback deep inside Cypress code.
Cypress Version
14.0.0
Activity