Icon

03.Generating_​Unit_​Test_​Report - Exercise

Generating Unit Test Report

In this exercise you'll learn how to execute testflows that correspond to different unit tests and concatenate their execution information into a report.

Session 1 - Preparing to Deploy a WorkflowExercise 03.Generating_Unit_Test_ReportIn this exercise you'll learn how to execute testflows that correspond to different unit tests and concatenate their execution informationinto a report. Step 2. Execute the testflows and import their status and metadata. Here, we'll loop overthe list of unit tests executing them one by one and capturing their execution information.1 - Drag Call Workflow Service node to this part of the workflow and drop it between nodesPath to String (Variable) and Column Resorter.2 - Connect the output port of the Path to String (Variable) to the upper left part of the CallWorkflow Service node, such that you can see that it connected to one of its flow variables.3 - Configure the Call Workflow Service node to read the first workflow in the ../Unit_Testfolder and click 'Adjust node ports'. Then go to the Flow Variables tab and set flow variable'workflow' as 'Path_'. This node will then execute the unit test associated to the filename invariable 'Path_', which changes as the loop iterates over the list of unit tests.4 - Connect the output port of the Call Workflow Service node to the input port of the ColumnResorter node. Execute the whole workflow and check the created PDF report in the locationdesignated in the Table to PDF node at the end of the workflow. Prepare the PDF report. The status of the testflow is 0 in the case of success and 1 inthe case of failure. Let's add some colors to the report and replace these plain numberswith a red and a green square images respectively. Step 1. Get a list of unit tests togenerate a report from.1 - Drag List Files/Folders to this partof the workflow.2 - When configuring the node, set'Read' options as 'Relative to' and'Current workflow', 'Mode' as 'Files infolder', and 'Folder' as '../Unit_Tests/'.3 - Connect the output port of this nodeto the input port of the Table Row toVariable Loop Start node. Create thetestflow reportExecution dateCreate pathFilename + execution dateReplace plainexecution statuswith the colorRead status dictionarywith imagesBeautify forthe reportIterate overtestflow namesConcatenate resultsConvert path to stringMake sure reportcolumns are alwaysin the same orderTable to PDF Date&TimeConfiguration Create File/FolderVariables String Manipulation(Variable) Cell Replacer Table Reader Table Manipulator Table Row ToVariable Loop Start Loop End Path to String(Variable) Column Resorter Session 1 - Preparing to Deploy a WorkflowExercise 03.Generating_Unit_Test_ReportIn this exercise you'll learn how to execute testflows that correspond to different unit tests and concatenate their execution informationinto a report. Step 2. Execute the testflows and import their status and metadata. Here, we'll loop overthe list of unit tests executing them one by one and capturing their execution information.1 - Drag Call Workflow Service node to this part of the workflow and drop it between nodesPath to String (Variable) and Column Resorter.2 - Connect the output port of the Path to String (Variable) to the upper left part of the CallWorkflow Service node, such that you can see that it connected to one of its flow variables.3 - Configure the Call Workflow Service node to read the first workflow in the ../Unit_Testfolder and click 'Adjust node ports'. Then go to the Flow Variables tab and set flow variable'workflow' as 'Path_'. This node will then execute the unit test associated to the filename invariable 'Path_', which changes as the loop iterates over the list of unit tests.4 - Connect the output port of the Call Workflow Service node to the input port of the ColumnResorter node. Execute the whole workflow and check the created PDF report in the locationdesignated in the Table to PDF node at the end of the workflow. Prepare the PDF report. The status of the testflow is 0 in the case of success and 1 inthe case of failure. Let's add some colors to the report and replace these plain numberswith a red and a green square images respectively. Step 1. Get a list of unit tests togenerate a report from.1 - Drag List Files/Folders to this partof the workflow.2 - When configuring the node, set'Read' options as 'Relative to' and'Current workflow', 'Mode' as 'Files infolder', and 'Folder' as '../Unit_Tests/'.3 - Connect the output port of this nodeto the input port of the Table Row toVariable Loop Start node. Create thetestflow reportExecution dateCreate pathFilename + execution dateReplace plainexecution statuswith the colorRead status dictionarywith imagesBeautify forthe reportIterate overtestflow namesConcatenate resultsConvert path to stringMake sure reportcolumns are alwaysin the same orderTable to PDF Date&TimeConfiguration Create File/FolderVariables String Manipulation(Variable) Cell Replacer Table Reader Table Manipulator Table Row ToVariable Loop Start Loop End Path to String(Variable) Column Resorter

Nodes

Extensions

Links