Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马博
test-platform
Commits
be0a8962
Commit
be0a8962
authored
Oct 15, 2018
by
马博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
486e9366
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
641 additions
and
18 deletions
+641
-18
pom.xml
pom.xml
+8
-0
Postman.java
src/test/java/common/Postman.java
+4
-13
RetryToRunCase.java
src/test/java/common/RetryToRunCase.java
+2
-1
TestReport.java
src/test/java/common/TestReport.java
+3
-3
ContractSign_signTest.java
src/test/java/http/cases/SignTest/ContractSign_signTest.java
+404
-0
Signin_signTest.java
src/test/java/http/cases/SignTest/Signin_signTest.java
+1
-1
ContractSignService.java
src/test/java/http/service/Activity/ContractSignService.java
+219
-0
No files found.
pom.xml
View file @
be0a8962
...
...
@@ -159,6 +159,12 @@
<artifactId>
jsoup
</artifactId>
<version>
1.10.2
</version>
</dependency>
<dependency>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<version>
2.6
</version>
</dependency>
</dependencies>
<build>
...
...
@@ -207,6 +213,7 @@
<noticePerson>
false
</noticePerson>
<sendPlatform>
false
</sendPlatform>
<run>
${run}
</run>
<maxRetryCount>
0
</maxRetryCount>
</systemPropertyVariables>
</configuration>
...
...
@@ -281,6 +288,7 @@
<properties>
<run>
**/*_signTest.java
</run>
<threadCount>
1
</threadCount>
<!--<maxRetryCount>0</maxRetryCount>-->
</properties>
<!--公司仓库地址-->
...
...
src/test/java/common/Postman.java
View file @
be0a8962
...
...
@@ -22,7 +22,7 @@ public class Postman {
static
String
dingdingUrl
=
"https://shark.dui88.com/test/integration"
;
static
String
testPlatformUrl
=
"http://101.37.27.82:8080/insert"
;
//dingdingUrl="http://www.json.cn/";
private
Logger
logger
=
LogManager
.
getLogger
(
Postman
.
class
);
private
static
Logger
logger
=
LogManager
.
getLogger
(
Postman
.
class
);
public
static
void
send2Dingding
(
Map
result
){
System
.
out
.
println
(
"Dingding:"
+
result
);
RestAssuredConfig
config
=
RestAssured
.
config
();
...
...
@@ -31,20 +31,14 @@ public class Postman {
.
setParam
(
CoreConnectionPNames
.
CONNECTION_TIMEOUT
,
150000
)
// Remote host connection time
.
setParam
(
CoreConnectionPNames
.
SO_TIMEOUT
,
150000
)
;
// Remote host response time
Response
response
=
given
().
relaxedHTTPSValidation
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
dingdingUrl
);
System
.
out
.
println
(
"--------DingdingTest--------:"
);
response
.
prettyPrint
();
System
.
out
.
println
(
"--------DingdingTest1--------:"
);
logger
.
info
(
"钉钉响应数据:"
+
response
.
asString
());
Boolean
bl
=
response
.
jsonPath
().
getString
(
"success"
).
equals
(
"false"
);
if
(
bl
){
String
[]
name
=
DingdingResult
.
name
;
result
.
put
(
"names"
,
name
);
response
=
given
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
dingdingUrl
);
System
.
out
.
println
(
"--------DingdingTest2--------:"
);
response
.
prettyPrint
();
System
.
out
.
println
(
"--------DingdingTest2--------:"
);
logger
.
info
(
"钉钉重试响应数据:"
+
response
.
asString
());
}
...
...
@@ -52,10 +46,7 @@ public class Postman {
public
static
void
sendTestPlatform
(
Map
result
){
Response
response
=
given
().
contentType
(
ContentType
.
JSON
).
body
(
result
).
post
(
testPlatformUrl
);
System
.
out
.
println
(
"--------testPlatform--------:"
);
response
.
prettyPrint
();
System
.
out
.
println
(
"--------testPlatform--------:"
);
logger
.
info
(
"自动化数据收集平台响应数据:"
+
response
.
asString
());
}
public
static
Boolean
getName
(){
Calendar
c
=
Calendar
.
getInstance
();
...
...
src/test/java/common/RetryToRunCase.java
View file @
be0a8962
...
...
@@ -8,8 +8,9 @@ import org.testng.ITestResult;
*/
public
class
RetryToRunCase
implements
IRetryAnalyzer
{
private
int
retryCount
=
0
;
private
int
maxRetryCount
=
0
;
// retry a failed test 2 additional times
private
int
maxRetryCount
=
Integer
.
valueOf
(
System
.
getProperty
(
"maxRetryCount"
))
;
// retry a failed test 2 additional times
public
boolean
retry
(
ITestResult
result
)
{
System
.
out
.
println
(
"~~~~~~~~~~~~~~~~~maxRetryCount~~~~~~~~~~~~~~~~~~~~~~~:"
+
maxRetryCount
);
if
(
retryCount
<
maxRetryCount
)
{
retryCount
++;
return
true
;
...
...
src/test/java/common/TestReport.java
View file @
be0a8962
...
...
@@ -63,8 +63,8 @@ public class TestReport implements IReporter{
e
.
printStackTrace
();
}
map
.
put
(
"failCase"
,
failCase
);
logger
.
in
fo
(
"gson.toJson(ddResult)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
);
logger
.
info
(
"
钉钉通知
:"
+
gson
.
toJson
(
map
));
// logger.in
fo("gson.toJson(ddResult)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
logger
.
info
(
"
测试结果通知信息
:"
+
gson
.
toJson
(
map
));
//发送运行结果到自动化数据收集平台
if
(
sendPlatform
)
Postman
.
sendTestPlatform
(
map
);
...
...
@@ -73,7 +73,7 @@ public class TestReport implements IReporter{
if
(!
noticePerson
){
map
.
put
(
"names"
,
new
ArrayList
<>());
}
logger
.
info
(
"noticeDD:"
+
noticeDD
);
//
logger.info("noticeDD:"+noticeDD);
Postman
.
send2Dingding
(
map
);
}
...
...
src/test/java/http/cases/SignTest/ContractSign_signTest.java
0 → 100644
View file @
be0a8962
This diff is collapsed.
Click to expand it.
src/test/java/http/cases/SignTest/Signin_signTest.java
View file @
be0a8962
...
...
@@ -164,7 +164,7 @@ public class Signin_signTest extends DuibaTestBase {
Assert
.
assertEquals
(
act
,
exp
,
"积分与预期不符"
);
//校验consumer和user表的积分
Thread
.
sleep
(
2000
);
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from consumer.consumer_0010 where id=100028002"
);
consumerCredits
=
jdbc
.
findSimpleResult
(
"select * from
new_
consumer.consumer_0010 where id=100028002"
);
Map
userCredits
=
jdbc
.
findSimpleResult
(
"select * from dafuweng.user where id ="
+
uid
);
Assert
.
assertEquals
(
consumerCredits
.
get
(
"credits"
).
toString
().
trim
(),
String
.
valueOf
(
exp
),
"consumer积分与预期不符"
);
Assert
.
assertEquals
(
userCredits
.
get
(
"credits"
).
toString
().
trim
(),
String
.
valueOf
(
exp
),
"user积分与预期不符"
);
...
...
src/test/java/http/service/Activity/ContractSignService.java
0 → 100644
View file @
be0a8962
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment