summaryrefslogtreecommitdiffstats
path: root/integration-tests/src/test/java
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2021-08-03 13:02:39 +0200
committerMichael Morris <michael.morris@est.tech>2021-08-04 15:20:22 +0000
commit865af7fcb1c1af73498dedaf426ee55e9f373537 (patch)
treeff108c28ebb2d97377eca8637ceedaa918231b04 /integration-tests/src/test/java
parentfed417ad58c84e4cbfe2f6df685ba869ba1e5cc7 (diff)
Fix deleting screenshot of test suites
Issue-ID: SDC-3654 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: I820d57f798d098d4b10ae3038e1739790d4e36b4
Diffstat (limited to 'integration-tests/src/test/java')
-rw-r--r--integration-tests/src/test/java/org/onap/sdc/frontend/ci/tests/execute/setup/ExtentManager.java8
1 files 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");