How to test your Analytics events with AssertionHub QA?
Getting started with our platform
Table of Contents
Prerequisites
- Install AH Debugger chrome extension
Your first validation
- Click on the extension icon, if you didn’t pin it before, you might need to click on the “puzzle” icon close to the website address bar top of your browser to find the icon
- Click on the button “Start Session”
- Browse your website as you’ll normally do to trigger all the events and DataLayer push
- When done, click again on the extension icon and click “Send to Assertion Hub QA”
- You have your events validated by our built-in tests
Your first Custom Test
If the built-in validations are not enough you can create ad-hoc tests and triggers to test your analytics events.
- First you’ll need to create a trigger. A trigger is the entity that will be needed by your tests to understand when to run. You can setup any kind of rule in your trigger, you’re not limited by event name. Follow this guide to create a trigger
- Once you have a trigger created, you can start creating your test. We suggest to start creating a test from a request. Follow this guide to create a test
- Once your have your validation entities in place, refresh the page or click on “Revalidate” and you will see your tests applied to the requests.
- Click on a request and you will see a button “View Custom Checks”, click on it to see Test and Trigger specifications
Your first Automated QA workflow on Google Chrome
- Visit your website and open developer tools right-clicking anywhere on the screen and selecting “Inspect”
- This will open Chrome developer tools. On top of this panel, select “Recorder” - This is a Recorder offered by Google Chrome itself
- Click on “Create a new recording” and give a name to the recording
- Click on the bottom of the panel on Start recording, navigate your website, the browser will record your session so you can use it later on
- Once you’re done with it, export it as JSON clicking on the top of the panel, close to the recording name, on the “export icon” and choose JSON as export format
- Now, everytime you want to repeat the recorded session, make sure you click on the extension icon and click “Start session” having “Refresg page after starting session” unticked
- This will start the data collection. Now, if the recording is still in your Chrome Recorder Panel, click on “replay”, otherwise import the previously saved JSON file
- Chrome will automatically replay the steps you recorded before and in the meantime the extension will collect analytics requests. When you’re done with the replay click on “Send to AssertionHub QA”
- And you’re done. You can now perform regression tests in seconds every time new code is deployed.