glamorous-potato-68078
12/13/2022, 1:56 PMwitty-van-98092
12/15/2022, 10:30 AMclick({multiple: true})
doesn't seems to work:
If we do:
typescript
// before Cypress 12, this line was closing all notifications
cy.getNotificationsQuery().click({ multiple: true });
we got the error:
console
We initially found matching element(s), but while waiting for them to become actionable, they disappeared from the page. Common situations why this happens:
- Your JS framework re-rendered asynchronously
- Your app code reacted to an event firing and removed the element
You can typically solve this by breaking up a chain. For example, rewrite:
> cy.get('button').click().click()
to
> cy.get('button').as('btn').click()
> cy.get('@btn').click()Learn more
indeed, the click will remove one element and the second click complain. So we modified the code to have:
typescript
cy.getNotificationsQuery().as('notifs').click();
cy.get('@notifs').click()
we got the error:
console
cy.click() can only be called on a single element. Your subject contained 2 elements. Pass { multiple: true } if you want to serially click each element.Learn more
Endless story 😄fresh-doctor-14925
12/15/2022, 11:14 AMhigh-raincoat-69564
12/15/2022, 5:22 PM--group
Since one group on a CI job can cancel another one, it reduces the value of "Rerun workflow from failed"best-flower-17510
12/15/2022, 5:37 PMhigh-raincoat-69564
12/15/2022, 5:37 PMmagnificent-finland-58048
12/16/2022, 2:58 PMlate-planet-4481
12/21/2022, 5:10 PMlate-planet-4481
12/21/2022, 5:12 PMrough-oxygen-26641
12/28/2022, 10:32 AMbest-flower-17510
12/28/2022, 5:18 PMproud-breakfast-29892
12/29/2022, 11:12 AMproud-breakfast-29892
12/29/2022, 11:18 AMproud-breakfast-29892
12/29/2022, 11:18 AMproud-breakfast-29892
12/29/2022, 11:31 AMthousands-house-85089
01/03/2023, 5:40 PMpowerful-orange-86819
01/06/2023, 7:55 AMbest-flower-17510
01/06/2023, 5:59 PMstocky-intern-86590
01/08/2023, 12:59 AMstocky-intern-86590
01/08/2023, 1:14 AMgray-kilobyte-89541
01/08/2023, 1:25 AMstocky-intern-86590
01/08/2023, 1:32 AMpowerful-orange-86819
01/08/2023, 9:35 AMbest-flower-17510
01/09/2023, 2:37 PMlate-planet-4481
01/11/2023, 4:35 AM.freeze()
, to precede the .as()
. If there's a better way I'm all ears.
js
Cypress.Commands.add('freeze', { prevSubject: true }, (thing) => cy.wrap(thing))
Is this really necessary? I feel like triggering full-chain retries should be more of an opt-in thing.
This makes the idea of storing values in a global object seem preferable to aliases. Yuck.full-helmet-93291
01/11/2023, 8:54 PMmagnificent-finland-58048
01/13/2023, 12:54 PMpowerful-orange-86819
01/16/2023, 8:06 AMwonderful-match-15836
01/17/2023, 2:13 AMwonderful-match-15836
01/17/2023, 2:18 AM