Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syntapy/test-driven-web-app-template
Template Repo: Dockerized screenshot tests for web app
https://github.com/syntapy/test-driven-web-app-template
cypress end-to-end-testing frontend playwright test-automation webapp
Last synced: 3 days ago
JSON representation
Template Repo: Dockerized screenshot tests for web app
- Host: GitHub
- URL: https://github.com/syntapy/test-driven-web-app-template
- Owner: syntapy
- Created: 2024-12-04T19:40:03.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-23T18:01:10.000Z (about 1 month ago)
- Last Synced: 2024-12-23T19:20:06.539Z (about 1 month ago)
- Topics: cypress, end-to-end-testing, frontend, playwright, test-automation, webapp
- Language: Shell
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Intro
Boilerplate to run web app and automated browser test client in separate docker containers
Also provides github actions workflow template
## Motivation
For me, screenshot tests don't match locally with Github Actions. But I am also on a non-standard OS (Qubes OS) which runs linux using Xen hypervisor, so that may be why
I'm doing this to make it easy for me to start a new web app project with reliable test driven functionality
Test driven development is nice and fun to have, and makes refactoring a breeze.
As such I want to make this the core of my development habit as I learnThis tries to help get rid of the tedium of setting up automated testing
Docker is used to make screenshot tests reliable across different machines, e.g. the local dev environment and CI tests in the cloud
It probably won't help with enabling exact screen renderings across different CPU architectures though, from what I've read online, but I don't have experience to say that definitively
# Usage
This is tested in Linux. I have no idea if it may work in Windows
### Installation
This needs Docker installed so that there is access to `docker` and `docker compose`
### Setup
- Specify image and docker repository names for your app and test client in the `docker/.env` file, as indicated by the `docker/env_example` file
- Web app code goes in `app/` dir, and test client goes in `test/` dir. Maybe best to use submodules for those? Idk...
- Environment for your app is specified in `docker/Dockerfile.app`
- Environment for your test client is specified in `docker/Dockerfile.test`### Running
The shell scripts to run the app are in `bin` folder
- Run web app with `./bin/up_app` from repository root dir
- Can use options to set entrypoint and command for web app container
- Run `./bin/up_app -h` for usage
- In separate terminal run test client shell with `./bin/run_test`
- This allows you to run `npm` commands there directly