Adding and running an individual test
Create a test
When you want to create a new test, go to a dataset either by creating a new dataset or by selecting an existing one from the list of depots and list of datasets within a selected depot.
- Select button "+ ADD TEST".
- In case you have no tests in your dataset yet, the button "+ ADD TEST" is located below the information about the source and the dataset.
- In case you already have at least one test in your dataset, the button "+ ADD TEST" is located to the right just above the list of the included tests.
- Fill in the Test Name.
- Select all checkboxes next to the parts of test to be included in the template of the Test Logic to see the range of functionalities of tests.
- Leave the Max Score parameter on the default value, 100.
- You can edit the Code of the test for an increased identification or you can leave there the default value.
- You can add some optional description for the test.
- When you finish with configurating the first setting of the test, confirm by clicking "Create". You can edit the Test Name, Max Score, Test Code, Description fields as well as the functions included in the test later in the Test Editor window.
Test Editor
When you create a test or click on an existing test to edit it, you are in a Test Editor. Here you can modify the query for data in the Query logic, adjust the data manipulations and testing in Test logic and set the test parameters.
On the top of the page, below the navigation line, there is the summarized information about the test. To edit the Name, Score or Description, click on the three dots at the end of any of the information panels.
Below the information about the test there is a multi-functional button, allowing you to run the test:
- Run a test without saving it yet (the default option) – while editing you can check how the changes impact the results without saving the new version of the test yet
- Save the test and Run it subsequently
- Run the test in Debug mode
Below the multi-function button, there is the Query logic and Test logic specifying the test. Query logic defines the set of data used in the test, while in the Test logic the data manipulation and verification is specified. To learn more about the content of the Query logic and Test logic fields, proceed to the section describing writing of the tests.
Run a test using a template
To run a test inside the Test Editor, click on the button "Run" to run the test created from the template. When the run finishes, you can see the results in the Result box below the button.
If you checked all the options for template when creating the test and did not change the Query logic or Test logic further, you will see the following results:
- a message stating 'The total amount of sessions is ' + the total amount of sessions for last two days in the selected data
- a table showing the daily sessions in last two days (if you are using Google Analytics data) or previous week (if you are using Piano Analytics, formerly AT Internet data)
- if there are at least 3000 sessions for last two days in total, you will see the status Passed (marked with a green tick), otherwise you will see a message that there are less than 3000 sessions
- if there are less than 3000 sessions in the last two days but there are some, the status will be Warning (marked with an orange exclamation mark)
- if there are no sessions in the last two days, the status will be Failed (marked with a red x or cross)
You can adjust the threshold value for sessions from 3000 to a different positive number by changing the value on the line const sessionsWarningThreshold = 3000;
and running the test again. Try setting it above the total sessions observed in last two days to see the warning status and messages.
The resulting score depends on the result of the test. If the test output is Passed, the score is 100, for a Warning it is 80 and if the test output is Failed because there were no sessions, the resulting score is 0.