Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
phuthanhta committed Jan 26, 2018
2 parents a47ed14 + 542a1db commit 1aee50f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class AutomationTestResult {
private String automationContent;
private String status;
private String name;

private Integer order;
@JsonProperty("test_step_logs")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<AutomationTestStepLog> testLogs;
Expand Down Expand Up @@ -125,6 +127,14 @@ public void setBuildURL(String buildURL) {
this.buildURL = buildURL;
}

public Integer getOrder() {
return order;
}

public void setOrder(Integer order) {
this.order = order;
}


/**
* Add testLog and resolve status of testResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static List<AutomationTestResult> toAutomationTestResults(ParseRequest re
private static List<AutomationTestResult> useTestMethodAsTestCase(ParseRequest request, List<TestResult> testResults, Date startTime)
throws Exception {
Map<String, AutomationTestResult> map = new HashMap<>();
int currentTestLogOrder = 0;

for (TestResult testResult : testResults) {
for (SuiteResult suite : testResult.getSuites()) {
Expand All @@ -67,6 +68,7 @@ private static List<AutomationTestResult> useTestMethodAsTestCase(ParseRequest r

if (!map.containsKey(automationContent)) {
AutomationTestResult testLog = new AutomationTestResult();
testLog.setOrder(currentTestLogOrder++);
testLog.setAutomationContent(automationContent);
testLog.setExecutedStartDate(startDate);
testLog.setExecutedEndDate(computeEndTime(startDate, caseResult.getDuration()));
Expand Down Expand Up @@ -103,6 +105,7 @@ private static List<AutomationTestResult> useTestMethodAsTestCase(ParseRequest r
private static List<AutomationTestResult> useClassNameAsTestCase(ParseRequest request, List<TestResult> testResults, Date startTime)
throws Exception {
Map<String, AutomationTestResult> map = new HashMap<>();
int currentTestLogOrder = 0;

for (TestResult testResult : testResults) {
for (SuiteResult suite : testResult.getSuites()) {
Expand All @@ -117,6 +120,7 @@ private static List<AutomationTestResult> useClassNameAsTestCase(ParseRequest re
testLog = map.get(caseResult.getClassName());
} else {
testLog = new AutomationTestResult();
testLog.setOrder(currentTestLogOrder++);
testLog.setAutomationContent(caseResult.getClassName());
testLog.setExecutedStartDate(startDate);
testLog.setExecutedEndDate(computeEndTime(startDate, suite.getDuration()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ label.class_mode=Each JUnit Test Suite (class) = a qTest Test Case
label.method_mode=Each JUnit Test Case (method) = a qTest Test Case
label.releaseOption = Submit test result to a Release as settings in your qTest Manager
label.existingContainerOption = Submit test results to an existing container
label.overwriteExistingTestSteps = Overwrite existing test steps and test step logs
label.overwriteExistingTestSteps = Overwrite existing test steps
label.container = Container
label.checkedNewTestRuns = Create new Test Runs every build date
instruction.testLog= * Test Logs submitted to qTest will be associated with the target Release
Expand Down

0 comments on commit 1aee50f

Please sign in to comment.