Create a script for automated post-deploy tests
Today, we have:
- A
builderrors
script that automatically tests code statically - A
deploy
script that pushes the code to uat.gramener.com or gramener.com
We need a test
script that runs a series of automated tests on the application after deployment.
To start with, the script accepts a list of requests and conditions.
The requests must allow:
- The relative URL to check
- Optional data query parameters
- Optional HTTP request headers
- Optional session object or user object to allow for user auth
- Optional timeout for page load
The conditions must allow checking whether:
- the correct status code was returned (e.g. 200 vs 404 vs 500)
- specific HTTP headers were served (e.g.
{Content-Type: text/plain, X-NA: false, Content-Length: true}
) - specific content was served in the page
- specific content must NOT be present on the page