I want to wait until the second of two elements to appear before performing an action on it. Currently, I have this:
cy.get('[data-test="insert-item"]').click();
cy.get('[data-test="textarea"]').eq(1).type('Hello').type('{enter}');
This currently fails. I'm assuming this is because Cypress is going to collect all the occurrences of textarea, then try to select the second one before it has actually rendered on the page (because of the async request that creates it). If I add cy.wait(2000); in between these two lines it passes.
Is there any way to do this without using cy.wait(2000), so that it specifically waits until the second item has appeared?