Share via

Integration test with Blazor WASM

Bence Mihucza 1 Reputation point
2022-09-18T07:33:06.28+00:00

Hi All,

Is there any possibilities to do integration tests with Blazor WASM application similar to .NET Core application?
I mean this kind of integration tests:
https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0

Would be great if the whole stack would not have to be started for E2E tests.

Sorry if it is a noob question, I don't have too much experience on frontend side.

Thank you in advance.

Developer technologies | .NET | Blazor
0 comments No comments

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,086 Reputation points
    2022-09-18T15:26:47.317+00:00

    No, it will not work with blazor, because blazor is either hosted in the browser (WASM), or is a signalr connection that returns undocumented tokens.

    You need to a browser testing framework like Selenium

    https://www.selenium.dev/

    Note: you could test the webapi of the server with the integration test library

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.