title: Cypress Test Fails: Getting "This DOM element likely became detached somewhere between the previous and current command"
body: <p>Issue - I am trying to fill all input fields in a given page with a given value and tests are failing currently with the below error :</p>
  <p>cy.clear for an input element failed</p>
  <p>&quot;Cypress requires elements to be attached in DOM to interact with them&quot;</p>
  <p>The previous command that ran was cy.wrap
  &quot;This DOM element likely became detached somewhere between the previous and current command&quot;</p>
  <p>The custom command that is being used is given below which is causing the error but in local am not able to reproduce the issue but coming in our terminal</p>
  <pre><code>Cypress.command.add(&quot;inputs&quot;, (selector, value) =&gt; {
     cy.get(selector).each((element) =&gt; {
         cy.wrap(element).clear().type(value)
     })
  })
  
  added cy.inputs(selector) in the test.
  </code></pre>
  <p>Any suggestions on how to resolve similar issue faced is appreciated.</p>