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-proxy
fromhttps://github.com/lightbody/browsermob-proxy
Navigate in terminal to the catalog
Use following command to start the REST API
./browsermob-proxy -port 8887
Configuration
- Add
browsermob-proxy
configuration tokakunin.conf.js
You can use one of the following methods to configure browsermob-proxy:
npm run kakunin init -- --advanced
and go through the processor add it manually to the config file:
"browserMob": {
"serverPort": 8887,
"port": 8888,
"host": "localhost"
}
Run tests
performance steps
must be used in the scenario where you are testing performanceScenario must have a tag
@performance
Run tests with special parameter:
npm run kakunin -- --performance
Results
.har
files are saved in catalogreports/performance/*.har