A simple test automation tool to demonstrate levels of automation maturity.
- Starts a Chrome browser
- Navigates to a Google URL with a specified search term
- Confirms the browser title includes the search term
- Run locally
- Parameterized tests
- Containerized testing
- Run automatically on triggers
- Run from published test container
Local system needs all of these pre-installed
- Python 3.9
- Chrome
- Chromedriver
- Docker
- Docker Hub account
- GitHub account
- Download repository
- Enter a terminal window
- Navigate to the repository root directory
- Install requirements:
pip install -r requirements.txt
- Run test:
pytest -m local
- Level 1 steps
- (optional) Set or unset environment variables for 1 or more of:
- BASE_URL : URL to search engine
- SEARCH_TERMS : Comma separated list of search terms
- Run test:
pytest -m parameterized
- Level 2 steps
- Build the image from Dockerfile:
docker build -t tm21 .
- Run the docker container:
docker run -e SEARCH_TERMS -e BASE_URL tm21 "-m dockerized"
- Place code in a GitHub origin repository
- (optional) Configure
./.github/test_on_push.yml
env parameters - Perform a
Push
operation to origin repository
- Level 4 steps
- Log into GitHub web interface
- Select "Actions" options
- Select "Run tests in published docker image" workflow
- Select "Run workflow" dropdown
- (optional) configure the search terms
- Click "Run workflow" button
These batch files perform local testing
-
testlocal.bat : run local tests
-
testparam.bat : run parameterized tests
-
These batch files perform common docker commands for the repo
-
build.bat : builds the docker image locally
-
run.bat : runs the local docker image
-
open.bat : runs the local docker image and enters it in a shell
-
pull.bat : pulls the published docker image from Docker hub