I am using testcafe version - 1.6.1
I am trying to apply an assertion to see if an element is clickable or not (expect to not be clickable).
I've found the elements class name and a dynamic sibling class which appears to not be clickable in the browser element.
I've attached two snapshots below of the actual UI element and its DOM:
The element in the UI I want to detect
chrome dev-tools Elements
for some unknown reason, the hasclass
function keeps failing because the required class cannot be found.
.expect()buttonEssentialplan30Mb.hasClass('.c-form-plan-box--disabled')).ok()
The correct code for your scenario is
await t.expect(buttonEssentialplan30Mb.hasClass('c-form-plan-box--disabled')).ok()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With