Search code examples
javascriptangularjsautomated-testsprotractorperformance-testing

Automated Front End Performance Testing of Single Page Angular App


I'm looking for help to automate performance test of my single page angular application. We are using protractor for E2E tests and would like to add performance tests. Our first target is to be able to measure simple timings between e.g. Button Click and finish of loading of a svg. (We have requirements that state that the load time must be less than 2 secs. So we need to assert those things.)

My first idea was to use browser-perf/ protractor-perf. Unfortunately, protractor-perf doesn't seem to work with the latest chrome version and in general browser-perf is just measuring page load times which wont change on a single page application.

My latest idea is to simply use performance.now() and measure the times 'manually'. This has the big disadvantage that it is not supported on iOS Safari. ( I need the tests to run on iPad, too.)

So my question is: Is there someone who has a good idea how I can include performance measurements into my protractor tests, measuring time intervals like the one I mentioned above?


Solution

  • The latest version of browser-perf now works with the latest version of Chrome. You should simply reinstall protractor-perf and it should start working. This was fixed recently - https://github.com/axemclion/browser-perf/issues/31.

    Also note that browser-perf also measures things like framerates, area painted, etc, which may be useful for single page apps.