From 865af7fcb1c1af73498dedaf426ee55e9f373537 Mon Sep 17 00:00:00 2001 From: Tomasz Wrobel Date: Tue, 3 Aug 2021 13:02:39 +0200 Subject: Fix deleting screenshot of test suites Issue-ID: SDC-3654 Signed-off-by: Tomasz Wrobel Change-Id: I820d57f798d098d4b10ae3038e1739790d4e36b4 --- .../onap/sdc/frontend/ci/tests/execute/setup/ExtentManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/ExtentManager.java b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/ExtentManager.java index ed3c2335f3..1d515da14a 100644 --- a/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/ExtentManager.java +++ b/integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/ExtentManager.java @@ -3,6 +3,7 @@ * SDC * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2021 Nokia Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +27,8 @@ import com.aventstack.extentreports.reporter.ExtentXReporter; import com.aventstack.extentreports.reporter.configuration.Protocol; import com.aventstack.extentreports.reporter.configuration.Theme; import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; @@ -108,8 +111,9 @@ public class ExtentManager { String suiteNameFromVersionInfoFile = FileHandling.getKeyByValueFromPropertyFormatFile(filepath + VERSIONS_INFO_FILE_NAME, "suiteName"); reporterDataDefinition(onboardVersion, osVersion, envData, suiteNameFromVersionInfoFile); } else { - FileHandling.deleteDirectory(SetupCDTest.getReportFolder()); - FileHandling.createDirectory(filepath); + if (!Files.exists(Paths.get(filepath))) { + FileHandling.createDirectory(filepath); + } setReporter(filepath, htmlFile, false); Calendar calendar = new GregorianCalendar(); SimpleDateFormat formatter = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a"); -- cgit 1.2.3-korg