-
Notifications
You must be signed in to change notification settings - Fork 674
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
Should click event be triggered by clicking on a disabled button? #8004
Comments
Thank you for your inquiry. This issue looks like a question that would be best asked on StackOverflow - an amazing platform for users to ask and answer questions. We try to keep the GitHub issues tracker for bugs and feature requests only (see Contributing). If you think that this issue is a bug, feel free to open a new issue, but please make sure to follow the issue template. Thank you in advance. |
Noticed this request from 2 years ago: #5240 However, should this be allowed behaviour ? Case scenario: Obviously the workaround is to assert for disabled attribute but I'm still confused if this is intended behaviour? |
TestCafe should emulate browser behavior, so a disabled button should not work. I checked this behavior, and it works as expected in the latest TestCafe version. <body>
<button disabled="disabled">click me</button>
<script>
document.querySelector('button').addEventListener('click', () => {
throw new Error('clicked');
});
</script>
</body> test(`t`, async t => {
await t.click('button');
}); Please check it on your machine and share your results. |
File a new question on StackOverflow
https://stackoverflow.com/questions/ask?tags=testcafe
The text was updated successfully, but these errors were encountered: