Reputation: 2582
I would like to test google analytics and see that it works properly (see that events are tracked when appropriate with the appropriate parameters, etc..). What would be the best approach to do it? Can Selenium do something like expect for certain REST calls and make sure they happened?
Upvotes: 0
Views: 3149
Reputation: 3428
You could integrate a proxy such Browsermob into your tests. This would allow you to perform actions on the web page with Selenium then query the proxy via its API to assert that the correct calls were made and with the correct values.
Here is a link explaining how to block analytics using Browsermob but should still be a good background to approach your problem;
Upvotes: 1