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
4284c380
Commit
4284c380
authored
Feb 03, 2021
by
zhangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大班直播/大班互动-课堂报告
parent
2540a3bc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
230 additions
and
9 deletions
+230
-9
src/main/java/com/live/cases/interactionLive/TestConvertShortUrls.java
+60
-0
src/main/java/com/live/cases/interactionLive/TestGetClassReport.java
+0
-3
src/main/java/com/live/cases/interactionLive/TestGetLiveCourseRecordInfos.java
+0
-2
src/main/java/com/live/cases/interactionLive/TestGetStudentReport.java
+50
-0
src/main/java/com/live/cases/largeClassLive/TestConvertShortUrls_C.java
+60
-0
src/main/java/com/live/cases/largeClassLive/TestGetLiveCourseRecordInfos.java
+0
-2
src/main/java/com/live/cases/largeClassLive/TestGetStudentReport.java
+50
-0
src/main/resources/apicase/api-b.json
+3
-2
src/main/resources/apicase/apollo.json
+7
-0
No files found.
src/main/java/com/live/cases/interactionLive/TestConvertShortUrls.java
0 → 100644
View file @
4284c380
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Created by zhangying on 2020/02/02
*/
public
class
TestConvertShortUrls
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_convertShortUrls"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 大班互动-学生课堂报告二维码
*/
@Test
public
void
testConvertShortUrls
()
{
String
urls
=
"https://res.xiaomai5.com/h5/index.html#/live/cloud-class-report?courseId=1356798987214893057&"
+
"studentId=1235119596803903489&courseType=LARGE_CLASS_INTERACTION"
;
List
urlsList
=
new
ArrayList
();
urlsList
.
add
(
urls
);
System
.
out
.
println
(
"urlsList ="
+
urlsList
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"urls"
,
urlsList
);
System
.
out
.
println
(
"jsonObject ="
+
jsonObject
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"courseName ="
+
jsonBody
.
getJSONArray
(
"result"
).
getJSONObject
(
0
));
Assert
.
assertEquals
(
jsonBody
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"shortUrl"
),
"http://ixm5.cn/59Dii"
);
Assert
.
assertEquals
(
jsonBody
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"url"
),
urls
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/interactionLive/TestGetClassReport.java
View file @
4284c380
...
...
@@ -32,14 +32,11 @@ public class TestGetClassReport extends XMBaseTest {
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"courseId"
,
"1356798987214893057"
);
System
.
out
.
println
(
"jsonObject ="
+
jsonObject
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"courseName ="
+
jsonBody
.
getJSONObject
(
"result"
));
// Assert.assertNotEquals(jsonBody.getJSONObject("result").getJSONArray("visitorInfoVOList").size(), 0);
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"courseName"
),
"zy大班互动自动化测试(勿删)"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
...
...
src/main/java/com/live/cases/interactionLive/TestGetLiveCourseRecordInfos.java
View file @
4284c380
...
...
@@ -37,8 +37,6 @@ public class TestGetLiveCourseRecordInfos extends XMBaseTest {
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"courseName ="
+
jsonBody
);
System
.
out
.
println
(
"courseName ="
+
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"liveCourseId"
));
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"liveCourseId"
),
"1356798987214893057"
);
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"recordGenerate"
),
"true"
);
...
...
src/main/java/com/live/cases/interactionLive/TestGetStudentReport.java
0 → 100644
View file @
4284c380
package
com
.
live
.
cases
.
interactionLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* Created by zhangying on 2020/02/03
*/
public
class
TestGetStudentReport
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getStudentReport"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
System
.
out
.
println
(
xmAppApi
);
}
/**
* 大班互动-查看学员课堂报告
*/
@Test
public
void
testGetStudentReport
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"courseId"
,
"1356798987214893057"
);
jsonObject
.
put
(
"studentId"
,
"1235119596803903489"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"studentId"
),
"1235119596803903489"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/largeClassLive/TestConvertShortUrls_C.java
0 → 100644
View file @
4284c380
package
com
.
live
.
cases
.
largeClassLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* Created by zhangying on 2020/02/03
*/
public
class
TestConvertShortUrls_C
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_B
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_convertShortUrls"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
}
/**
* 大班直播-学生课堂报告二维码
*/
@Test
public
void
testConvertShortUrls
()
{
String
urls
=
"https://res.xiaomai5.com/h5/index.html#/live/cloud-class-report?courseId=1356196461296828418&"
+
"studentId=1235119596803903489&courseType=LARGE_CLASS_LIVE"
;
List
urlsList
=
new
ArrayList
();
urlsList
.
add
(
urls
);
System
.
out
.
println
(
"urlsList ="
+
urlsList
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"urls"
,
urlsList
);
System
.
out
.
println
(
"jsonObject ="
+
jsonObject
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"courseName ="
+
jsonBody
.
getJSONArray
(
"result"
).
getJSONObject
(
0
));
Assert
.
assertEquals
(
jsonBody
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"shortUrl"
),
"http://ixm5.cn/59DkD"
);
Assert
.
assertEquals
(
jsonBody
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"url"
),
urls
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/java/com/live/cases/largeClassLive/TestGetLiveCourseRecordInfos.java
View file @
4284c380
...
...
@@ -43,8 +43,6 @@ public class TestGetLiveCourseRecordInfos extends XMBaseTest {
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"courseName ="
+
jsonBody
);
System
.
out
.
println
(
"courseName ="
+
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"liveCourseId"
));
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"liveCourseId"
),
"1356196461296828418"
);
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"recordGenerate"
),
"true"
);
...
...
src/main/java/com/live/cases/largeClassLive/TestGetStudentReport.java
0 → 100644
View file @
4284c380
package
com
.
live
.
cases
.
largeClassLive
;
import
com.alibaba.fastjson.JSONObject
;
import
com.live.enums.ApiModele
;
import
com.live.enums.RequestType
;
import
com.live.enums.Terminal
;
import
com.live.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
/**
* Created by zhangying on 2020/02/03
*/
public
class
TestGetStudentReport
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
()
{
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_apollo
)
// API 所属模块 必传 读取配置文件config.properties配置的api地址
.
setApiName
(
"API_getStudentReport"
)
// API 名称 必传
.
setLoginUser
(
"zhangy-b"
)
// http 接口,测试账号 必传
.
setTerminal
(
Terminal
.
B
);
// 所属端位(B端,C端,M端等, 必传)
super
.
beforeTest
();
System
.
out
.
println
(
xmAppApi
);
}
/**
* 大班直播-查看学员课堂报告
*/
@Test
public
void
testGetStudentReport
()
{
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"courseId"
,
"1356196461296828418"
);
jsonObject
.
put
(
"studentId"
,
"1235119596803903489"
);
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
);
System
.
out
.
println
(
xmAppApi
);
JSONObject
jsonBody
=
xmAppApi
.
getBodyInJSON
();
System
.
out
.
println
(
"jsonBody ="
+
jsonBody
);
Assert
.
assertEquals
(
jsonBody
.
getJSONObject
(
"result"
).
getString
(
"studentId"
),
"1235119596803903489"
);
Assert
.
assertEquals
(
"true"
,
jsonBody
.
getString
(
"success"
));
Assert
.
assertEquals
(
"200"
,
jsonBody
.
getString
(
"code"
));
Assert
.
assertEquals
(
"操作成功!"
,
jsonBody
.
getString
(
"message"
));
}
}
src/main/resources/apicase/api-b.json
View file @
4284c380
...
...
@@ -152,7 +152,7 @@
"API_convertShortUrls"
:
{
"apiPath"
:
"/sales/public/businessShow/convertShortUrls"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"
直播课分享
"
,
"desc"
:
"
直播课分享
"
"apiName"
:
"
转成短链接
"
,
"desc"
:
"
转成短链接
"
}
}
\ No newline at end of file
src/main/resources/apicase/apollo.json
View file @
4284c380
...
...
@@ -151,5 +151,11 @@
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"查看学员直播课上课记录"
,
"desc"
:
"查看学员上课记录"
},
"API_getStudentReport"
:
{
"apiPath"
:
"/apollo/anon/businessLive/getStudentReport"
,
"apiContentType"
:
"application/json;charset=utf-8"
,
"apiName"
:
"查看学员课堂报告"
,
"desc"
:
"查看学员课堂报告"
}
}
\ No newline at end of file
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