test results improved

This commit is contained in:
Vladimir Enchev
2016-02-24 09:51:24 +02:00
parent d8d68d3a51
commit 4d961dfb45

View File

@@ -136,10 +136,10 @@ function printRunTestStats() {
failedTestInfo.push(allTests[j].testName + " FAILED: " + allTests[j].errorMessage); failedTestInfo.push(allTests[j].testName + " FAILED: " + allTests[j].errorMessage);
testFileContent.push(`<testcase classname="classname" name="${testName}" time="${duration}"><failure type="exceptions.AssertionError">${errorMessage}</failure></testcase>`); testFileContent.push(`<testcase classname="${platform.device.os}" name="${testName}" time="${duration}"><failure type="exceptions.AssertionError">${errorMessage}</failure></testcase>`);
} else { } else {
testFileContent.push(`<testcase classname="classname" name="${testName}" time="${duration}"></testcase>`); testFileContent.push(`<testcase classname="${platform.device.os}" name="${testName}" time="${duration}"></testcase>`);
} }
} }
@@ -155,9 +155,12 @@ function printRunTestStats() {
testFileContent.push("</testsuite>"); testFileContent.push("</testsuite>");
testFileContent.push("</testsuites>"); testFileContent.push("</testsuites>");
let testFile = fs.File.fromPath(fs.path.join(fs.knownFolders.documents().path, "test-results.xml")); let testFilePath = fs.path.join(fs.knownFolders.documents().path, "test-results.xml");
let testFile = fs.File.fromPath(testFilePath);
testFile.writeTextSync(testFileContent.join("")); testFile.writeTextSync(testFileContent.join(""));
finalMessage += "\n" + "Test results: " + testFilePath;
let messageContainer = new TextView(); let messageContainer = new TextView();
messageContainer.text = finalMessage; messageContainer.text = finalMessage;
topmost().currentPage.content = messageContainer; topmost().currentPage.content = messageContainer;