-
Notifications
You must be signed in to change notification settings - Fork 240
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
[Feature]: Blazor component testing #2944
Comments
Let's see if there is any interest for it. |
I would love this. I just recently adopted Blazor and can definitely see some use cases. |
@sand4rt is your concern that bUnit isn't comprehensive enough? Just trying to better understand what the big benefit would be in bringing this into Playwright? |
Playwright would be a real browser while bUnit is an emulated DOM like JSDom from my understanding. |
@thatstatsguy Because it doesn't use an actual browser, bUnit expects you to mock your JavaScript interops and won't respect certain HTML attributes in its test (i.e. it'll still be able to click a disabled button). While you can kind of get away with telling people to just confirm that those HTML attributes are there and not have them try to click a disabled button in their tests, having people mock their JavaScript isn't really possible if they're relying on that JavaScript to have non-trivial side-effects. Some examples from our own Blazor component library where we've had to use Playwright include:
|
🚀 Feature Request
Wondering if you've considered adding Playwright component testing for Blazor: https://learn.microsoft.com/en-us/aspnet/core/blazor/test?view=aspnetcore-8.0#test-components-with-bunit?
Example
or
Motivation
I'm not a Blazor user, but i think it might be interesting for the people who do?
The text was updated successfully, but these errors were encountered: