We have ASP.Net Core MVC microservice and want to add automated UI tests using PlayWright.
.
PlayWright tests should be in the same repository and tests should be run as a part of CI before the application will be deployed.
To run the PlayWright tests we need to start the microservice locally on the build server and tests should run on url e.g. http://localhost:5000.
Is it possible to do in a single dockerfile invoked from GitHub actions?
Or it has to be done as multiple GitHub actions steps:
1. Build docker image of Asp.net web site
2. Run the image locally on CI build server on the local port, e.g.http://localhost:5000
3. Build and run PlayWright project with the tests against http://localhost:5000 url.
PlayWright documentation https://playwright.dev/dotnet/docs/ci-intro#on-pushpull_request only shows how to Build and run PlayWright project, not how to start the website under the test
I found the article Elevate Your CI/CD: Dockerized E2E Tests with GitHub Actions that describes multi-step approach, but for different technologies – “express-app” and “react-app” containers
Can anyone give recommendations/ suggest an example for ASP.Net Core site and PlayWright c# tests to be run using GitHub actions and docker?