Performance testing
Performance testing is possible thanks to browsermob-proxy.
It saves all data from network tab (Google Chrome console) which is generated during the test.
There is a possibility to compare TTFB value with a maximum given one.
TTFB (Time to first byte) measures the duration from the client making an HTTP request to the first byte of a response being received by the client's browser.
More details can be found in documentation - Built-in steps section.
What needs to be done?
Get started
Download
browsermob-proxyfromhttps://github.com/lightbody/browsermob-proxyNavigate in terminal to the catalog
Use following command to start the REST API
./browsermob-proxy -port 8887
Configuration
- Add
browsermob-proxyconfiguration tokakunin.conf.js
You can use one of the following methods to configure browsermob-proxy:
npm run kakunin init -- --advancedand go through the processor add it manually to the config file:
"browserMob": {
"serverPort": 8887,
"port": 8888,
"host": "localhost"
}
Run tests
performance stepsmust be used in the scenario where you are testing performanceScenario must have a tag
@performanceRun tests with special parameter:
npm run kakunin -- --performance
Results
.harfiles are saved in catalogreports/performance/*.har