Here's some initial thoughts on the end to end integration testing. I've used Playwright which is a really nice framework from the chaps at Microsoft I believe (https://playwright.dev/dotnet/docs/why-playwright).
I've put 2 applications (BlazorCocoon + Wingtips) into docker for windows and then stand them up using a docker compose file that's in the root directory, if the images aren't available etc. it'll build them. You must be using the windows version of docker!. This approach also makes it easier to outboard new developers without much local setup, it'll also work on the build servers in the future.
Once the images are running I've put a basic integration test project into the main solution file that checks basically functionality such as:
A modern app serving a page.
Falling back to the cocooned application.
Auth
Session coming soon :-)
You'll notice that I've deleted a load of the old database stuff from the blazorcocoon application for the following reasons:
DB access isn't really part of the core problem space and it was causing issues. I removed it as the functionality around Cocoon can be tested without. If DB really was part of this I think you'd put an API over the top anyway for data ownership reasons among other things.
The test application uses localdb which isn't available off box.
I've made the changes in such a way that you should be able to run the apps natively or in docker when playing around with integration tests without the need for a developer to remap ports etc. Either start the apps from your IDE etc. or run docker-compose up.
If you're happy with the approach, I'll add more endpoints for Blazor Server and MVC Core (They'll just run on different ports in docker) and we should have full end to end tests for all platforms.
I've aligned the base docker images to what's available precached on the github build servers so we should be able to run these as part of a PR in the future if you so desire.
Hope you're happy with the direction! Any feedback greatly appreciated.
Hi @markrendle,
Here's some initial thoughts on the end to end integration testing. I've used Playwright which is a really nice framework from the chaps at Microsoft I believe (https://playwright.dev/dotnet/docs/why-playwright).
I've put 2 applications (BlazorCocoon + Wingtips) into docker for windows and then stand them up using a docker compose file that's in the root directory, if the images aren't available etc. it'll build them. You must be using the windows version of docker!. This approach also makes it easier to outboard new developers without much local setup, it'll also work on the build servers in the future.
Once the images are running I've put a basic integration test project into the main solution file that checks basically functionality such as:
You'll notice that I've deleted a load of the old database stuff from the blazorcocoon application for the following reasons:
I've made the changes in such a way that you should be able to run the apps natively or in docker when playing around with integration tests without the need for a developer to remap ports etc. Either start the apps from your IDE etc. or run docker-compose up.
If you're happy with the approach, I'll add more endpoints for Blazor Server and MVC Core (They'll just run on different ports in docker) and we should have full end to end tests for all platforms.
I've aligned the base docker images to what's available precached on the github build servers so we should be able to run these as part of a PR in the future if you so desire.
Hope you're happy with the direction! Any feedback greatly appreciated.