VisualReCode / Cocoon

An implementation of the Strangler Fig pattern for ASP.NET Core
Apache License 2.0
62 stars 10 forks source link

Feature/integration testing #15

Closed TheRubble closed 3 years ago

TheRubble commented 3 years ago

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.