diff --git a/OpenTap.Python.Examples/CsvResultListener.py b/OpenTap.Python.Examples/CsvResultListener.py index e5bc556..dd02c6c 100644 --- a/OpenTap.Python.Examples/CsvResultListener.py +++ b/OpenTap.Python.Examples/CsvResultListener.py @@ -63,6 +63,11 @@ def OnTestPlanRunCompleted(self, planRun, logStream): # Then write to the file. System.IO.File.WriteAllText(fileName, self.sb.ToString()) + + # Publish the csv file as an artifact. This feature is a available from OpenTAP 9.22.0 + if hasattr(planRun, "PublishArtifact"): + planRun.PublishArtifact(fileName) + except Exception as e: self.log.Debug(e)