fresh-doctor-14925
12/11/2022, 9:50 AMnutritious-analyst-96582
12/11/2022, 9:50 AMrough-van-84956
12/12/2022, 5:36 AMcy.get('button').contains('Save').click()
The error is: CypressError: `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.
It works if I change it to:
cy.contains('button','Save').click()
There is only one Save button on the page and I've seen this in testing two different apps.
The original version works in 12.0.1acceptable-hamburger-48790
12/12/2022, 8:30 AMrough-van-84956
12/12/2022, 8:52 AMget
fails.
This is definitely different behaviour in 12.0.2.glamorous-potato-68078
12/12/2022, 7:58 PMlemon-holiday-89994
12/12/2022, 8:28 PMglamorous-potato-68078
12/13/2022, 10:22 AMkind-lock-48901
12/13/2022, 10:45 AM12.1.0
(from 9.6.1
) and now I’m getting the error Cannot overwite the contains query. Queries cannot be overwritten
Any idea how to fix it?gray-kilobyte-89541
12/13/2022, 12:06 PMglamorous-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 AM