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
3cfea9c3
Commit
3cfea9c3
authored
Jan 04, 2021
by
fangyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
//
parent
78197541
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
65 deletions
+65
-65
src/main/java/com/live/cases/interactionLive/TestQueryCourseTrophy_B1.java
+65
-65
No files found.
src/main/java/com/live/cases/interactionLive/TestQueryCourseTrophy_B1.java
View file @
3cfea9c3
package
com
.
live
.
cases
.
interactionLive
;
//
package com.live.cases.interactionLive;
//
import
com.alibaba.fastjson.JSONObject
;
//
import com.alibaba.fastjson.JSONObject;
import
com.live.enums.ApiModele
;
//
import com.live.enums.ApiModele;
import
com.xiaomai.enums.RequestType
;
//
import com.xiaomai.enums.RequestType;
import
com.xiaomai.enums.Terminal
;
//
import com.xiaomai.enums.Terminal;
import
com.xiaomai.utils.XMBaseTest
;
//
import com.xiaomai.utils.XMBaseTest;
import
org.testng.Assert
;
//
import org.testng.Assert;
import
org.testng.annotations.BeforeMethod
;
//
import org.testng.annotations.BeforeMethod;
import
org.testng.annotations.Test
;
//
import org.testng.annotations.Test;
//
import
java.util.HashMap
;
//
import java.util.HashMap;
import
java.util.Map
;
//
import java.util.Map;
//
/**
/
//
**
* @author NHX
//
* @author NHX
* @Function app端查询课程奖杯
//
* @Function app端查询课程奖杯
* @Date 2020/11/19 15:01
//
* @Date 2020/11/19 15:01
*/
//
*/
public
class
TestQueryCourseTrophy_B1
extends
XMBaseTest
{
//
public class TestQueryCourseTrophy_B1 extends XMBaseTest {
//
@BeforeMethod
//
@BeforeMethod
public
void
beforeTest
()
{
//APP 每课学堂 手动滑块 登录成功
//
public void beforeTest() { //APP 每课学堂 手动滑块 登录成功
xmAppApi
.
setApiModule
(
ApiModele
.
CloudClass_File
)
// API 所属模块
//
xmAppApi.setApiModule(ApiModele.CloudClass_File) // API 所属模块
.
setApiName
(
"API_queryCourseTrophy"
)
// API 名称
//
.setApiName("API_queryCourseTrophy") // API 名称
.
setLoginUser
(
"NHX_app"
)
// http 接口,测试账号
//
.setLoginUser("NHX_app") // http 接口,测试账号
.
setTerminal
(
Terminal
.
APP_C
);
// 所属端位(B端,C端,M端等, 必传)
//
.setTerminal(Terminal.APP_C); // 所属端位(B端,C端,M端等, 必传)
//
dal
.
setCase_owner
(
"NHX"
)
//
dal.setCase_owner("NHX")
.
setCase_name
(
"app端查询课程奖杯:"
+
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
//
.setCase_name("app端查询课程奖杯:" + Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
//
super
.
beforeTest
();
//
super.beforeTest();
}
//
}
//
@Test
(
description
=
"app端查询课程奖杯"
)
//
@Test(description = "app端查询课程奖杯")
public
void
testLoadStudentListAPI
(){
//
public void testLoadStudentListAPI(){
//
Map
<
String
,
Object
>
bodyMap
=
new
HashMap
<>();
//
Map<String,Object> bodyMap = new HashMap<>();
bodyMap
.
put
(
"liveCourseId"
,
"1331202869891616769"
);
//
bodyMap.put("liveCourseId","1331202869891616769");
//
JSONObject
jsonBody
=
new
JSONObject
(
bodyMap
);
//
JSONObject jsonBody = new JSONObject(bodyMap);
String
data
=
jsonBody
.
toJSONString
();
//
String data = jsonBody.toJSONString();
//
//
System
.
out
.
println
(
"请求参数==========="
+
data
);
//
System.out.println("请求参数==========="+data);
//
//
headers
.
put
(
"content-type"
,
"application/json; charset=utf-8"
);
//
headers.put("content-type", "application/json; charset=utf-8");
headers
.
put
(
"user-agent"
,
"XM_C(HUAWEI;JKM-AL00b)"
);
//
headers.put("user-agent", "XM_C(HUAWEI;JKM-AL00b)");
headers
.
put
(
"vc"
,
"55"
);
//
headers.put("vc", "55");
headers
.
put
(
"devicetype"
,
"android"
);
//
headers.put("devicetype","android");
headers
.
put
(
"v"
,
"2.1.2.55.495"
);
//
headers.put("v", "2.1.2.55.495");
headers
.
put
(
"usertype"
,
"C"
);
//
headers.put("usertype","C");
headers
.
put
(
"vn"
,
"5.0.0"
);
//
headers.put("vn", "5.0.0");
headers
.
put
(
"userid"
,
"1145612151844098049"
);
//
headers.put("userid", "1145612151844098049");
headers
.
put
(
"phone"
,
"15210636896"
);
//
headers.put("phone", "15210636896");
//
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
data
,
headers
);
//
xmAppApi.doRequest(RequestType.JSON, params, data, headers);
JSONObject
jsonResponseBody
=
xmAppApi
.
getBodyInJSON
();
//
JSONObject jsonResponseBody = xmAppApi.getBodyInJSON();
Assert
.
assertEquals
(
jsonResponseBody
.
getString
(
"success"
),
"true"
,
"操作成功!"
);
//
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