Skip to content

Commit d99b5a1

Browse files
Merge pull request #43 from testsigmahq/dev
v1.5.0 Release
2 parents 75a1a73 + 1589131 commit d99b5a1

File tree

155 files changed

+6662
-1087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+6662
-1087
lines changed

agent/src/main/resources/agent.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
cloud.url=${CLOUD_URL:https://local.testsigmaos.com}
1010
local.server.url=${LOCAL_SERVER_URL:http://localhost:9090}
1111
local.agent.register=${LOCAL_AGENT_REGISTER:true}
12-
agent.version=1.3.0
12+
agent.version=1.5.0

server/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<google-guava-version>31.0.1-jre</google-guava-version>
5050
<one-login-saml-version>2.4.0</one-login-saml-version>
5151
<spring-data-jpa-version>2.5.2</spring-data-jpa-version>
52+
<poi.version>3.15</poi.version>
5253
<!-- <hibernate-validator-version>7.0.2.Final</hibernate-validator-version>-->
5354
<hibernate-validator-version>6.0.17.Final</hibernate-validator-version>
5455
<hibernate.version>5.5.6.Final</hibernate.version>
@@ -184,7 +185,24 @@
184185
<version>${httpmime.version}</version>
185186
</dependency>
186187

188+
<dependency>
189+
<groupId>org.apache.poi</groupId>
190+
<artifactId>poi</artifactId>
191+
<version>${poi.version}</version>
192+
</dependency>
187193

194+
<dependency>
195+
<groupId>org.apache.poi</groupId>
196+
<artifactId>poi-ooxml</artifactId>
197+
<version>${poi.version}</version>
198+
<exclusions>
199+
<!-- Exclude Commons Logging in favor of SLF4j -->
200+
<exclusion>
201+
<groupId>xml-apis</groupId>
202+
<artifactId>xml-apis</artifactId>
203+
</exclusion>
204+
</exclusions>
205+
</dependency>
188206

189207
<dependency>
190208
<groupId>com.amazonaws</groupId>

server/src/main/java/com/testsigma/constants/MessageConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class MessageConstants {
2222
"test machine. Please publish your addon before running in cloud machines.";
2323
public static final String BACKUP_IS_IN_PROGRESS = "Backup is in progress";
2424
public static final String BACKUP_IS_SUCCESS = "Backup is completed";
25+
public static final String IMPORT_IS_IN_PROGRESS = "Import is in progress";
26+
public static final String IMPORT_IS_SUCCESS = "Import is completed";
2527
public static String TEST_PLAN_COMPLETED = "Test plan execution completed";
2628
public static String TEST_PLAN_FAILURE = "Test plan execution failed";
2729

server/src/main/java/com/testsigma/controller/BackupDetailsController.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.springframework.data.web.PageableDefault;
2525
import org.springframework.http.HttpStatus;
2626
import org.springframework.web.bind.annotation.*;
27+
import org.springframework.web.multipart.MultipartFile;
2728

2829
import javax.servlet.http.HttpServletResponse;
2930
import java.io.IOException;
@@ -51,11 +52,27 @@ public void download(@PathVariable("id") Long id, HttpServletResponse response)
5152
response.sendRedirect(s3Url.get().toString());
5253
}
5354

54-
@PostMapping
55+
@GetMapping(path = "/{id}/download_testcases")
56+
@ResponseStatus(HttpStatus.PERMANENT_REDIRECT)
57+
public void downloadTestCasesList(@PathVariable("id") Long id, HttpServletResponse response) throws ResourceNotFoundException, IOException {
58+
BackupDetail detail = this.service.find(id);
59+
Optional<URL> s3Url = this.service.getTestCasesPreSignedURL(detail);
60+
if (!s3Url.isPresent()) {
61+
throw new ResourceNotFoundException("XLS file is missing in storage");
62+
}
63+
response.sendRedirect(s3Url.get().toString());
64+
}
65+
66+
@PostMapping(path ="/export")
5567
public void backup(@RequestBody BackupRequest request) throws IOException, TestsigmaException {
5668
service.export(request);
5769
}
5870

71+
@PostMapping(consumes = {"multipart/form-data"})
72+
public void create(@RequestPart BackupRequest request, @RequestPart(name = "file", required = false) MultipartFile file) throws IOException {
73+
service.create(request, file);
74+
}
75+
5976
@DeleteMapping(path = "/{id}")
6077
@ResponseStatus(HttpStatus.ACCEPTED)
6178
public void destroy(@PathVariable("id") Long id) throws ResourceNotFoundException {

server/src/main/java/com/testsigma/converter/TestDataSetConverter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.ArrayList;
2222
import java.util.LinkedHashMap;
2323
import java.util.List;
24+
import java.util.Optional;
2425

2526
@Log4j2
2627
@Converter//(autoApply = true)
@@ -53,7 +54,8 @@ public List<TestDataSet> convertToEntityAttribute(String dbData) {
5354
map.setAccessible(false);
5455
TestDataSet testDataSet = new TestDataSet();
5556
testDataSet.setName(node.get("name").asText());
56-
testDataSet.setDescription(node.get("description").asText());
57+
Optional<JsonNode> desc = Optional.ofNullable(node.get("description"));
58+
testDataSet.setDescription(desc.isPresent() ? desc.get().asText() : "");
5759
testDataSet.setExpectedToFail(node.get("expectedToFail").asBoolean());
5860
testDataSet.setData(dataObj);
5961
testDataSets.add(testDataSet);

server/src/main/java/com/testsigma/dto/AgentDTO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ public class AgentDTO {
3030
private String hostName;
3131
private AgentOs osType;
3232
private String osVersion;
33-
private String currentAgentVersion = "1.3.0";
33+
private String currentAgentVersion = "1.5.0";
3434
}

server/src/main/java/com/testsigma/dto/BackupDTO.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
package com.testsigma.dto;
88

9+
import com.testsigma.model.BackupActionType;
10+
import com.testsigma.model.WorkspaceType;
911
import lombok.Data;
1012

1113
import java.io.File;
@@ -38,4 +40,16 @@ public class BackupDTO {
3840
private String versionURL;
3941
private File srcFiles;
4042
private File destFiles;
43+
private BackupActionType actionType;
44+
private String importFileUrl;
45+
private Boolean skipEntityExists;
46+
private boolean hasToReset;
47+
private Long workspaceId;
48+
private Boolean isSameApplicationType = false;
49+
private Boolean isSameVersion = false;
50+
private Boolean resetName = false;
51+
private WorkspaceType workspaceType;
52+
private String serverUrl;
53+
private Boolean isCloudImport = false;
54+
private String affectedCasesListPath;
4155
}

server/src/main/java/com/testsigma/dto/BackupDetailDTO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ public class BackupDetailDTO {
2121
private Timestamp createdDate;
2222
private Timestamp updatedDate;
2323
private WorkspaceVersionDTO workspaceVersion;
24+
private String affectedCasesListPath;
2425
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/******************************************************************************
2+
* Copyright (C) 2019 Testsigma Inc.
3+
* All rights reserved.
4+
*****************************************************************************/
5+
package com.testsigma.dto.export;
6+
7+
import com.fasterxml.jackson.annotation.JsonFormat;
8+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
9+
import com.fasterxml.jackson.annotation.JsonProperty;
10+
import com.fasterxml.jackson.annotation.JsonRootName;
11+
import com.fasterxml.jackson.core.type.TypeReference;
12+
import com.testsigma.annotation.JsonListRootName;
13+
import com.testsigma.service.ObjectMapperService;
14+
import lombok.Data;
15+
16+
import java.sql.Timestamp;
17+
import java.util.ArrayList;
18+
import java.util.List;
19+
20+
@Data
21+
@JsonListRootName(name = "Agents")
22+
@JsonRootName(value = "Agent")
23+
@JsonIgnoreProperties(ignoreUnknown = true)
24+
public class AgentCloudXMLDTO extends BaseXMLDTO {
25+
@JsonProperty("Id")
26+
private Long id;
27+
@JsonProperty("uniqueId")
28+
private String uniqueId;
29+
@JsonProperty("SystemId")
30+
private Long systemId;
31+
@JsonProperty("AgencyVersion")
32+
private String agentVersion;
33+
@JsonProperty("BrowserList")
34+
private String browserList;
35+
@JsonProperty("CreatedBy")
36+
private Long createdBy;
37+
@JsonProperty("UpdatedBy")
38+
private Long updatedBy;
39+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd@HH:mm:ss.SSSZ")
40+
@JsonProperty("CreatedDate")
41+
private Timestamp createdDate;
42+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd@HH:mm:ss.SSSZ")
43+
@JsonProperty("UpdatedDate")
44+
private Timestamp updatedDate;
45+
@JsonProperty("Enabled")
46+
private Boolean enabled;
47+
@JsonProperty("HostName")
48+
private String hostName;
49+
@JsonProperty("VisibleToAll")
50+
private Boolean visibleToAll;
51+
@JsonProperty("MobileEnabled")
52+
private Boolean mobileEnabled;
53+
@JsonProperty("UpgradeAgentJar")
54+
private Boolean upgradeAgentJar = false;
55+
@JsonProperty("UpgradeJre")
56+
private Boolean upgradeJre = false;
57+
@JsonProperty("UpgradeAndroidTools")
58+
private Boolean upgradeAndroidTools = false;
59+
@JsonProperty("UpgradeIosTools")
60+
private Boolean upgradeIosTools = false;
61+
@JsonProperty("UpgradeAppium")
62+
private Boolean upgradeAppium = false;
63+
64+
public List<AgentBrowserXMLDTO> getBrowserList() {
65+
return browserList == null ? new ArrayList<>() :
66+
new ObjectMapperService().parseJson(browserList, new TypeReference<>() {
67+
});
68+
}
69+
70+
public void setBrowserList(List<AgentBrowserXMLDTO> browserList) {
71+
this.browserList = new ObjectMapperService().convertToJson(browserList);
72+
}
73+
74+
public List<AgentBrowserXMLDTO> getBrowserListDTO() {
75+
return browserList == null ? new ArrayList<>() :
76+
new ObjectMapperService().parseJson(browserList, new TypeReference<>() {
77+
});
78+
}
79+
80+
public String getBrowserVersion(String browser) {
81+
List<AgentBrowserXMLDTO> list = browserList == null ? new ArrayList<>() :
82+
new ObjectMapperService().parseJson(browserList, new TypeReference<>() {
83+
});
84+
for (AgentBrowserXMLDTO browserDTO : list) {
85+
if (browserDTO.getName().getBrowserName().equals(browser)) {
86+
return ((float) browserDTO.getMajorVersion()) + "";
87+
}
88+
}
89+
return browser;
90+
}
91+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
*
3+
* ****************************************************************************
4+
* * Copyright (C) 2019 Testsigma Inc.
5+
* * All rights reserved.
6+
* ****************************************************************************
7+
*
8+
*/
9+
10+
package com.testsigma.dto.export;
11+
12+
import com.fasterxml.jackson.annotation.JsonFormat;
13+
import com.fasterxml.jackson.annotation.JsonProperty;
14+
import com.fasterxml.jackson.annotation.JsonRootName;
15+
import com.testsigma.annotation.JsonListRootName;
16+
import com.testsigma.model.WorkspaceType;
17+
import lombok.Data;
18+
19+
import java.sql.Timestamp;
20+
21+
@Data
22+
@JsonListRootName(name = "Applications")
23+
@JsonRootName(value = "Application")
24+
public class ApplicationCloudXMLDTO extends BaseXMLDTO {
25+
@JsonProperty("Id")
26+
private Long id;
27+
@JsonProperty("Name")
28+
private String name;
29+
@JsonProperty("Description")
30+
private String description;
31+
@JsonProperty("ProjectId")
32+
private Long projectId;
33+
@JsonProperty("CreatedById")
34+
private Long createdById;
35+
@JsonProperty("UpdatedById")
36+
private Long updatedById;
37+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd@HH:mm:ss.SSSZ")
38+
@JsonProperty("CreatedDate")
39+
private Timestamp createdDate;
40+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd@HH:mm:ss.SSSZ")
41+
@JsonProperty("UpdatedDate")
42+
private Timestamp updatedDate;
43+
@JsonProperty("ApplicationType")
44+
private WorkspaceType workspaceType;
45+
@JsonProperty("CustomFields")
46+
private String customFields;
47+
}

0 commit comments

Comments
 (0)