2 * This command tries to ensure that the elements in the DOM are actually visible
3 * and done (re)rendering. This is due to how React re-renders components.
6 * => You should only use this command in instances where a test is failing due
7 * to detached elements. Cypress will probably give you a warning along the lines
8 * of, "Element has an effective width/height of 0". This warning is not very useful
9 * in pointing out it is due to the element being detached from the DOM AFTER the
10 * cy.get command had already retrieved it. This command can save you from that
11 * by explicitly waiting for the DOM to stop changing.
12 * => This command can take anywhere from 100ms to 5 seconds to complete
13 * => This command will exit early (500ms) when no changes are occurring in the DOM.
14 * We wait a minimum of 500ms because sometimes it can take up to around that time
15 * for mutations to start occurring.
18 * * https://github.com/cypress-io/cypress/issues/695 (Closed - no activity)
19 * * https://github.com/cypress-io/cypress/issues/7306 (Open - re-get detached elements)
21 * @example Wait for the DOM to stop changing before retrieving an element
22 * cy.waitForDom().get('#an-elements-id')
24 waitForDom(): Chainable<any>