< _ngcontent-c21="" color="primary" mat-="" class="mat- 
mat-primary" ng-reflect-="true" ng-reflect-color="primary" 
=""><span class="mat-button-wrapper">

The above contains and element that can enable or disable the button depending on the user rights. I’m trying to create a test to verify whether the button is active/disabled depending on the logged in user.
I’m trying to use

"expect($input).not.to.be.disabled"

but I’m not sure how to get this to work with my ‘get’ element (see below)

"cy.get('button.mat-button.mat-primary').eq(8)"



Source link https://sqa.stackexchange.com/questions/34319/how-to--a-button-is-disabled-using-

LEAVE A REPLY

Please enter your comment!
Please enter your name here