Replies: 1 comment 2 replies
-
|
When using A common approach is to run separate Playwright test runs against two configurations of the app:
This ensures the UI behavior works in both rendering models. For Playwright, you can start the app with different environment settings or launch profiles (for example different In practice this is the most reliable way to catch behavior differences between server and WASM when using |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my Blazor App my components are written in a way that they can potentially run in 'InteractiveAuto' mode, i.e. be Server or wasm and talk to the back end via http clients.
While this works generally, I've found the reality to be that just because something is working on server, doesn't mean there aren't some quirks in behavior on wasm, particularly with some third party UI components that might for example, be doing a lot of JS interop. The kind of problem I might run into could be around async/await, where something will behave on server rendering, but in wasm mode, need a bit of a hacky 'await Task.Delay(5);' to kick along a bit of behavior not triggering (usually having spent too long trying variations of 'StateHasChanged()' here and there). I don't think I've found issue's in reverse, generally if it's working on wasm, it'll work on server.
Are there any recommendations on how to do automated e2e testing on Blazor with the likes of Playwright so that you know your auto components are working in both modes? And/or is there a way for a test run that you could tell the app to run all 'InteractiveAuto' components as wasm? I guess if you could do that, you could be reasonably confident(ish) that they'll behave in server mode.
In reality, I've stopped using 'InteractiveAuto' due to the above, I just run everything as 'InteractiveWebAssembly'.
I'd love to see real multi-threading on async/await with wasm, not particularly for performance reasons, but just to get more behavior parity between server and wasm.
Beta Was this translation helpful? Give feedback.
All reactions