Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
webappauto
Overview
Overview
Details
Activity
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
Li Yongyu
webappauto
Commits
e818ea9e
Commit
e818ea9e
authored
Sep 28, 2018
by
shuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
20180928
parent
50605027
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
83 additions
and
23 deletions
+83
-23
DataAll - 副本.xls
Api_auto_test/TestData/DataAll - 副本.xls
+0
-0
DataAll.xls
Api_auto_test/TestData/DataAll.xls
+0
-0
DefectTest.xml
Api_auto_test/src/DefectTest.xml
+1
-1
answer.java
Api_auto_test/src/com/offcn/api/xyzb/answer.java
+2
-2
getRooms.java
Api_auto_test/src/com/offcn/api/xyzb/getRooms.java
+6
-3
operation_info.java
Api_auto_test/src/com/offcn/api/xyzb/operation_info.java
+12
-5
questions_get.java
Api_auto_test/src/com/offcn/api/xyzb/questions_get.java
+4
-1
room_info.java
Api_auto_test/src/com/offcn/api/xyzb/room_info.java
+2
-1
suggest.java
Api_auto_test/src/com/offcn/api/xyzb/suggest.java
+2
-1
ProcessTestng.java
Api_auto_test/src/com/offcn/listener/ProcessTestng.java
+14
-8
BasicsGM.java
Api_auto_test/src/com/offcn/process/BasicsGM.java
+1
-1
information.properties
Api_auto_test/src/resources/information.properties
+39
-0
No files found.
Api_auto_test/TestData/DataAll - 副本.xls
View file @
e818ea9e
No preview for this file type
Api_auto_test/TestData/DataAll.xls
View file @
e818ea9e
No preview for this file type
Api_auto_test/src/DefectTest.xml
View file @
e818ea9e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<classes>
<classes>
<class
name=
"com.puhui.test.RenMai_APITest"
>
<class
name=
"com.puhui.test.RenMai_APITest"
>
<methods>
<methods>
<include
name=
"f"
invocation-numbers=
"
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
"
/>
<include
name=
"f"
invocation-numbers=
""
/>
</methods>
</methods>
</class>
</class>
</classes>
</classes>
...
...
Api_auto_test/src/com/offcn/api/xyzb/answer.java
View file @
e818ea9e
...
@@ -157,8 +157,8 @@ public class answer extends XYZB implements API {
...
@@ -157,8 +157,8 @@ public class answer extends XYZB implements API {
// System.out.println(StringUtils.decodeUnicode(act_answer));
// System.out.println(StringUtils.decodeUnicode(act_answer));
// System.out.println(id);
// System.out.println(id);
// System.out.println(act_question_id);
// System.out.println(act_question_id);
if
((!
private_
.
equals
(
act_private
))
//
if ((!private_.equals(act_private))
||
(!
answer
.
equals
(
StringUtils
.
decodeUnicode
(
act_answer
)))
if
(
(!
answer
.
equals
(
StringUtils
.
decodeUnicode
(
act_answer
)))
||
(!
id
.
equals
(
act_question_id
))){
||
(!
id
.
equals
(
act_question_id
))){
result
=
result
&&
false
;
result
=
result
&&
false
;
failReason
=
failReason
+
"xyu_room_answer info in DB is wrong;"
;
failReason
=
failReason
+
"xyu_room_answer info in DB is wrong;"
;
...
...
Api_auto_test/src/com/offcn/api/xyzb/getRooms.java
View file @
e818ea9e
...
@@ -85,6 +85,7 @@ public class getRooms extends XYZB implements API {
...
@@ -85,6 +85,7 @@ public class getRooms extends XYZB implements API {
String
json
=
re
.
asString
();
String
json
=
re
.
asString
();
System
.
out
.
println
(
json
);
if
((
data
.
get
(
"statusCode"
)
!=
null
)
if
((
data
.
get
(
"statusCode"
)
!=
null
)
&&
(!
data
.
get
(
"statusCode"
).
toString
()
&&
(!
data
.
get
(
"statusCode"
).
toString
()
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
.
equals
(
String
.
valueOf
(
re
.
getStatusCode
()))))
{
...
@@ -147,20 +148,22 @@ public class getRooms extends XYZB implements API {
...
@@ -147,20 +148,22 @@ public class getRooms extends XYZB implements API {
try
{
try
{
ResultSet
rs_bankcard
=
null
;
ResultSet
rs_bankcard
=
null
;
if
(!
parameter
.
contains
(
"role"
)){
if
(!
parameter
.
contains
(
"role"
)){
rs_bankcard
=
this
.
select
Count
FromDB
(
rs_bankcard
=
this
.
selectFromDB
(
" xyu_room_users r "
,
" xyu_room_users r "
,
" r.room_num = '"
+
Current_room
+
"' "
);
" r.room_num = '"
+
Current_room
+
"' "
);
rs_bankcard
.
last
();
rs_bankcard
.
last
();
// System.out.println(rs_bankcard.getString("count(*)"));
// System.out.println(rs_bankcard.getString("count(*)"));
}
else
{
}
else
{
rs_bankcard
=
this
.
select
Count
FromDB
(
rs_bankcard
=
this
.
selectFromDB
(
" xyu_room_users r "
,
" xyu_room_users r "
,
" r.room_num = '"
+
Current_room
+
"' and role = '"
+
role
+
"'"
);
" r.room_num = '"
+
Current_room
+
"' and role = '"
+
role
+
"'"
);
rs_bankcard
.
last
();
rs_bankcard
.
last
();
// System.out.println(rs_bankcard.getString("count(*)"));
// System.out.println(rs_bankcard.getString("count(*)"));
}
}
if
(!(
rs_bankcard
.
getString
(
"count(*)"
)).
equals
(
total
))
{
System
.
out
.
println
(
rs_bankcard
.
getRow
());
if
(!(
rs_bankcard
.
getRow
()+
""
).
equals
(
total
))
{
result
=
result
&&
false
;
result
=
result
&&
false
;
failReason
=
failReason
+
"total is not find;"
;
failReason
=
failReason
+
"total is not find;"
;
}
}
...
...
Api_auto_test/src/com/offcn/api/xyzb/operation_info.java
View file @
e818ea9e
...
@@ -68,7 +68,10 @@ public class operation_info extends XYZB implements API {
...
@@ -68,7 +68,10 @@ public class operation_info extends XYZB implements API {
@Override
@Override
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
public
String
handleOutput
(
Response
re
,
HashMap
<
String
,
Object
>
data
)
{
JsonPath
jp
=
re
.
body
().
jsonPath
();
JsonPath
jp
=
re
.
body
().
jsonPath
();
System
.
out
.
println
(
re
.
asString
());
boolean
result
=
true
;
boolean
result
=
true
;
String
failReason
=
""
;
String
failReason
=
""
;
...
@@ -122,21 +125,25 @@ public class operation_info extends XYZB implements API {
...
@@ -122,21 +125,25 @@ public class operation_info extends XYZB implements API {
String
weixintitle
=
jp
.
getString
(
"data.weixintitle"
);
String
weixintitle
=
jp
.
getString
(
"data.weixintitle"
);
String
weixinlink
=
jp
.
getString
(
"data.weixinlink"
);
String
weixinlink
=
jp
.
getString
(
"data.weixinlink"
);
weixinlink
=
MapUtil
.
killQuotes
(
weixinlink
,
"\""
);
String
weibotitle
=
jp
.
getString
(
"data.weibotitle"
);
String
weibotitle
=
jp
.
getString
(
"data.weibotitle"
);
weibotitle
=
MapUtil
.
killQuotes
(
weibotitle
,
"\""
);
String
weibolink
=
jp
.
getString
(
"data.weibolink"
);
String
weibolink
=
jp
.
getString
(
"data.weibolink"
);
weibolink
=
MapUtil
.
killQuotes
(
weibolink
,
"\""
);
String
qqgrouptitle
=
jp
.
getString
(
"data.qqgrouptitle"
);
String
qqgrouptitle
=
jp
.
getString
(
"data.qqgrouptitle"
);
qqgrouptitle
=
MapUtil
.
killQuotes
(
qqgrouptitle
,
"\""
);
String
qqgrouplink
=
jp
.
getString
(
"data.qqgrouplink"
);
String
qqgrouplink
=
jp
.
getString
(
"data.qqgrouplink"
);
qqgrouplink
=
MapUtil
.
killQuotes
(
qqgrouplink
,
"\""
);
String
updateTime
=
jp
.
getString
(
"data.updateTime"
);
String
updateTime
=
jp
.
getString
(
"data.updateTime"
);
// if(){
//
// }
weixinlink
=
MapUtil
.
killQuotes
(
weixinlink
,
"\""
);
weibotitle
=
MapUtil
.
killQuotes
(
weibotitle
,
"\""
);
weibolink
=
MapUtil
.
killQuotes
(
weibolink
,
"\""
);
qqgrouptitle
=
MapUtil
.
killQuotes
(
qqgrouptitle
,
"\""
);
qqgrouplink
=
MapUtil
.
killQuotes
(
qqgrouplink
,
"\""
);
updateTime
=
updateTime
.
substring
(
0
,
updateTime
.
length
()-
2
);
updateTime
=
updateTime
.
substring
(
0
,
updateTime
.
length
()-
2
);
try
{
try
{
...
...
Api_auto_test/src/com/offcn/api/xyzb/questions_get.java
View file @
e818ea9e
...
@@ -7,6 +7,7 @@ import java.sql.ResultSet;
...
@@ -7,6 +7,7 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.json.simple.JSONArray
;
import
org.json.simple.JSONArray
;
...
@@ -114,7 +115,9 @@ public class questions_get extends XYZB implements API {
...
@@ -114,7 +115,9 @@ public class questions_get extends XYZB implements API {
if
(
jp
.
getString
(
"data.data"
)
!=
null
)
{
if
(
jp
.
getString
(
"data.data"
)
!=
null
)
{
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
String
dataarr
[]
=
jp
.
getString
(
"data.data"
).
split
(
"answer"
);
String
dataarr
[]
=
jp
.
getString
(
"data.data"
).
split
(
"answer"
);
List
<
Object
>
list
=
jp
.
getList
(
"data.data"
);
// System.out.println(list.size());
// System.out.println(jp.getString("data.data"));
// System.out.println(jp.getString("data.data"));
// System.out.println(Current_room_id);
// System.out.println(Current_room_id);
...
@@ -128,7 +131,7 @@ public class questions_get extends XYZB implements API {
...
@@ -128,7 +131,7 @@ public class questions_get extends XYZB implements API {
// System.out.println(dataarr.length);
// System.out.println(dataarr.length);
// System.out.println(xyu_room_question.getRow());
// System.out.println(xyu_room_question.getRow());
if
(
xyu_room_question
.
getRow
()!=(
dataarr
.
length
-
1
))
{
if
(
xyu_room_question
.
getRow
()!=(
list
.
size
()
))
{
result
=
result
&&
false
;
result
=
result
&&
false
;
failReason
=
failReason
+
"xyu_room_question id is not find;"
;
failReason
=
failReason
+
"xyu_room_question id is not find;"
;
}
}
...
...
Api_auto_test/src/com/offcn/api/xyzb/room_info.java
View file @
e818ea9e
...
@@ -189,9 +189,10 @@ public class room_info extends XYZB implements API {
...
@@ -189,9 +189,10 @@ public class room_info extends XYZB implements API {
String
act_banned_time
=
String
.
valueOf
(
xyu_room_users
.
getString
(
xyu_room_users
.
findColumn
(
"banned_time"
)));
String
act_banned_time
=
String
.
valueOf
(
xyu_room_users
.
getString
(
xyu_room_users
.
findColumn
(
"banned_time"
)));
// String act_address = String.valueOf(xyu_room_users.getString(xyu_room_users.findColumn("address")));
// String act_address = String.valueOf(xyu_room_users.getString(xyu_room_users.findColumn("address")));
ResultSet
xyu_room_users_online
=
this
.
selectFromDB
(
ResultSet
xyu_room_users_online
=
this
.
selectFromDB
(
" xyu_room_users r "
,
" xyu_room_users r "
,
" r.room_num = '"
+
Current_room
+
"' and online = 1 "
);
" r.room_num = '"
+
Current_room
+
"' and online = 1
and enabled = 0
"
);
xyu_room_users_online
.
last
();
xyu_room_users_online
.
last
();
String
act_online
=
String
.
valueOf
(
xyu_room_users_online
.
getRow
());
String
act_online
=
String
.
valueOf
(
xyu_room_users_online
.
getRow
());
...
...
Api_auto_test/src/com/offcn/api/xyzb/suggest.java
View file @
e818ea9e
...
@@ -46,7 +46,8 @@ public class suggest extends XYZB implements API {
...
@@ -46,7 +46,8 @@ public class suggest extends XYZB implements API {
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
content
=
MapUtil
.
getParameter
(
parameter
,
"content"
).
trim
();
content
=
MapUtil
.
getParameter
(
parameter
,
"content"
).
trim
();
content
=
MapUtil
.
killQuotes
(
content
,
"\""
);
//去掉双引号的bankName
content
=
MapUtil
.
killQuotes
(
content
,
"\""
);
//去掉双引号的bankName
// 替换原来的parameter
// data.put("parameter", parameter);
return
data
;
return
data
;
}
}
...
...
Api_auto_test/src/com/offcn/listener/ProcessTestng.java
View file @
e818ea9e
...
@@ -37,11 +37,12 @@ public class ProcessTestng implements IInvokedMethodListener {
...
@@ -37,11 +37,12 @@ public class ProcessTestng implements IInvokedMethodListener {
public
void
afterInvocation
(
IInvokedMethod
method
,
ITestResult
result
)
{
public
void
afterInvocation
(
IInvokedMethod
method
,
ITestResult
result
)
{
// System.out.println(result.isSuccess());
// System.out.println(result.isSuccess());
if
(
result
.
isSuccess
()){
try
{
}
else
{
if
(
result
.
isSuccess
()){
//总体算法是第一个减去第二个数加1
}
else
{
Object
s
[]=
result
.
getParameters
();
//总体算法是第一个减去第二个数加1
//分离第二个参数的前后
Object
s
[]=
result
.
getParameters
();
//分离第二个参数的前后
String
TCNO
=
getParameter
(
Arrays
.
toString
(
s
),
"TCNO"
);
String
TCNO
=
getParameter
(
Arrays
.
toString
(
s
),
"TCNO"
);
// System.out.println("TCNO="+TCNO);
// System.out.println("TCNO="+TCNO);
String
[]
Parameters
=
TCNO
.
split
(
"_"
);
String
[]
Parameters
=
TCNO
.
split
(
"_"
);
...
@@ -49,15 +50,20 @@ public class ProcessTestng implements IInvokedMethodListener {
...
@@ -49,15 +50,20 @@ public class ProcessTestng implements IInvokedMethodListener {
NOTE
=
Parameter_before
;
NOTE
=
Parameter_before
;
String
Parameter_after
=
Parameters
[
1
];
String
Parameter_after
=
Parameters
[
1
];
int
NOTE_NO
=
Integer
.
parseInt
(
Parameter_after
.
trim
());
int
NOTE_NO
=
Integer
.
parseInt
(
Parameter_after
.
trim
());
//获取第一个参数的值
//获取第一个参数的值
String
TestNO
=
getParameter
(
Arrays
.
toString
(
s
),
"NO"
);
String
TestNO
=
getParameter
(
Arrays
.
toString
(
s
),
"NO"
);
int
Test_NO
=
Integer
.
parseInt
(
TestNO
);
int
Test_NO
=
Integer
.
parseInt
(
TestNO
);
//最终得数
//最终得数
int
su
=
Test_NO
-
NOTE_NO
;
int
su
=
Test_NO
-
NOTE_NO
;
//在记录本中记录
//在记录本中记录
for
(
int
i
=
su
;
i
<
Test_NO
;
i
++){
for
(
int
i
=
su
;
i
<
Test_NO
;
i
++){
treeSet
.
add
(
i
);
treeSet
.
add
(
i
);
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"测试通过,没有错误用例标号"
);
}
}
}
}
...
...
Api_auto_test/src/com/offcn/process/BasicsGM.java
View file @
e818ea9e
...
@@ -84,7 +84,7 @@ public abstract class BasicsGM {
...
@@ -84,7 +84,7 @@ public abstract class BasicsGM {
String
sql
;
String
sql
;
ResultSet
rs
=
null
;
ResultSet
rs
=
null
;
sql
=
" select count(*) from "
+
tableName
+
" where "
+
condition
;
sql
=
" select count(*) from "
+
tableName
+
" where "
+
condition
;
//
Log.logInfo(sql);
Log
.
logInfo
(
sql
);
rs
=
stmt
.
executeQuery
(
sql
);
rs
=
stmt
.
executeQuery
(
sql
);
return
rs
;
return
rs
;
...
...
Api_auto_test/src/resources/information.properties
View file @
e818ea9e
#
#Fri Sep 28 09:23:02 CST 2018
Running_xyzbteacher_password
=
2eedky11ck
Not_edited_xyzbhost_password
=
yare1pnbh5
Running_xyzbassistant_password
=
x40odgxxcg
Running_xyzbroom_nums
=
201809280005
Invalid_xyzbstudent_password
=
vxrv6yxxtv
Finished_xyzbroom_nums
=
201809280006
Enterprise_users
=
ys20180928092245
Invalid_xyzbroom_names
=
ys470425
Finished_xyzbhost_password
=
4epjvgzrso
Finished_xyzbteacher_password
=
gzqxwpmeh5
Not_edited_xyzbassistant_password
=
prma32xdhe
Finished_xyzbid
=
240
Running_xyzbstudent_password
=
gzqxwpmmiw
Business_Administrator
=
ys20180928092248
Not_edited_xyzbroom_names
=
ys658709
Running_xyzbid
=
239
Not_edited_xyzbid
=
242
Invalid_xyzbassistant_password
=
4epjvgzet6
Not_started_xyzbteacher_password
=
koep2enkhv
Finished_xyzbstudent_password
=
x40odgxjfv
Not_edited_xyzbroom_nums
=
201809280008
Finished_xyzbassistant_password
=
vxrv6yxmsr
Running_xyzbroom_names
=
ys589351
Not_started_xyzbhost_password
=
x40odgxlhj
Not_started_xyzbassistant_password
=
gzqxwpmnue
Invalid_xyzbhost_password
=
prma32xrir
Invalid_xyzbroom_nums
=
201809280007
Not_started_xyzbroom_nums
=
201809280004
Not_started_xyzbstudent_password
=
2eedky1lin
Finished_xyzbroom_names
=
ys870698
Invalid_xyzbid
=
241
Not_edited_xyzbteacher_password
=
vxrv6yx1f0
Running_xyzbhost_password
=
vxrv6yxxuv
Invalid_xyzbteacher_password
=
x40odgx4sv
Not_started_xyzbid
=
238
Not_started_xyzbroom_names
=
ys396382
Not_edited_xyzbstudent_password
=
4epjvgzlid
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