When I click a button via cy.get(‘#numberOfFetusOne’).click() its class changes to selected
How can I validate this change of the class. If I try to get a class with cy.get I get an error: Expected to find element: gpx-16 i1-regular gpu-selected, but never found it.
<gpu-button-option _ngcontent-udx-c111="" id="numberOfFetusOne" value="Singleton" class="gpx-16 i1-regular" _nghost-udx-c95=""> 1 </gpu-button-option>
1
Thanks in advance,
Robert
>Solution :
You can add a should assertion for this.
cy.get('#numberOfFetusOne').should('have.class', 'gpu-selected')