Skip to content

Commit 184cf24

Browse files
Merge pull request #28 from testsigmahq/1.2.0-release
v1.2.0 release
2 parents d35c5b8 + 4d51d9b commit 184cf24

File tree

175 files changed

+1670
-530
lines changed

Some content is hidden

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

175 files changed

+1670
-530
lines changed

automator/src/com/testsigma/automator/actions/mobile/MobileElement.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ public MobileElement(Node node, Integer depth, Platform platform) {
221221

222222
private void populateIosAttributes(RemoteWebElement remoteWebElement) {
223223
this.setName(remoteWebElement.getAttribute("name"));
224-
this.setAccessibilityId(this.name);
224+
this.setId(name);
225+
this.setAccessibilityId(name);
225226
this.setType(remoteWebElement.getAttribute("type"));
226227
this.setLabel(remoteWebElement.getAttribute("label"));
227228
}
@@ -230,6 +231,7 @@ private void populateAndroidAttributes(RemoteWebElement remoteWebElement) {
230231
this.setName(remoteWebElement.getTagName());
231232
this.setType(remoteWebElement.getAttribute("class"));
232233
this.setResourceId(remoteWebElement.getAttribute("resource-id"));
234+
this.setId(resourceId);
233235
this.setContentDesc(remoteWebElement.getAttribute("content-desc"));
234236
this.setAccessibilityId(this.contentDesc);
235237
this.setPassword(Boolean.valueOf(remoteWebElement.getAttribute("password")));

automator/src/com/testsigma/automator/constants/AutomatorMessages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class AutomatorMessages {
2727
public final static String MSG_CONDITION_ELSE_IF_SUCCESS = "\"Else If\" condition matched to proceed with the steps under this condition.";
2828
public final static String MSG_CONDITION_ELSE_SUCCESS = "\"Else\" condition matched to proceed with the steps under this condition.";
2929
public static final String EXCEPTION_WEBDRIVER_NOTCREATED = "Unable to create a new Test Session due to unexpected failure(0x537). Please contact Support for more details.";
30+
public static final String NO_PARALLEL_RUNS = "Parallel Executions Limit exceeded.Please upgrade to community edition for more parallel runs or Please contact support team for more details.";
3031
public static final String EXCEPTION_INVALID_PARAMETER_FORMAT = "Invalid value ?1 entered for parameter ?2 while executing the Custom Test Data Function \"?3\"";
3132
public static final String EXCEPTION_INVALID_CLASS_NAME = "Unsupported class \"?1\" used to generate test data from custom function";
3233
public static final String EXCEPTION_METHOD_NOT_FOUND = "No implementation found for this template";

automator/src/com/testsigma/automator/constants/ErrorCodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class ErrorCodes {
3737
public static Integer ERROR_TEST_DATA_FAILURE = 103;
3838
public static Integer ERROR_ELEMENT_FAILURE = 104;
3939
public static Integer BROWSER_VERSION_NOT_AVAILABLE = 109;
40-
40+
public static Integer NO_PARALLEL_RUN = 110;
4141
public static Integer TEST_CASE_DETAILS_FETCH_FAILED = 200;
4242

4343
public static Integer WDA_INSTALLATION_FAILED = 300;

automator/src/com/testsigma/automator/drivers/DriverManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.testsigma.automator.constants.SessionErrorType;
88
import com.testsigma.automator.entity.*;
99
import com.testsigma.automator.exceptions.AutomatorException;
10+
import com.testsigma.automator.exceptions.TestsigmaNoParallelRunException;
1011
import com.testsigma.automator.runners.EnvironmentRunner;
1112
import com.testsigma.automator.utilities.RuntimeDataProvider;
1213
import com.testsigma.automator.utilities.TimeUtil;
@@ -22,7 +23,7 @@
2223
@Data
2324
public abstract class DriverManager {
2425
public static final String MSG_LAB_MINUTES_EXCEEDED = "Allowed test execution duration on cloud devices/machines exceeded.";
25-
public static final String MSG_NO_PARALLEL_RUN = "Parallel runs are not allowed in Open Source, Please Change to Community edition for parallel Execution or Contact Support Team.";
26+
public static final String MSG_NO_PARALLEL_RUN = "Parallel Executions Limit exceeded.Please upgrade to community edition for more parallel runs.";
2627
public static final String MSG_OS_NOT_SUPPORTED = "Selected device OS and version combination is no longer supported. Please edit the device and choose a supported OS and Version.";
2728
public static final String MSG_BROWSER_NOT_SUPPORTED = "Selected browser and version combination is no longer supported. Please edit the device and choose a supported browser and Version.";
2829

@@ -136,7 +137,10 @@ public void startSession(DriverSessionType driverSessionType, Long entityId, Boo
136137
String errorMessage = parseErrorMessage(e.getMessage());
137138
if (StringUtils.isBlank(errorMessage)) {
138139
errorMessage = AutomatorMessages.EXCEPTION_WEBDRIVER_NOTCREATED + " - " + e.getMessage();
139-
} else {
140+
} else if(e.getMessage().contains("NO_PARALLEL_RUN")){
141+
errorMessage = AutomatorMessages.NO_PARALLEL_RUNS;
142+
throw new TestsigmaNoParallelRunException(ErrorCodes.NO_PARALLEL_RUN,errorMessage);
143+
}else {
140144
errorMessage = "Unable to create a new Test Session due to unexpected failure(0x537). " + errorMessage;
141145
}
142146
endSession();

automator/src/com/testsigma/automator/entity/StepDetails.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ public class StepDetails {
3333
private Long parentId;
3434
private String testDataName;
3535
private String testDataValue;
36+
private Boolean ignoreStepResult;
3637
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.testsigma.automator.exceptions;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
import lombok.extern.log4j.Log4j2;
6+
7+
8+
@Log4j2
9+
@Getter
10+
@Setter
11+
public class TestsigmaNoParallelRunException extends AutomatorException {
12+
13+
private Integer errorCode;
14+
private String message;
15+
private String dispMessage;
16+
17+
public TestsigmaNoParallelRunException(Integer errorCode, String message) {
18+
super(errorCode, message);
19+
this.errorCode = errorCode;
20+
this.message = message;
21+
this.dispMessage = message;
22+
log.error(message);
23+
}
24+
}

automator/src/com/testsigma/automator/runners/ActionStepExecutor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ private void markTestcaseAborted(TestCaseResult testCaseResult, TestCaseStepResu
117117
result.setMessage(AutomatorMessages.MSG_STEP_MAJOR_STEP_FAILURE);
118118
testCaseResult.setResult(ResultConstant.ABORTED);
119119
testCaseResult.setMessage(AutomatorMessages.MSG_TEST_CASE_ABORTED);
120+
if(!testCaseStepEntity.getStepDetails().getIgnoreStepResult()) {
121+
testCaseResult.setResult(ResultConstant.ABORTED);
122+
testCaseResult.setMessage(AutomatorMessages.MSG_TEST_CASE_ABORTED);
123+
}
120124
} else {
121125
result.setResult(ResultConstant.FAILURE);
122126
}

automator/src/com/testsigma/automator/runners/AddonNaturalTextActionStepExecutor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ private void markTestcaseAborted(TestCaseResult testCaseResult, TestCaseStepResu
7878
result.setMessage(AutomatorMessages.MSG_STEP_MAJOR_STEP_FAILURE);
7979
testCaseResult.setResult(ResultConstant.ABORTED);
8080
testCaseResult.setMessage(AutomatorMessages.MSG_TEST_CASE_ABORTED);
81+
if(!testCaseStepEntity.getStepDetails().getIgnoreStepResult()) {
82+
testCaseResult.setResult(ResultConstant.ABORTED);
83+
testCaseResult.setMessage(AutomatorMessages.MSG_TEST_CASE_ABORTED);
84+
}
8185
} else {
8286
result.setResult(ResultConstant.FAILURE);
8387
}

automator/src/com/testsigma/automator/runners/EnvironmentRunner.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.testsigma.automator.drivers.DriversUpdateService;
77
import com.testsigma.automator.entity.*;
88
import com.testsigma.automator.exceptions.AutomatorException;
9+
import com.testsigma.automator.exceptions.TestsigmaNoParallelRunException;
910
import com.testsigma.automator.http.HttpClient;
1011
import com.testsigma.automator.utilities.ErrorUtil;
1112
import com.testsigma.automator.utilities.PathUtil;
@@ -117,6 +118,10 @@ public EnvironmentRunResult run() {
117118
afterExecute();
118119
setEnvironmentResult();
119120
setStoppedStatus();
121+
} catch (TestsigmaNoParallelRunException e){
122+
environmentRunResult.setResult(ResultConstant.STOPPED);
123+
environmentRunResult.setErrorCode(e.getErrorCode());
124+
environmentRunResult.setMessage(e.getMessage());
120125
} catch (AutomatorException e) {
121126
environmentRunResult.setResult(ResultConstant.NOT_EXECUTED);
122127
environmentRunResult.setErrorCode(e.getErrorCode());

automator/src/com/testsigma/automator/runners/TestcaseRunner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ public TestCaseResult run() throws Exception {
198198
}
199199

200200
//TODO:use check based step type
201-
if (testCaseStepEntity.getConditionType() == null || testCaseStepEntity.getConditionType() == ConditionType.NOT_USED
202-
|| ConditionType.LOOP_FOR == testCaseStepEntity.getConditionType()) {
201+
if ((testCaseStepEntity.getConditionType() == null || testCaseStepEntity.getConditionType() == ConditionType.NOT_USED
202+
|| ConditionType.LOOP_FOR == testCaseStepEntity.getConditionType()) && (!testCaseStepEntity.getStepDetails().getIgnoreStepResult()) ) {
203203
result = (result.getId() < testCaseStepResult.getResult().getId()) ? testCaseStepResult.getResult() : result;
204204
}
205205
int processedSteps = processedStepCount(testCaseStepsResult);

0 commit comments

Comments
 (0)