I am not quite sure I am understanding the each() function right.
I have 2 "mat-card-title" elements, with both containing a label with a certain text. all of the labels and checkboxes have very bad generic id´s which switch every new visit.
So I thought:
For every mat-card-title-element, click the label containing my text.
in code my idea is:
cy.get('mat-card-title', { includeShadowDom: true })
.contains('Meine Anschrift übernehmen')
.each(($el) => {
cy.click();
Expected to find content: 'Meine Anschrift übernehmen' within the element: [
, 1 more... ] but never did. So the each-functions opens up an array I guess but I am not quite sure what to change to make it happen. Anyone maybe has an idea?