Skip to content

Commit 6fccc1a

Browse files
committed
Add more settings
Add more settings
1 parent 1b3621b commit 6fccc1a

6 files changed

Lines changed: 166 additions & 38 deletions

File tree

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ https://www.youtube.com/watch?v=qDTUYkaXAEc
77
# Change default port value in application.properties
88

99
Use:
10-
server.contextPath=/testar/1.0.0
10+
server.contextPath=/testar/1.2.0
1111
server.port=8080
1212

13-
To: http://localhost:8080/testar/1.0.0/swagger-ui.html
13+
To: http://localhost:8080/testar/1.2.0/swagger-ui.html
1414

1515
Use:
16-
server.contextPath=/testar/1.0.0
16+
server.contextPath=/testar/1.2.0
1717
server.address=10.101.101.6
1818
server.port=8090
1919

20-
To: http://10.101.101.6:8090/testar/1.0.0/swagger-ui.html
20+
To: http://10.101.101.6:8090/testar/1.2.0/swagger-ui.html
2121

2222

2323
# Example TESTAR Web POST execution
@@ -26,15 +26,14 @@ Use:
2626
params
2727
{
2828
"mode": "Generate",
29-
"sse": "web_generic",
29+
"sse": "desktop_generic",
3030
"sequenceLength": 50,
3131
"sequences": 5,
32-
"suspiciousTitles": ".*[eE]rror.*|.*[eE]xcep[ct]i[o?]n.*|.*[bB]ortali.*",
33-
"testCaseName": "xxxx"
32+
"suspiciousTitles": ".*[eE]rror.*|.*[eE]xcep[ct]i[o?]n.*",
3433
}
3534

3635
To:
37-
testar.bat sse=web_generic Mode=Generate Sequences=5 SequenceLength=50 SuspiciousTitles=.*[eE]rror.*|.*[eE]xcep[ct]i[o?]n.*|.*[bB]ortali.*
36+
testar.bat sse=desktop_generic Mode=Generate Sequences=5 SequenceLength=50 SuspiciousTitles=.*[eE]rror.*|.*[eE]xcep[ct]i[o?]n.*
3837

3938
# Other useful information
4039

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>testar-api</artifactId>
55
<packaging>jar</packaging>
66
<name>testar-api</name>
7-
<version>1.1.0</version>
7+
<version>1.2.0</version>
88
<properties>
99
<java.version>1.8</java.version>
1010
<maven.compiler.source>${java.version}</maven.compiler.source>

src/main/java/es/prodevelop/testar/api/SwaggerDocumentationConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ApiInfo apiInfo() {
2222
.license("Apache 2.0")
2323
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
2424
.termsOfServiceUrl("")
25-
.version("1.1.0")
25+
.version("1.2.0")
2626
.contact(new Contact("","", ""))
2727
.build();
2828
}

src/main/java/es/prodevelop/testar/api/model/Params.java

Lines changed: 138 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,20 @@ public class Params {
4040
@JsonProperty("sequenceFileName")
4141
private String sequenceFileName = null;
4242

43-
/*@JsonProperty("testCaseName")
44-
private String testCaseName = null;*/
43+
@JsonProperty("applicationName")
44+
private String applicationName = null;
45+
46+
@JsonProperty("applicationVersion")
47+
private String applicationVersion = null;
48+
49+
@JsonProperty("loginUsername")
50+
private String loginUsername = null;
51+
52+
@JsonProperty("loginPassword")
53+
private String loginPassword = null;
54+
55+
@JsonProperty("topWidgetsState")
56+
private boolean topWidgetsState = true;
4557

4658
/**
4759
* Indicates to TESTAR the protocol to be executed
@@ -102,7 +114,7 @@ public Params sutConnector(String sutConnector) {
102114
this.sutConnector = sutConnector;
103115
return this;
104116
}
105-
117+
106118
/**
107119
* Indicate the location of the SUT
108120
* @return sutConnectorValue
@@ -117,12 +129,12 @@ public String getSutConnectorValue() {
117129
public void setSutConnectorValue(String sutConnectorValue) {
118130
this.sutConnectorValue = sutConnectorValue;
119131
}
120-
132+
121133
public Params sutConnectorValue(String sutConnectorValue) {
122134
this.sutConnectorValue = sutConnectorValue;
123135
return this;
124136
}
125-
137+
126138
/**
127139
* Number of sequences to generate
128140
* @return sequences
@@ -160,7 +172,7 @@ public Params sequenceLength(Integer sequenceLength) {
160172
this.sequenceLength = sequenceLength;
161173
return this;
162174
}
163-
175+
164176
/**
165177
* Indicate the suspicious Strings that TESTAR should look for in the interface
166178
* @return suspiciousTitles
@@ -179,21 +191,21 @@ public Params suspiciousTitles(String suspiciousTitles) {
179191
this.suspiciousTitles = suspiciousTitles;
180192
return this;
181193
}
182-
194+
183195
/**
184196
* Regular expression to filter non desired widgets
185197
* @return ClickFilter
186198
*/
187199
@ApiModelProperty(example = ".*[cC]lose.*|.*[sS]alir.*|.*[eE]xit.*|.*[mM]inimizar.*|.*[mM]inimi[zs]e.*", value = "Regular expression to filter non desired widgets")
188-
200+
189201
public String getClickFilter() {
190202
return clickFilter;
191203
}
192204

193205
public void setClickFilter(String clickFilter) {
194206
this.clickFilter = clickFilter;
195207
}
196-
208+
197209
public Params clickFilter(String clickFilter) {
198210
this.clickFilter = clickFilter;
199211
return this;
@@ -219,24 +231,104 @@ public Params sequenceFileName(String sequenceFileName) {
219231
}
220232

221233
/**
222-
* Name of the testcase to be inserted in internal TESTAR logs for further analysis
223-
* @return testCaseName
234+
* Name of the application run that we are executing
235+
* @return applicationName
224236
**/
225-
/*@ApiModelProperty(example = "test-case-name", required = true, value = "Name of the testcase to be inserted in internal TESTAR logs for further analysis")
237+
@ApiModelProperty(example = "Notepad", value = "Name of the application run that we are executing")
226238
@NotNull
227239

228-
public String getTestCaseName() {
229-
return testCaseName;
240+
public String getApplicationName() {
241+
return applicationName;
230242
}
231243

232-
public void setTestCaseName(String testCaseName) {
233-
this.testCaseName = testCaseName;
244+
public void setApplicationName(String applicationName) {
245+
this.applicationName = applicationName;
234246
}
235247

236-
public Params testCaseName(String testCaseName) {
237-
this.testCaseName = testCaseName;
248+
public Params applicationName(String applicationName) {
249+
this.applicationName = applicationName;
238250
return this;
239-
}*/
251+
}
252+
253+
/**
254+
* Number of the version run that we are executing
255+
* @return applicationVersion
256+
**/
257+
@ApiModelProperty(example = "1.0.0", value = "Number of the version run that we are executing")
258+
@NotNull
259+
260+
public String getApplicationVersion() {
261+
return applicationVersion;
262+
}
263+
264+
public void setApplicationVersion(String applicationVersion) {
265+
this.applicationVersion = applicationVersion;
266+
}
267+
268+
public Params applicationVersion(String applicationVersion) {
269+
this.applicationVersion = applicationVersion;
270+
return this;
271+
}
272+
273+
/**
274+
* Username credential to use in the beginSequence method of the protocol
275+
* @return loginUsername
276+
**/
277+
@ApiModelProperty(example = "username", value = "Username credential to use in the beginSequence method of the protocol")
278+
@NotNull
279+
280+
public String getLoginUsername() {
281+
return loginUsername;
282+
}
283+
284+
public void setLoginUsername(String loginUsername) {
285+
this.loginUsername = loginUsername;
286+
}
287+
288+
public Params loginUsername(String loginUsername) {
289+
this.loginUsername = loginUsername;
290+
return this;
291+
}
292+
293+
/**
294+
* Password credential to use in the beginSequence method of the protocol
295+
* @return loginPassword
296+
**/
297+
@ApiModelProperty(example = "password", value = "Password credential to use in the beginSequence method of the protocol")
298+
@NotNull
299+
300+
public String getLoginPassword() {
301+
return loginPassword;
302+
}
303+
304+
public void setLoginPassword(String loginPassword) {
305+
this.loginPassword = loginPassword;
306+
}
307+
308+
public Params loginPassword(String loginPassword) {
309+
this.loginPassword = loginPassword;
310+
return this;
311+
}
312+
313+
/**
314+
* Derive TESTAR Actions with the Top Widgets Of the State
315+
* @return topWidgetsState
316+
**/
317+
@ApiModelProperty(example = "true", value = "Derive TESTAR Actions with the Top Widgets Of the State")
318+
@NotNull
319+
320+
public boolean getTopWidgetsState() {
321+
return topWidgetsState;
322+
}
323+
324+
public void setTopWidgetsState(boolean topWidgetsState) {
325+
this.topWidgetsState = topWidgetsState;
326+
}
327+
328+
public Params topWidgetsState(boolean topWidgetsState) {
329+
this.topWidgetsState = topWidgetsState;
330+
return this;
331+
}
240332

241333
@Override
242334
public boolean equals(java.lang.Object o) {
@@ -255,13 +347,31 @@ public boolean equals(java.lang.Object o) {
255347
Objects.equals(this.sequenceLength, params.sequenceLength) &&
256348
Objects.equals(this.suspiciousTitles, params.suspiciousTitles) &&
257349
Objects.equals(this.clickFilter, params.clickFilter) &&
258-
Objects.equals(this.sequenceFileName, params.sequenceFileName);
259-
//Objects.equals(this.testCaseName, params.testCaseName);
350+
Objects.equals(this.sequenceFileName, params.sequenceFileName) &&
351+
Objects.equals(this.applicationName, params.applicationName) &&
352+
Objects.equals(this.applicationVersion, params.applicationVersion) &&
353+
Objects.equals(this.loginUsername, params.loginUsername) &&
354+
Objects.equals(this.loginPassword, params.loginPassword) &&
355+
Objects.equals(this.topWidgetsState, params.topWidgetsState);
260356
}
261357

262358
@Override
263359
public int hashCode() {
264-
return Objects.hash(sse, mode, sutConnector, sutConnectorValue, sequences, sequenceLength, suspiciousTitles, clickFilter, sequenceFileName);
360+
return Objects.hash(
361+
sse,
362+
mode,
363+
sutConnector,
364+
sutConnectorValue,
365+
sequences,
366+
sequenceLength,
367+
suspiciousTitles,
368+
clickFilter,
369+
sequenceFileName,
370+
applicationName,
371+
applicationVersion,
372+
loginUsername,
373+
loginPassword,
374+
topWidgetsState);
265375
}
266376

267377
@Override
@@ -278,8 +388,12 @@ public String toString() {
278388
sb.append(" suspiciousTitles: ").append(toIndentedString(suspiciousTitles)).append("\n");
279389
sb.append(" clickFilter: ").append(toIndentedString(clickFilter)).append("\n");
280390
sb.append(" sequenceFileName: ").append(toIndentedString(sequenceFileName)).append("\n");
281-
//sb.append(" testCaseName: ").append(toIndentedString(testCaseName)).append("\n");
282-
391+
sb.append(" applicationName: ").append(toIndentedString(applicationName)).append("\n");
392+
sb.append(" applicationVersion: ").append(toIndentedString(applicationVersion)).append("\n");
393+
sb.append(" loginUsername: ").append(toIndentedString(loginUsername)).append("\n");
394+
sb.append(" loginPassword: ").append(toIndentedString(loginPassword)).append("\n");
395+
sb.append(" topWidgetsState: ").append(toIndentedString(topWidgetsState)).append("\n");
396+
283397
sb.append("}");
284398
return sb.toString();
285399
}

src/main/java/es/prodevelop/testar/api/service/TestarService.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,24 @@ public ReturnExecution execute(Params params) throws Exception {
8282

8383
commands.add("ShowVisualSettingsDialogOnStartup=false");
8484

85-
/*if (params.getTestCaseName() != null) {
86-
commands.add("TestCaseName="+params.getTestCaseName());
87-
}*/
85+
if (params.getApplicationName() != null) {
86+
commands.add("ApplicationName="+params.getApplicationName());
87+
}
88+
89+
if (params.getApplicationVersion() != null) {
90+
commands.add("ApplicationVersion="+params.getApplicationVersion());
91+
}
92+
93+
if (params.getLoginUsername() != null) {
94+
commands.add("LoginUsername="+params.getLoginUsername());
95+
}
96+
97+
if (params.getLoginPassword() != null) {
98+
commands.add("LoginPassword="+params.getLoginPassword());
99+
}
100+
101+
commands.add("TopWidgetsState="+params.getTopWidgetsState());
102+
88103

89104
//TODO: sequenceFileName
90105

src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
springfox.documentation.swagger.v2.path=/api-docs
33

4-
server.contextPath=/testar/1.1.0
4+
server.contextPath=/testar/1.2.0
55
server.port=8080
66

77
spring.jackson.date-format=es.prodevelop.testar.api.RFC3339DateFormat

0 commit comments

Comments
 (0)