Download the PHP package phbergsmann/behat-google-analytics-extension without Composer
On this page you can find all versions of the php package phbergsmann/behat-google-analytics-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package behat-google-analytics-extension
Behat Google Analytics Extension
Prerequisites
Google Analytics Realtime API beta access
Just fill out this form and wait some time: https://docs.google.com/forms/d/1qfRFysCikpgCMGqgF3yXdUyQW4xAlLyjKuOoOEFN2Uw/viewform
A Google API Service Account
Google gives some help on that: https://developers.google.com/console/help/#service_accounts
A Google Analytics Account
Add a property for your test-domain, authorize your service Account with "Read & Analyze" permissions.
Installation and configuration
via composer add the extension
Add a dependency to
extend your behat.yml
Include the context-class
In your custom feature-context add the new context in the constructor:
If you want to use the campaign-identifier to allow concurrent testing (recommended) add these lines to your feature-context:
Start testing
Identifying the test-run
Google Analytics doesn't have the possibility to identify users (by giving them some retrievable ID). To bypass this limitation the extension adds the possibility to "tag" a testrun by injecting campaing-tracking parameters. Tests run perfectly fine without user-tagging but when you run the same test twice within 5 minutes there is no guarantee, that the second run does not deliver a false positive because the test was working in the first run. To enable campaing tagging add the following tag to your scenario:
The extension adds the following step-definitions:
Check if the given URL has been tracked
Check if the given event was triggered
All versions of behat-google-analytics-extension with dependencies
behat/mink Version 1.4.x
behat/mink-extension Version *
behat/mink-selenium2-driver Version *
google/apiclient Version 1.0.4-beta