- Usage: ./webspeedtest microsite.bats http://your-url.tld/somepage
Bash script to initiate TAP compliant web performance metrics testing to be easily integrated with Jenkins or Travis CI
For potential integration with Jenkins, check out this plugin.
All names for tests & their variables are derived from JSON object names used by Phantomas for consistency.
To create a new testable metric, find its respective JSON object name in the Phantomas documentation.
Then add it to the array of test metric names within "Metrics_to_analyze" in this script and create a test, using its name as the variable containing the testable value, for it in "performance-tests.bats".
Example - testing that the time to first byte is less than 200ms:
- performance-tests.sh:
Metrics_to_analyze=('timeToFirstByte' '...' '...' '...')
- performance-tests.sh:
@test "Time to first byte" {
[ "$timeToFirstByte" -lt 200 ]
}