Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-autotest-live
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-autotest-live
Commits
748a20e0
Commit
748a20e0
authored
Dec 01, 2020
by
niuhaixing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充云课堂接口
parent
2349535d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
340 additions
and
0 deletions
+340
-0
src/main/java/com/live/cases/interactionLive/TestGetLargeClassLiveList_B.java
+57
-0
src/main/java/com/live/cases/interactionLive/TestGetStudentInstLinkageList_C.java
+53
-0
src/main/java/com/live/cases/interactionLive/TestGetUserDisk_B.java
+54
-0
src/main/java/com/live/cases/interactionLive/TestQueryCourseTrophy_B.java
+54
-0
src/main/java/com/live/cases/interactionLive/TestQueryCourseTrophy_B1.java
+65
-0
src/main/java/com/live/cases/interactionLive/TestQueryStudentCourse_C.java
+57
-0
No files found.
src/main/java/com/live/cases/interactionLive/TestGetLargeClassLiveList_B.java
0 → 100644
View file @
748a20e0
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function B端查询大班直播列表
* @Date 2020/11/19 15:01
*/
public
class
TestGetLargeClassLiveList_B
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_File
)
// API 所属模块
.
setApiName
(
"API_getLargeClassLiveList"
)
// API 名称
.
setLoginUser
(
"NHX_b"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"B端查询大班直播列表:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"B端查询大班直播列表"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
bodyMap
.
put
(
"current"
,
1
);
bodyMap
.
put
(
"size"
,
1
);
bodyMap
.
put
(
"instId"
,
"1009415524133634144"
);
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
//headers.put("userId","1145612151844098049");
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
src/main/java/com/live/cases/interactionLive/TestGetStudentInstLinkageList_C.java
0 → 100644
View file @
748a20e0
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function C端获取学生信息列表
* @Date 2020/11/19 15:01
*/
public
class
TestGetStudentInstLinkageList_C
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_customerLive
)
// API 所属模块
.
setApiName
(
"API_getStudentInstLinkageList"
)
// API 名称
.
setLoginUser
(
"NHX_c"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
C
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"C端获取学生信息列表:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"C端获取学生信息列表"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
// "exception": "java.lang.IllegalArgumentException: userId不能为空; headers加userId
headers
.
put
(
"userId"
,
"1145612151844098049"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
src/main/java/com/live/cases/interactionLive/TestGetUserDisk_B.java
0 → 100644
View file @
748a20e0
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function B端直播课 获取用户磁盘
* @Date 2020/11/21 20:11
*/
public
class
TestGetUserDisk_B
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_File
)
// API 所属模块
.
setApiName
(
"API_getGetUserDisk"
)
// API 名称
.
setLoginUser
(
"NHX_b"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"B端直播课 获取用户磁盘:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"B端直播课 获取用户磁盘"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
src/main/java/com/live/cases/interactionLive/TestQueryCourseTrophy_B.java
0 → 100644
View file @
748a20e0
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function B端查询课程奖杯
* @Date 2020/11/19 15:01
*/
public
class
TestQueryCourseTrophy_B
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_File
)
// API 所属模块
.
setApiName
(
"API_queryCourseTrophy"
)
// API 名称
.
setLoginUser
(
"NHX_b"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"B端查询课程奖杯:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"B端查询课程奖杯"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
bodyMap
.
put
(
"liveCourseId"
,
"1331156473166794754"
);
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
//headers.put("userId","1145612151844098049");
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
src/main/java/com/live/cases/interactionLive/TestQueryCourseTrophy_B1.java
0 → 100644
View file @
748a20e0
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function app端查询课程奖杯
* @Date 2020/11/19 15:01
*/
public
class
TestQueryCourseTrophy_B1
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
//APP 每课学堂 手动滑块 登录成功
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_File
)
// API 所属模块
.
setApiName
(
"API_queryCourseTrophy"
)
// API 名称
.
setLoginUser
(
"NHX_app"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
APP_C
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"app端查询课程奖杯:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"app端查询课程奖杯"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
bodyMap
.
put
(
"liveCourseId"
,
"1331202869891616769"
);
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
headers
.
put
(
"content-type"
,
"application/json; charset=utf-8"
);
headers
.
put
(
"user-agent"
,
"XM_C(HUAWEI;JKM-AL00b)"
);
headers
.
put
(
"vc"
,
"55"
);
headers
.
put
(
"devicetype"
,
"android"
);
headers
.
put
(
"v"
,
"2.1.2.55.495"
);
headers
.
put
(
"usertype"
,
"C"
);
headers
.
put
(
"vn"
,
"5.0.0"
);
headers
.
put
(
"userid"
,
"1145612151844098049"
);
headers
.
put
(
"phone"
,
"15210636896"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
src/main/java/com/live/cases/interactionLive/TestQueryStudentCourse_C.java
0 → 100644
View file @
748a20e0
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @author NHX
* @Function C端查询学生直播课程
* @Date 2020/11/21 21:11
*/
public
class
TestQueryStudentCourse_C
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_customerLive
)
// API 所属模块
.
setApiName
(
"API_queryStudentCourse"
)
// API 名称
.
setLoginUser
(
"NHX_c"
)
// http 接口,测试账号
.
setTerminal
(
Terminal
.
C
);
// 所属端位(B端,C端,M端等, 必传)
dal
.
setCase_owner
(
"NHX"
)
.
setCase_name
(
"C端查询学生直播课程:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"C端查询学生直播课程"
)
public
void
testLoadStudentListAPI
(){
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
bodyMap
.
put
(
"startTime"
,
"1605801600000"
);
bodyMap
.
put
(
"endTime"
,
"1605888000000"
);
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
String
data
=
jsonBody
.
toJSONString
();
System
.
out
.
println
(
"请求参数==========="
+
data
);
headers
.
put
(
"userId"
,
"1145612151844098049"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
}
}
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