Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oto
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
龚小红
oto
Commits
9bd9a213
Commit
9bd9a213
authored
Mar 18, 2021
by
张艳玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
8c6caa31
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
162 additions
and
23 deletions
+162
-23
AdminAuthorization.java
src/test/java/com/kjj/cases/live/AdminAuthorization.java
+12
-11
CloseLive.java
src/test/java/com/kjj/cases/live/CloseLive.java
+38
-0
LiveMaterial.java
src/test/java/com/kjj/cases/live/LiveMaterial.java
+1
-1
OpenLive.java
src/test/java/com/kjj/cases/live/OpenLive.java
+32
-0
SaveAndUpdate.java
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
+4
-0
BasicConfig.java
src/test/java/com/kjj/config/BasicConfig.java
+20
-4
LiveConstants.java
src/test/java/com/kjj/constants/LiveConstants.java
+29
-0
liveTestNG.xml
src/test/liveTestNG.xml
+23
-6
testNG.xml
src/test/testNG.xml
+3
-1
No files found.
src/test/java/com/kjj/cases/live/AdminAuthorization.java
View file @
9bd9a213
package
com
.
kjj
.
cases
.
live
;
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.NetworkUtils
;
import
com.kjj.utils.NetworkUtils
;
import
static
com
.
kjj
.
config
.
BasicConfig
.*;
import
static
com
.
kjj
.
config
.
BasicConfig
.
AUTH_KEY
;
/**
/**
* 管理员授权
* 管理员授权
* @author zhanghuifeng
* @author 喜洋洋
* date 2021/2/20-13:46
*/
*/
public
interface
AdminAuthorization
{
public
interface
AdminAuthorization
{
...
@@ -17,9 +12,8 @@ public interface AdminAuthorization {
...
@@ -17,9 +12,8 @@ public interface AdminAuthorization {
default
void
adminAuth
(){
default
void
adminAuth
(){
// 创建用户 并传到network里
// 创建用户 并传到network里
// BasicConfig.AUTH_KEY = BaseUtils.createAuthKey();
network
.
agentCookies
.
put
(
"authKey"
,
ADMIN_KEY
);
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
ADMIN_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
}
}
...
@@ -28,9 +22,16 @@ public interface AdminAuthorization {
...
@@ -28,9 +22,16 @@ public interface AdminAuthorization {
*/
*/
default
void
agentAuth
(){
default
void
agentAuth
(){
// 创建用户 并传到network里
// 创建用户 并传到network里
// BasicConfig.AUTH_KEY = BaseUtils.agentAuthKey();
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
network
.
agentCookies
.
put
(
"authKey"
,
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
AUTH_KEY
);
/**
* 访客授权
*/
}
default
void
visitorAuth
()
{
network
.
agentCookies
.
put
(
"authKey"
,
VISITORKEY
);
System
.
out
.
println
(
"用户AUTH_KEY:"
+
VISITORKEY
);
}
}
}
}
src/test/java/com/kjj/cases/live/CloseLive.java
0 → 100644
View file @
9bd9a213
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
CloseLive
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
adminAuth
();
}
@Test
(
description
=
"结束直播"
,
priority
=
1
)
public
void
closeLive
()
{
Map
<
String
,
Object
>
closeParam
=
new
HashMap
<>();
closeParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
closeParam
.
put
(
"cid"
,
101
);
Response
closeRes
=
network
.
postResponse
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
);
Object
data
=
closeRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
closeParam
,
BasicConfig
.
ANCHOR_CLOSE
,
"结束直播失败"
,
closeRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/LiveMaterial.java
View file @
9bd9a213
...
@@ -20,7 +20,7 @@ public class LiveMaterial implements AdminAuthorization {
...
@@ -20,7 +20,7 @@ public class LiveMaterial implements AdminAuthorization {
@BeforeClass
@BeforeClass
public
void
setUp
()
{
public
void
setUp
()
{
adminAuth
();
//
adminAuth();
BaseUtils
.
ssoLogin
();
BaseUtils
.
ssoLogin
();
}
}
...
...
src/test/java/com/kjj/cases/live/OpenLive.java
0 → 100644
View file @
9bd9a213
package
com
.
kjj
.
cases
.
live
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
io.restassured.response.Response
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
OpenLive
implements
AdminAuthorization
{
@BeforeClass
public
void
setUp
()
{
adminAuth
();
}
@Test
(
description
=
"开始直播"
,
priority
=
1
)
public
void
开启直播
()
{
Map
<
String
,
Object
>
openParam
=
new
HashMap
<>();
openParam
.
put
(
"liveid"
,
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
()));
openParam
.
put
(
"cid"
,
101
);
Response
openRes
=
network
.
postResponse
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
);
Object
data
=
openRes
.
jsonPath
().
getJsonObject
(
"data"
);
System
.
out
.
println
(
data
);
Assert
.
assertNotNull
(
data
,
network
.
message
(
openParam
,
BasicConfig
.
ANCHOR_OPEN
,
"开启直播失败"
,
openRes
.
body
().
asString
()));
}
}
src/test/java/com/kjj/cases/live/SaveAndUpdate.java
View file @
9bd9a213
...
@@ -4,6 +4,7 @@ import com.kjj.bean.AnswerBean;
...
@@ -4,6 +4,7 @@ import com.kjj.bean.AnswerBean;
import
com.kjj.bean.AnswerListBean
;
import
com.kjj.bean.AnswerListBean
;
import
com.kjj.bean.RewardPkBean
;
import
com.kjj.bean.RewardPkBean
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.config.BasicConfig
;
import
com.kjj.constants.LiveConstants
;
import
com.kjj.utils.BaseUtils
;
import
com.kjj.utils.BaseUtils
;
import
io.restassured.response.Response
;
import
io.restassured.response.Response
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
...
@@ -42,7 +43,10 @@ public class SaveAndUpdate implements AdminAuthorization {
...
@@ -42,7 +43,10 @@ public class SaveAndUpdate implements AdminAuthorization {
Response
response
=
network
.
postResponse
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
);
Response
response
=
network
.
postResponse
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
);
liveID
=
response
.
jsonPath
().
getString
(
"data"
);
liveID
=
response
.
jsonPath
().
getString
(
"data"
);
System
.
out
.
println
(
liveID
);
System
.
out
.
println
(
liveID
);
LiveConstants
.
setValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
(),
liveID
);
Assert
.
assertNotNull
(
liveID
,
network
.
message
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
,
"新增直播失败"
,
response
.
body
().
asString
()));
Assert
.
assertNotNull
(
liveID
,
network
.
message
(
saveAndUpdateParam
,
BasicConfig
.
MANAGER_SAVEANDUPDATE
,
"新增直播失败"
,
response
.
body
().
asString
()));
LiveConstants
.
getValue
(
LiveConstants
.
StringKeyEnum
.
LIVE_ID
.
getKey
());
}
}
@Test
(
description
=
"查询直播配置"
,
priority
=
2
)
@Test
(
description
=
"查询直播配置"
,
priority
=
2
)
...
...
src/test/java/com/kjj/config/BasicConfig.java
View file @
9bd9a213
...
@@ -4,7 +4,7 @@ public class BasicConfig {
...
@@ -4,7 +4,7 @@ public class BasicConfig {
public
static
int
apiCount
;
//接口数量统计
public
static
int
apiCount
;
//接口数量统计
// 是否开启钉钉机器人推送
// 是否开启钉钉机器人推送
public
static
final
boolean
isPushReport
=
tru
e
;
//true
public
static
final
boolean
isPushReport
=
fals
e
;
//true
// 代理人微信昵称
// 代理人微信昵称
public
static
final
String
WECHAT_NAME
=
"嘿保险"
;
//true
public
static
final
String
WECHAT_NAME
=
"嘿保险"
;
//true
...
@@ -12,8 +12,14 @@ public class BasicConfig {
...
@@ -12,8 +12,14 @@ public class BasicConfig {
// 代理人的openid(固定)
// 代理人的openid(固定)
public
static
final
String
OPEN_ID
=
"osi5w5ggFiEXk0tPJH9b0KO_XU08"
;
public
static
final
String
OPEN_ID
=
"osi5w5ggFiEXk0tPJH9b0KO_XU08"
;
// 直播用户 authkey
//直播管理员(嘿 保险)
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnsxqTYbFAJqyMsZZMjY2ByyE2firpRpwm9mdHVU19iqNmyyDTwuCHEYT2URmtEUV7LRD7nU"
;
public
static
String
ADMIN_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY1XcX7aBeCVXnN9q7y4raLKHyfe7RFy96seJBQ9NSPqtdNg8JjgUTDUcMu8pjJVo6Js6"
;
// 直播代理人 (艳玲)
public
static
String
AUTH_KEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKorVWS9R85xTeuUZzyc2boHSYWYU56ttSUbcAb9ngEb3LJBB3qZ7a9eCkEoPV5yu"
;
//直播访客 (嘿 保险)
public
static
String
VISITORKEY
=
"LEH7epeHVDJWzhZ6DiexTHnfZY2NrKnNHmHY52FxaDfigK3U4NQpLsQrodQUPUXwmumQ1kr3xsfZoGw7cEswYryWfUtMW"
;
// 基础线代理人 TKU
// 基础线代理人 TKU
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
public
static
String
AGENT_TKU
=
"T3gM31f18jCFEcfoYxvVk1LsF5T1YkcBNDbUaryi3TgvwatuP6mroJjZ2k7iCHjC9Srujh7k311i3vFuZm"
;
...
@@ -42,10 +48,19 @@ public class BasicConfig {
...
@@ -42,10 +48,19 @@ public class BasicConfig {
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
MANAGER_HOST
=
"https://kjj-mng.duibatest.com.cn"
;
public
static
final
String
ANCHOR_HOST
=
"https://live.duibatest.com.cn"
;
//手机端地址
//手机端地址
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
public
static
final
String
MOBILE_HOST
=
"https://live.duibatest.com.cn"
;
// *************** 直播 ***************
// *************** 主播端 ***************
public
static
final
String
ANCHOR_OPEN
=
ANCHOR_HOST
+
"/conf/live/open"
;
public
static
final
String
ANCHOR_CLOSE
=
ANCHOR_HOST
+
"/conf/live/close"
;
public
static
final
String
ANCHOR_ADDQUESTION
=
ANCHOR_HOST
+
"/kjy/live/assist/question/addQuestion"
;
// *************** 直播管理端 ***************
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
public
static
final
String
MANAGER_SAVEANDUPDATE
=
MANAGER_HOST
+
"/kjy/manager/live/pre/conf/saveAndUpdate"
;
public
static
final
String
MANAGER_GETCONFDETAIL
=
MANAGER_HOST
+
"/kjy/manager/live/conf/getConfDetail"
;
public
static
final
String
MANAGER_GETCONFDETAIL
=
MANAGER_HOST
+
"/kjy/manager/live/conf/getConfDetail"
;
...
@@ -80,6 +95,7 @@ public class BasicConfig {
...
@@ -80,6 +95,7 @@ public class BasicConfig {
public
static
final
String
MANAGER_SAVEORUPDATE7
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/saveOrUpdate"
;
public
static
final
String
MANAGER_SAVEORUPDATE7
=
MANAGER_HOST
+
"/kjy/manager/welfare/pre/conf/saveOrUpdate"
;
// *************** 代理人 ***************
// *************** 代理人 ***************
//代理人列表//
//代理人列表//
...
...
src/test/java/com/kjj/constants/LiveConstants.java
0 → 100644
View file @
9bd9a213
package
com
.
kjj
.
constants
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
LiveConstants
{
private
static
final
Map
<
Integer
,
String
>
stringMap
=
new
HashMap
<>();
public
static
String
getValue
(
Integer
key
){
return
stringMap
.
get
(
key
)
;
}
public
static
void
setValue
(
Integer
key
,
String
value
){
stringMap
.
put
(
key
,
value
);
}
@Getter
@AllArgsConstructor
public
enum
StringKeyEnum
{
LIVE_ID
(
1
,
"直播ID的key"
),
;
private
Integer
key
;
private
String
desc
;
}
}
src/test/liveTestNG.xml
View file @
9bd9a213
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite
name=
"直播"
verbose=
"1"
thread-count=
"3"
>
<suite
name=
"直播"
verbose=
"1"
thread-count=
"3"
>
<test
preserve-order=
"true"
name=
"创建直播"
>
<test
preserve-order=
"true"
name=
"直播素材"
>
<classes>
<class
name=
"com.kjj.cases.live.LiveMaterial"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"创建直播"
>
<classes>
<class
name=
"com.kjj.cases.live.SaveAndUpdate"
/>
</classes>
</test>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.
SaveAndUpdate
"
/>
<class
name=
"com.kjj.cases.live.
Procurator
"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"代理人首页"
>
<test
preserve-order=
"true"
name=
"助播-开启直播"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.
Procurator
"
/>
<class
name=
"com.kjj.cases.live.
OpenLive
"
/>
</classes>
</classes>
</test>
</test>
<test
preserve-order=
"true"
name=
"
直播素材
"
>
<test
preserve-order=
"true"
name=
"
助播-结束直播
"
>
<classes>
<classes>
<class
name=
"com.kjj.cases.live.
LiveMaterial
"
/>
<class
name=
"com.kjj.cases.live.
CloseLive
"
/>
</classes>
</classes>
</test>
</test>
</suite>
</suite>
src/test/testNG.xml
View file @
9bd9a213
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite
name=
"客集集"
verbose=
"1"
thread-count=
"3"
>
<suite
name=
"客集集"
verbose=
"1"
thread-count=
"3"
>
<suite-files>
<suite-files>
<suite-file
path=
"wechatTestNG.xml"
></suite-file>
<suite-file
path=
"liveTestNG.xml"
></suite-file>
<suite-file
path=
"liveTestNG.xml"
></suite-file>
<!-- <suite-file path="wechatTestNG.xml"></suite-file>-->
</suite-files>
</suite-files>
<!-- 监听器-->
<!-- 监听器-->
<listeners>
<listeners>
...
...
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