Frequently Asked Question

Video: 6.4.4 Report enhancement and customization
Last Updated 3 years ago


Press "Ctrl + F" to find the keyword of your interest.

If you wish to have a direct link access to the video timestamps, please follow these instructions.

Found this video helpful? Why not take the whole HIL Specialist course? A Certificate is waiting for you for free at HIL Academy.

Would you or your organization benefit from having these videos narrated in your native language? Contact us and let us know if you wish to contribute.

TRANSCRIPT

00:00:01

Hello and welcome to our fourth lesson on Typhoon Test. In this lesson, we will be continuing  

00:00:07

with our test script, and show some report enhancement and customization functionalities. 

00:00:13

Let s start by increasing the number of tests to 7 speed references and 3 loads.  

00:00:17

Here we can use the numpy linspace function to create 7 equidistant points between 700 and 1000. 

00:00:25

The first feature is to organize the report messages.  

00:00:28

Let s scroll down to the section where we find the step change, and group these  

00:00:32

steps with the report step function from the already imported messages library.  

00:00:36

This function is used with the with statement. All the messages generated inside this statement  

00:00:41

will be grouped in the report. Let s also change the report message for this step.

00:00:56

Now, let s store some data from the tests to create images and tables. There are several  

00:01:01

ways to do it, here we will be appending data to a Dataframe passed by a fixture and retrieving it  

00:01:06

in a future test. This strategy can be also used to store data from tests in different modules.

00:01:28

Don t forget to add the summary data fixture as an argument of test tracking .

00:01:39

Let the summary data Dataframe store the setting time from the  

00:01:42

step result , using the speed reference as the index and the load as the column.

00:02:10

Now, let s create another test to use this data to create a table and a custom plot in the report.

00:02:22

Just as before, we can save this data for offline use. 

00:02:35

First, we will explore how to include a table in the report.  

00:02:38

For that, let s use the function attach_table_custom_colormap . More  

00:02:43

details about this function can be found in the Documentation Hub, under the reporting tables.

00:03:05

Let s provide the summary_data data frame as table content,  

00:03:09

350 milliseconds as the pass/fail threshold to color the table, a title, and a caption. 

00:03:32

Now, we will explore how to include figures.  

00:03:36

Let s start with the TyphoonTest attach_figure function.

00:03:47

We can create a function to display the same image with different time scales, for example.  

00:03:52

Let s create a plot function with the data frame, the signals to plot, and zoom as arguments.

00:04:58

Here we are using list comprehension to create a list of Dataframes based on the  

00:05:02

desired arrangement of the signals to be plotted.  

00:05:05

Now, let s add this function to our test, specifying the desired signals for  

00:05:10

each subplot and time interval. We will put this just before we begin with our assertions.

00:05:50

The reporting functionalities presented so far are built upon Allure. Hence, you can  

00:05:55

also improve the report by yourself by searching the Allure functions and adding them manually.  

00:06:00

Let s showcase this by creating and adding a custom plot in the report.  

00:06:04

Let s start by creating a custom_plot function to plot the settling time from summary_data .

00:06:13

Let s import Allure to add an image to the report and I O to create the temporary file to store the  

00:06:18

figure. For the plot, let s place the settling time in the Y axis and the speed in the X axis,  

00:06:24

saving it into the temporary file and attaching it to the Allure report. 

00:07:16

Now we will include this function alongside the table, under the test_summary function,  

00:07:20

so that the images will be presented in the report

00:07:34

Finally, let s run the test and check the report improvements.

00:07:50

In the report, from the 22 tests, we have 12 passes and 10 fails. Let s open one of  

00:07:56

them and see our enhancement changes.The first functionality was to group all  

00:08:00

messages relating to finding the event. This is a way to make the report more concise, hiding  

00:08:05

some information under this dropdown messages and highlighting more relevant information.

00:08:11

Let s now take a look at the plots inside the main test. Just as specified in the signal list,  

00:08:16

they are divided into subplots, matching relevant variables together. In the first subplot we have  

00:08:22

the measured speed and the step reference, the second one the three phase currents,  

00:08:26

and in the third one the measured current, the filtered current, and the RMS value. 

00:08:31

The second plot has the same configuration, but just for the last 100 milliseconds of the capture.  

00:08:37

Here we can see in more detail how the three currents behave,  

00:08:40

and we can compare the filtered and original values.

00:08:44

Finally, let s have a look at the summary. This is where we added the table and the custom plot. 

00:08:50

The darker the color, the further away from the 350 millisecond threshold it is.  

00:08:55

The green values are below the threshold and the red ones are above it.

00:09:02

At last, we can check our custom plot with the same information from the table,  

00:09:07

but in a different format.In this lesson we learned  

00:09:10

how to enhance our report, by grouping information, adding tables and figures.  

00:09:15

In our final lesson on Typhoon Test, we will run the tests with different environments,  

00:09:20

add default options to run the test, and execute it from the command line.

00:09:28

Thank you for watching!

Please Wait!

Please wait... it will take a second!