Protractor and Performance Test
Protractor is the end to end test case runner for AngularJS. These end to end test cases can be repurposed to record performance metrics when the scenario is being run. This is a sample repository with an example of how this can be done.
Step 0 - Setup
Install all dependencies using
Step 1 - Prepare configuration
Protractor currently supports only synchronous configurations. Here is the issue asking for support of asynchronous configurations. Till this feature is added, you would need to generate a temporary configuration that would have the browser parameters required for performance analysis. Run to following command to generate
node index.js --config conf.js
Step 2 - Run Protractor Tests
Once the configration file is generated, run protractor against this using
Using it in your projects
To start using it in your projects,
- Add browser-perf to your project
- Copy index.js and use it in your test case to mark the start and stop of the scenario.
- Ensure that in your build, you generate the configuration, live done in Step 1 above.