I would like to count the number of elements in the dom that are checked
Example :
cy.get('.p-multiselect-item .p-highlight').its('length');
I would like to count the number of elements in the dom that are checked
Example :
cy.get('.p-multiselect-item .p-highlight').its('length');
You are using p-multiselect-item as a class (leading dot) but actually it's a tag.
Try
cy.get('p-multiselect-item .p-highlight') // find <p-multiselect-item>
// with children having class p-highlight
.its('length')
.should('eq', 2)
Have you tried this :
cy.get('@groupSelect').children('option').length
if not you have some answer here : How to count DOM elements in Cypress assertion