Frequently Asked Question
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.
Hello and welcome to our fourth lesson on Typhoon Test. In this lesson, we will be continuing
with our test script, and show some report enhancement and customization functionalities.
Let s start by increasing the number of tests to 7 speed references and 3 loads.
Here we can use the numpy linspace function to create 7 equidistant points between 700 and 1000.
The first feature is to organize the report messages.
Let s scroll down to the section where we find the step change, and group these
steps with the report step function from the already imported messages library.
This function is used with the with statement. All the messages generated inside this statement
will be grouped in the report. Let s also change the report message for this step.
Now, let s store some data from the tests to create images and tables. There are several
ways to do it, here we will be appending data to a Dataframe passed by a fixture and retrieving it
in a future test. This strategy can be also used to store data from tests in different modules.
Don t forget to add the summary data fixture as an argument of test tracking .
Let the summary data Dataframe store the setting time from the
step result , using the speed reference as the index and the load as the column.
Now, let s create another test to use this data to create a table and a custom plot in the report.
Just as before, we can save this data for offline use.
First, we will explore how to include a table in the report.
For that, let s use the function attach_table_custom_colormap . More
details about this function can be found in the Documentation Hub, under the reporting tables.
Let s provide the summary_data data frame as table content,
350 milliseconds as the pass/fail threshold to color the table, a title, and a caption.
Now, we will explore how to include figures.
Let s start with the TyphoonTest attach_figure function.
We can create a function to display the same image with different time scales, for example.
Let s create a plot function with the data frame, the signals to plot, and zoom as arguments.
Here we are using list comprehension to create a list of Dataframes based on the
desired arrangement of the signals to be plotted.
Now, let s add this function to our test, specifying the desired signals for
each subplot and time interval. We will put this just before we begin with our assertions.
The reporting functionalities presented so far are built upon Allure. Hence, you can
also improve the report by yourself by searching the Allure functions and adding them manually.
Let s showcase this by creating and adding a custom plot in the report.
Let s start by creating a custom_plot function to plot the settling time from summary_data .
Let s import Allure to add an image to the report and I O to create the temporary file to store the
figure. For the plot, let s place the settling time in the Y axis and the speed in the X axis,
saving it into the temporary file and attaching it to the Allure report.
Now we will include this function alongside the table, under the test_summary function,
so that the images will be presented in the report
Finally, let s run the test and check the report improvements.
In the report, from the 22 tests, we have 12 passes and 10 fails. Let s open one of
them and see our enhancement changes.The first functionality was to group all
messages relating to finding the event. This is a way to make the report more concise, hiding
some information under this dropdown messages and highlighting more relevant information.
Let s now take a look at the plots inside the main test. Just as specified in the signal list,
they are divided into subplots, matching relevant variables together. In the first subplot we have
the measured speed and the step reference, the second one the three phase currents,
and in the third one the measured current, the filtered current, and the RMS value.
The second plot has the same configuration, but just for the last 100 milliseconds of the capture.
Here we can see in more detail how the three currents behave,
and we can compare the filtered and original values.
Finally, let s have a look at the summary. This is where we added the table and the custom plot.
The darker the color, the further away from the 350 millisecond threshold it is.
The green values are below the threshold and the red ones are above it.
At last, we can check our custom plot with the same information from the table,
but in a different format.In this lesson we learned
how to enhance our report, by grouping information, adding tables and figures.
In our final lesson on Typhoon Test, we will run the tests with different environments,
add default options to run the test, and execute it from the command line.
Thank you for watching!