-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'hasAttribute' method to DomNodeState #1045
Comments
We have await t.expect(element.hasAttribute('attr')).ok() can be easily replaced with await t.expect(element.getAttribute('attr')).ok() /cc @miherlosev @DevExpress/testcafe |
It will not work then attribute value equals ''. <div class="fade"></div>
...
<div class=""></div> |
why not await t.expect(element.hasClass('fade')).ok() ? |
but possible you are right because it doesn't work for an element like <div contenteditable /> |
More <input type="text" name="lname" disabled> |
ok, I'm agree) |
Just why not to compare with void 0? |
Yes, we can check a returned value. Example <input type="text" name="lname" test="" disabled>
.expect(input.getAttribute('wrong')).eql(null)
.expect(input.getAttribute('disabled')).eql('') //attribute without value returns ''
.expect(input.getAttribute('test')).eql('')
versus
.expect(input.hasAttribute('wrong')).notOk()
.expect(input.hasAttribute('disabled')).ok()
.expect(input.hasAttribute('test')).ok() |
This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow. |
…#1403) * Add selector hasAttribute method (closes DevExpress#1045) * Fix callsite
No description provided.
The text was updated successfully, but these errors were encountered: