Custom Validations - How to create a test

The different ways you can create a test

Table of Contents

Prerequisites

  • Assertion Hub QA Account. You can create it for Free

How to create a Test?

There are 2 ways to create a test:

  • Create a test from scratch
  • Create a test from “an existing request”

Create a test from scratch

  • Click on “Entities” in the navbar. Here you will see all your tests and tests.
  • To create a new triger click on the button “Create Test”
  • Select the vendor this test should check (e.g. GA4, Google Tag Manager, etc…)
  • Ensure under Select Creation Mode you have “Create Test only”
  • Give a name and description to your test and select the Logical Operator. This will adjust the check on metrics, “OR” means if any of the selected metrics evaluates to true and “AND” means all the selected metrics have to evaluate to true
  • Click on add metric and write in the Metric Path. You can use as test a metric in an object like pr1.item_name or the object itself or a normal metric like “en” for GA4 event name.
  • If your metric is present in multiple object, e.g. writing item_name, will check item_name for all its occurrences. Then if you have 20 products, the metric will be checked against all products. If you want to test only 1 specific metric, then you need to write it as pr2.item_name
  • Once you’re done with the metrics you can decide to associate this test to a test. Which means: IF the test metrics conditions will evaluate to true, then fire the associated tests
  • Click on Create Test

Create Test from request

  • When you run a Validation using our AH Debugger extension, you will see the collected requests in Assertionhub QA. To know more about your first Validation. Click here
  • If you click on a request, you will see a button bottom-left with “Create Test from Request”
  • Once you click it you will see a prefilled “Create Entity” Panel with the vendor already chosen and all the metrics belonging to that request for you to choose which one to validate.
  • You can, in one shot, create a test and a test at the same time. For this guide we’ll create just a test then under “select creation mode select “create test only”
  • After you name your Test and give a description if needed, select the Logical Operator. This will adjust the check on metrics, “OR” means if any of the selected metrics evaluates to true and “AND” means all the selected metrics have to evaluate to true
  • Now you can select the test metrics. Once you choose a metric you want to use in your test, tick the box under the first column on the left “Test”
  • You can test any type of metric. A specific event parameter inside or outside an object or even the object itself.
  • If you want to test your metric for all its occurrences ( e.g. check item_id for all GA4 items) click “Global” on the left of the Metric Row.
  • Once you’re done with the metrics you can decide to associate this test to a Trigger. Which means: IF the test metrics conditions of the trigger will evaluate to true, then fire the associated tests (including this one you’re associating with the trigger)
  • Click on Create Test
Powered by beluacode Logo