test_allMembersRanking.py
3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
'''
Author: jipeigong 2017年7月19日17:53:38
'''
from atdd.MobileApiTest import MobileApiTest
from tests.Integral.IntergralAPP.test_getDepartments import GetDepartments
class AllMembersRanking(MobileApiTest):
interfaceUrl = "/Integral/Api/Integral/GetAllRanking"
def setUp(self):
self.do_login()
# 积分排名->参数为空
def test_ranking_none(self):
result = self.MobileApiTest(self.interfaceUrl)
print(result)
return result
# 积分排名->总排行
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_all(self):
data = {
"ranking_type": 1
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
return result
# 积分排名->日排行
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_day(self):
data = {
"ranking_type": 2
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
return result
# 积分排名->周排行
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_week(self):
data = {
"ranking_type": 3
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
return result
# 积分排名->月排行
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_month(self):
data = {
"ranking_type": 4
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
return result
# 该员工所有上级部门的排名->总排名
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_dpId_all(self):
dpIdList = GetDepartments().member_dpID() # 部门ID list
for i in range(len(dpIdList)):
data = {
"dp_id": dpIdList[i],
"ranking_type": 1
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
# 该员工所有上级部门的排名->日排名
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_dpId_day(self):
dpIdList = GetDepartments().member_dpID() # 部门ID list
for i in range(len(dpIdList)):
data = {
"dp_id": dpIdList[i],
"ranking_type": 2
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
# 该员工所有上级部门的排名->周排名
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_dpId_week(self):
dpIdList = GetDepartments().member_dpID() # 部门ID list
for i in range(len(dpIdList)):
data = {
"dp_id": dpIdList[i],
"ranking_type": 3
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)
# 该员工所有上级部门的排名->月排名
# ranking_type: 1-总排行 2-日排行 3-周排行 4-月排行
def test_ranking_dpId_month(self):
dpIdList = GetDepartments().member_dpID() # 部门ID list
for i in range(len(dpIdList)):
data = {
"dp_id": dpIdList[i],
"ranking_type": 4
}
result = self.MobileApiTest(self.interfaceUrl, data)
print(result)