Commit 7484865ee388c06a150f056c6291148b79f2cb59
1 parent
9364bd51
add
Showing
7 changed files
with
256 additions
and
92 deletions
tests/Integral/UC_jifen/tes_default_list.py
@@ -15,6 +15,7 @@ class DefaultList(ATDDCase): | @@ -15,6 +15,7 @@ class DefaultList(ATDDCase): | ||
15 | header_json = {"Content-Type": "application/json; charset=utf-8"} | 15 | header_json = {"Content-Type": "application/json; charset=utf-8"} |
16 | url = self.uc_host + '/a/' + self.domain + '/' + self.app + "/qy/integral/default/list" | 16 | url = self.uc_host + '/a/' + self.domain + '/' + self.app + "/qy/integral/default/list" |
17 | data = { | 17 | data = { |
18 | + | ||
18 | } | 19 | } |
19 | print(url, json.dumps(data)) | 20 | print(url, json.dumps(data)) |
20 | result = self.post(url, None, json=data, headers=header_json) | 21 | result = self.post(url, None, json=data, headers=header_json) |
tests/Integral/UC_xuefen/test_course_center.py
@@ -15,6 +15,33 @@ class CourseCenter(ATDDCase): | @@ -15,6 +15,33 @@ class CourseCenter(ATDDCase): | ||
15 | def setUp(self): | 15 | def setUp(self): |
16 | pass | 16 | pass |
17 | 17 | ||
18 | + # 课程中心-单课程学习 | ||
19 | + def test_one_learning(self): | ||
20 | + data = { | ||
21 | + "memUid": self.jipeihong_uid, | ||
22 | + "businessKey": self.businessKey, | ||
23 | + "businessAct": "one_learning", | ||
24 | + "businessId": "2", | ||
25 | + "triggerTypes": [ | ||
26 | + | ||
27 | + { | ||
28 | + "triggerKey": "complete", # 完成(枚举类型)单个 | ||
29 | + "value": 2, | ||
30 | + "remark": "课程中心-单课程学习_完成(枚举类型)单个" | ||
31 | + }, | ||
32 | + { | ||
33 | + "triggerKey": "number", # 完成单课程数(循环类型)全局 | ||
34 | + "value": 2, | ||
35 | + "remark": "课程中心-单课程学习_成单课程数(循环类型)全局", | ||
36 | + } | ||
37 | + ] | ||
38 | + } | ||
39 | + result = self.post(self.url, json.dumps(data), headers=self.header_json) | ||
40 | + code = result.json()['code'] | ||
41 | + self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用 | ||
42 | + self.assertEquals(code, 'SUCCESS') | ||
43 | + print(result.json()) | ||
44 | + | ||
18 | # 课程中心-单课程测评 | 45 | # 课程中心-单课程测评 |
19 | def test_one_evaluation(self): | 46 | def test_one_evaluation(self): |
20 | print(self.triggerKeyDict) | 47 | print(self.triggerKeyDict) |
@@ -26,20 +53,27 @@ class CourseCenter(ATDDCase): | @@ -26,20 +53,27 @@ class CourseCenter(ATDDCase): | ||
26 | "memUid": self.jipeihong_uid, | 53 | "memUid": self.jipeihong_uid, |
27 | "businessKey": self.businessKey, | 54 | "businessKey": self.businessKey, |
28 | "businessAct": "one_evaluation", | 55 | "businessAct": "one_evaluation", |
29 | - "remark": "课程中心-单课程测评", | ||
30 | - "businessId": "123", | 56 | + "businessId": "111", |
31 | "triggerTypes": [ | 57 | "triggerTypes": [ |
32 | { | 58 | { |
33 | - "triggerKey": "pass", #通过(枚举类型)单个 | ||
34 | - "value": self.triggerValueDict['one_evaluation-pass'][0]['condition'] | 59 | + "triggerKey": "pass", # 通过(枚举类型)单个 |
60 | + "value": self.triggerValueDict['one_evaluation-pass'][0]['condition'], | ||
61 | + "remark": "课程中心-单课程测评" | ||
62 | + }, | ||
63 | + { | ||
64 | + "triggerKey": "pass_rate", # 通过题数百分比(阈值类型)单个 | ||
65 | + "value": self.triggerValueDict['one_evaluation-pass_rate'][0]['condition'], | ||
66 | + "remark": "课程中心-单课程测评" | ||
35 | }, | 67 | }, |
36 | { | 68 | { |
37 | - "triggerKey": "pass_rate", #通过题数百分比(阈值类型)单个 | ||
38 | - "value": self.triggerValueDict['one_evaluation-pass_rate'][0]['condition'] | 69 | + "triggerKey": "pass_number", # 通过单课程数(循环类型)全局 |
70 | + "value": self.triggerValueDict['one_evaluation-pass_number'][0]['condition'], | ||
71 | + "remark": "课程中心-单课程测评" | ||
39 | }, | 72 | }, |
40 | { | 73 | { |
41 | - "triggerKey": "pass_number", #通过单课程数(循环类型)全局 | ||
42 | - "value": self.triggerValueDict['one_evaluation-pass_number'][0]['condition'] | 74 | + "triggerKey": "number", |
75 | + "value": self.triggerValueDict['one_evaluation-number'][0]['condition'], | ||
76 | + "remark": "课程中心-单课程测评" | ||
43 | } | 77 | } |
44 | ] | 78 | ] |
45 | } | 79 | } |
@@ -49,8 +83,8 @@ class CourseCenter(ATDDCase): | @@ -49,8 +83,8 @@ class CourseCenter(ATDDCase): | ||
49 | self.assertEquals(code, 'SUCCESS') | 83 | self.assertEquals(code, 'SUCCESS') |
50 | print(result.json()) | 84 | print(result.json()) |
51 | 85 | ||
52 | - # 课程中心-通过测评课程数 | ||
53 | - def test_pass_exam_business(self): | 86 | + # 课程中心-系列课程学习 |
87 | + def test_child_learning(self): | ||
54 | print(self.triggerKeyDict) | 88 | print(self.triggerKeyDict) |
55 | print("\n") | 89 | print("\n") |
56 | print(self.triggerValueDict) | 90 | print(self.triggerValueDict) |
@@ -58,13 +92,18 @@ class CourseCenter(ATDDCase): | @@ -58,13 +92,18 @@ class CourseCenter(ATDDCase): | ||
58 | data = { | 92 | data = { |
59 | "memUid": self.jipeihong_uid, | 93 | "memUid": self.jipeihong_uid, |
60 | "businessKey": self.businessKey, | 94 | "businessKey": self.businessKey, |
61 | - "businessAct": "pass_exam_business", | ||
62 | - "remark": "课程中心-通过测评课程数", | ||
63 | - "businessId": "456", | 95 | + "businessAct": "child_learning", |
96 | + "businessId": "12334", | ||
64 | "triggerTypes": [ | 97 | "triggerTypes": [ |
65 | { | 98 | { |
66 | - "triggerKey": "pass_exam_business_num", # 通过测评课程数(循环类型)全局 | ||
67 | - "value": self.triggerValueDict['pass_exam_business-pass_exam_business_num'][0]['condition'] | 99 | + "triggerKey": "complete", # 通过(枚举类型)单个 |
100 | + "value": self.triggerValueDict['child_learning-complete'][0]['condition'], | ||
101 | + "remark": "课程中心-系列课程学习" | ||
102 | + }, | ||
103 | + { | ||
104 | + "triggerKey": "complete_number", # 通过题数百分比(阈值类型)单个 | ||
105 | + "value": self.triggerValueDict['child_learning-complete_number'][0]['condition'], | ||
106 | + "remark": "课程中心-系列课程学习" | ||
68 | } | 107 | } |
69 | ] | 108 | ] |
70 | } | 109 | } |
@@ -74,27 +113,23 @@ class CourseCenter(ATDDCase): | @@ -74,27 +113,23 @@ class CourseCenter(ATDDCase): | ||
74 | self.assertEquals(code, 'SUCCESS') | 113 | self.assertEquals(code, 'SUCCESS') |
75 | print(result.json()) | 114 | print(result.json()) |
76 | 115 | ||
77 | - | ||
78 | - # 课程中心-系列课程测评 | ||
79 | - def test_child_evaluation(self): | 116 | + # 课程中心-系列课程子课程测评 |
117 | + def test_series_child_evaluation(self): | ||
80 | data = { | 118 | data = { |
81 | "memUid": self.jipeihong_uid, | 119 | "memUid": self.jipeihong_uid, |
82 | "businessKey": self.businessKey, | 120 | "businessKey": self.businessKey, |
83 | - "businessAct": "child_evaluation", | ||
84 | - "remark": "课程中心-系列课程测评", | 121 | + "businessAct": "series_child_evaluation", |
85 | "businessId": "22", | 122 | "businessId": "22", |
86 | "triggerTypes": [ | 123 | "triggerTypes": [ |
87 | { | 124 | { |
88 | "triggerKey": "pass", # 通过(枚举类型)单个 | 125 | "triggerKey": "pass", # 通过(枚举类型)单个 |
89 | - "value": 2 | 126 | + "value": self.triggerValueDict['series_child_evaluation-pass'][0]['condition'], |
127 | + "remark": "课程中心-系列课程子课程测评" | ||
90 | }, | 128 | }, |
91 | { | 129 | { |
92 | "triggerKey": "pass_rate", # 通过题数百分比(阈值类型)单个 | 130 | "triggerKey": "pass_rate", # 通过题数百分比(阈值类型)单个 |
93 | - "value": 2 | ||
94 | - }, | ||
95 | - { | ||
96 | - "triggerKey": "pass_number", # 通过系列课程数(循环类型)全局 | ||
97 | - "value": 2 | 131 | + "value": self.triggerValueDict['series_child_evaluation-pass_rate'][0]['condition'], |
132 | + "remark": "课程中心-系列课程子课程测评" | ||
98 | } | 133 | } |
99 | ] | 134 | ] |
100 | } | 135 | } |
@@ -104,24 +139,28 @@ class CourseCenter(ATDDCase): | @@ -104,24 +139,28 @@ class CourseCenter(ATDDCase): | ||
104 | self.assertEquals(code, 'SUCCESS') | 139 | self.assertEquals(code, 'SUCCESS') |
105 | print(result.json()) | 140 | print(result.json()) |
106 | 141 | ||
107 | - | ||
108 | - | ||
109 | - # 课程中心-系列课程学习 | ||
110 | - def test_child_learning(self): | 142 | + # 课程中心-系列课程测评 |
143 | + def test_child_evaluation(self): | ||
111 | data = { | 144 | data = { |
112 | "memUid": self.jipeihong_uid, | 145 | "memUid": self.jipeihong_uid, |
113 | "businessKey": self.businessKey, | 146 | "businessKey": self.businessKey, |
114 | - "businessAct": "child_learning", | ||
115 | - "remark": "课程中心-系列课程学习", | ||
116 | - "businessId": "1", | 147 | + "businessAct": "child_evaluation", |
148 | + "businessId": "22", | ||
117 | "triggerTypes": [ | 149 | "triggerTypes": [ |
118 | { | 150 | { |
119 | - "triggerKey": "complete", # 完成(枚举类型)单个 | ||
120 | - "value": 2 | 151 | + "triggerKey": "pass", |
152 | + "value": 2, | ||
153 | + "remark": "课程中心-系列课程测评" | ||
154 | + }, | ||
155 | + { | ||
156 | + "triggerKey": "pass_rate", | ||
157 | + "value": 2, | ||
158 | + "remark": "课程中心-系列课程测评" | ||
121 | }, | 159 | }, |
122 | { | 160 | { |
123 | - "triggerKey": "complete_number", # 完成系列课程数(循环类型)全局 | ||
124 | - "value": 2 | 161 | + "triggerKey": "pass_number", |
162 | + "value": 2, | ||
163 | + "remark": "课程中心-系列课程测评" | ||
125 | } | 164 | } |
126 | ] | 165 | ] |
127 | } | 166 | } |
@@ -131,7 +170,6 @@ class CourseCenter(ATDDCase): | @@ -131,7 +170,6 @@ class CourseCenter(ATDDCase): | ||
131 | self.assertEquals(code, 'SUCCESS') | 170 | self.assertEquals(code, 'SUCCESS') |
132 | print(result.json()) | 171 | print(result.json()) |
133 | 172 | ||
134 | - | ||
135 | # 课程中心-学习时长 | 173 | # 课程中心-学习时长 |
136 | def test_learned_time(self): | 174 | def test_learned_time(self): |
137 | data = { | 175 | data = { |
@@ -139,11 +177,11 @@ class CourseCenter(ATDDCase): | @@ -139,11 +177,11 @@ class CourseCenter(ATDDCase): | ||
139 | "businessId": "1", | 177 | "businessId": "1", |
140 | "businessKey": self.businessKey, | 178 | "businessKey": self.businessKey, |
141 | "businessAct": "learned_time", | 179 | "businessAct": "learned_time", |
142 | - "remark": "课程中心-学习时长", | ||
143 | "triggerTypes": [ | 180 | "triggerTypes": [ |
144 | { | 181 | { |
145 | "triggerKey": "learned_time_total", # 时长(循环类型)全局 | 182 | "triggerKey": "learned_time_total", # 时长(循环类型)全局 |
146 | - "value": 2 | 183 | + "value": 2, |
184 | + "remark": "课程中心-学习时长" | ||
147 | } | 185 | } |
148 | ] | 186 | ] |
149 | } | 187 | } |
@@ -153,19 +191,18 @@ class CourseCenter(ATDDCase): | @@ -153,19 +191,18 @@ class CourseCenter(ATDDCase): | ||
153 | self.assertEquals(code, 'SUCCESS') | 191 | self.assertEquals(code, 'SUCCESS') |
154 | print(result.json()) | 192 | print(result.json()) |
155 | 193 | ||
156 | - | ||
157 | # 课程中心-点赞课程 | 194 | # 课程中心-点赞课程 |
158 | def test_like(self): | 195 | def test_like(self): |
159 | data = { | 196 | data = { |
160 | "memUid": self.jipeihong_uid, | 197 | "memUid": self.jipeihong_uid, |
161 | "businessKey": self.businessKey, | 198 | "businessKey": self.businessKey, |
162 | "businessAct": "like", | 199 | "businessAct": "like", |
163 | - "remark": "课程中心-点赞课程", | ||
164 | "businessId": "1", | 200 | "businessId": "1", |
165 | "triggerTypes": [ | 201 | "triggerTypes": [ |
166 | { | 202 | { |
167 | "triggerKey": "like_num", # 次数(循环类型)全局 | 203 | "triggerKey": "like_num", # 次数(循环类型)全局 |
168 | - "value": 2 | 204 | + "value": 2, |
205 | + "remark": "课程中心-点赞课程" | ||
169 | } | 206 | } |
170 | ] | 207 | ] |
171 | } | 208 | } |
@@ -175,19 +212,18 @@ class CourseCenter(ATDDCase): | @@ -175,19 +212,18 @@ class CourseCenter(ATDDCase): | ||
175 | self.assertEquals(code, 'SUCCESS') | 212 | self.assertEquals(code, 'SUCCESS') |
176 | print(result.json()) | 213 | print(result.json()) |
177 | 214 | ||
178 | - | ||
179 | - # 课程中心-收藏课程 | 215 | + # 课程中心-收藏课程 |
180 | def test_collect(self): | 216 | def test_collect(self): |
181 | data = { | 217 | data = { |
182 | "memUid": self.jipeihong_uid, | 218 | "memUid": self.jipeihong_uid, |
183 | "businessKey": self.businessKey, | 219 | "businessKey": self.businessKey, |
184 | "businessAct": "collect_num", | 220 | "businessAct": "collect_num", |
185 | - "remark": "课程中心-收藏课程", | ||
186 | "businessId": "1", | 221 | "businessId": "1", |
187 | "triggerTypes": [ | 222 | "triggerTypes": [ |
188 | { | 223 | { |
189 | "triggerKey": "like_num", # 次数(循环类型)全局 | 224 | "triggerKey": "like_num", # 次数(循环类型)全局 |
190 | - "value": 2 | 225 | + "value": 2, |
226 | + "remark": "课程中心-收藏课程" | ||
191 | } | 227 | } |
192 | ] | 228 | ] |
193 | } | 229 | } |
@@ -203,16 +239,17 @@ class CourseCenter(ATDDCase): | @@ -203,16 +239,17 @@ class CourseCenter(ATDDCase): | ||
203 | "memUid": self.jipeihong_uid, | 239 | "memUid": self.jipeihong_uid, |
204 | "businessKey": self.businessKey, | 240 | "businessKey": self.businessKey, |
205 | "businessAct": "comment", | 241 | "businessAct": "comment", |
206 | - "remark": "课程中心-评论课程", | ||
207 | "businessId": "1", | 242 | "businessId": "1", |
208 | "triggerTypes": [ | 243 | "triggerTypes": [ |
209 | { | 244 | { |
210 | "triggerKey": "comment_num", # 次数(循环类型)全局 | 245 | "triggerKey": "comment_num", # 次数(循环类型)全局 |
211 | - "value": 2 | 246 | + "value": 2, |
247 | + "remark": "课程中心-评论课程" | ||
212 | }, | 248 | }, |
213 | { | 249 | { |
214 | "triggerKey": "comment_business_num", # 门数(循环类型)全局 | 250 | "triggerKey": "comment_business_num", # 门数(循环类型)全局 |
215 | - "value": 2 | 251 | + "value": 2, |
252 | + "remark": "课程中心-评论课程" | ||
216 | } | 253 | } |
217 | ] | 254 | ] |
218 | } | 255 | } |
@@ -222,50 +259,23 @@ class CourseCenter(ATDDCase): | @@ -222,50 +259,23 @@ class CourseCenter(ATDDCase): | ||
222 | self.assertEquals(code, 'SUCCESS') | 259 | self.assertEquals(code, 'SUCCESS') |
223 | print(result.json()) | 260 | print(result.json()) |
224 | 261 | ||
225 | - | ||
226 | - # 课程中心-单课程学习 | ||
227 | - def test_one_learning(self): | ||
228 | - data = { | ||
229 | - "memUid": self.jipeihong_uid, | ||
230 | - "businessKey": self.businessKey, | ||
231 | - "businessAct": "one_learning", | ||
232 | - "remark": "课程中心-单课程学习", | ||
233 | - "businessId": "1", | ||
234 | - "triggerTypes": [ | ||
235 | - { | ||
236 | - "triggerKey": "complete", # 完成(枚举类型)单个 | ||
237 | - "value": 2 | ||
238 | - }, | ||
239 | - { | ||
240 | - "triggerKey": "number", # 完成单课程数(循环类型)全局 | ||
241 | - "value": 2 | ||
242 | - } | ||
243 | - ] | ||
244 | - } | ||
245 | - result = self.post(self.url, json.dumps(data), headers=self.header_json) | ||
246 | - code = result.json()['code'] | ||
247 | - self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用 | ||
248 | - self.assertEquals(code, 'SUCCESS') | ||
249 | - print(result.json()) | ||
250 | - | ||
251 | - | ||
252 | # 课程中心-分享课程 | 262 | # 课程中心-分享课程 |
253 | def test_shared(self): | 263 | def test_shared(self): |
254 | data = { | 264 | data = { |
255 | "memUid": self.jipeihong_uid, | 265 | "memUid": self.jipeihong_uid, |
256 | "businessKey": self.businessKey, | 266 | "businessKey": self.businessKey, |
257 | "businessAct": "shared", | 267 | "businessAct": "shared", |
258 | - "remark": "课程中心-分享课程", | ||
259 | "businessId": "1", | 268 | "businessId": "1", |
260 | "triggerTypes": [ | 269 | "triggerTypes": [ |
261 | { | 270 | { |
262 | "triggerKey": "shared_num", # 次数(循环类型)全局 | 271 | "triggerKey": "shared_num", # 次数(循环类型)全局 |
263 | - "value": 2 | 272 | + "value": 1, |
273 | + "remark": "课程中心-分享课程" | ||
264 | } | 274 | } |
265 | ] | 275 | ] |
266 | } | 276 | } |
267 | result = self.post(self.url, json.dumps(data), headers=self.header_json) | 277 | result = self.post(self.url, json.dumps(data), headers=self.header_json) |
268 | code = result.json()['code'] | 278 | code = result.json()['code'] |
269 | - self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用 | 279 | + # self.assertNotEquals(code, 'INTEGRAL_RULE_NDAYOT_OPEN') # 积分策略没有启用 |
270 | self.assertEquals(code, 'SUCCESS') | 280 | self.assertEquals(code, 'SUCCESS') |
271 | print(result.json()) | 281 | print(result.json()) |
272 | \ No newline at end of file | 282 | \ No newline at end of file |
tests/Integral/UC_xuefen/test_default_update.py
0 → 100644
1 | +from atdd.ATDDCase import ATDDCase | ||
2 | +from tests.Integral.publicMethods import PCpublicMethods | ||
3 | + | ||
4 | + | ||
5 | +# 修改默认积分策略——课程中心 | ||
6 | +class DefaultUpdate(ATDDCase): | ||
7 | + url = ATDDCase().host + '/' + ATDDCase().domain + "/Integral/Apicp/Integral/UpdateDefaultList" | ||
8 | + businessKey = "course_center" | ||
9 | + triggerKeyDict = PCpublicMethods.PCpublicMethods().getTriggerKey(businessKey) | ||
10 | + triggerValueDict = PCpublicMethods.PCpublicMethods().getTriggerValue(businessKey) | ||
11 | + | ||
12 | + def setUp(self): | ||
13 | + pass | ||
14 | + | ||
15 | + # 分享课程 | ||
16 | + def test_update_shared(self): | ||
17 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | ||
18 | + data = { | ||
19 | + "miType": "mi_type1", | ||
20 | + "enable": 1, # 启用 | ||
21 | + "businessKey": self.businessKey, | ||
22 | + "businessName": "课程中心", | ||
23 | + "businessAct": "shared", | ||
24 | + "businessActName": "分享课程", | ||
25 | + "triggers": [ | ||
26 | + { | ||
27 | + "triggerKey": "shared_num", | ||
28 | + "triggerName": "次数", | ||
29 | + "unit": "次", | ||
30 | + "computeType": 1, | ||
31 | + "enabled": True, | ||
32 | + "triggerValue": [ | ||
33 | + { | ||
34 | + "condition": "1", | ||
35 | + "score": self.triggerValueDict['shared-shared_num'][0]['condition'] | ||
36 | + } | ||
37 | + ] | ||
38 | + } | ||
39 | + ] | ||
40 | + } | ||
41 | + result = self.post(self.url, json=data, headers=header_json) | ||
42 | + print(self.url) | ||
43 | + print(result.json()) | ||
44 | + | ||
45 | + # 单课程学习 | ||
46 | + def test_update_one_learning(self): | ||
47 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | ||
48 | + data = { | ||
49 | + "miType": "mi_type1", | ||
50 | + "enable": 1, # 启用 | ||
51 | + "businessKey": self.businessKey, | ||
52 | + "businessName": "课程中心", | ||
53 | + "businessAct": "one_learning", | ||
54 | + "businessActName": "单课程学习", | ||
55 | + "triggers": [ | ||
56 | + { | ||
57 | + "triggerKey": "complete", | ||
58 | + "triggerName": "完成", | ||
59 | + "unit": "次", | ||
60 | + "computeType": 2, | ||
61 | + "enabled": True, | ||
62 | + "applicableScope": 2, | ||
63 | + "triggerValue": [ | ||
64 | + { | ||
65 | + "condition": "1", | ||
66 | + "score": 5 | ||
67 | + } | ||
68 | + ] | ||
69 | + }, | ||
70 | + { | ||
71 | + "triggerKey": "number", | ||
72 | + "triggerName": "完成单课程数", | ||
73 | + "unit": "门", | ||
74 | + "computeType": 1, | ||
75 | + "enabled": True, | ||
76 | + "triggerValue": [ | ||
77 | + { | ||
78 | + "condition": "5", | ||
79 | + "score": 30 | ||
80 | + } | ||
81 | + ] | ||
82 | + } | ||
83 | + ] | ||
84 | + | ||
85 | + } | ||
86 | + result = self.post(self.url, json=data, headers=header_json) | ||
87 | + print(self.url) | ||
88 | + print(result.json()) | ||
89 | + | ||
90 | + # 单课程测评 | ||
91 | + def test_update_one_evaluation(self): | ||
92 | + header_json = {"Content-Type": "application/json; charset=utf-8"} | ||
93 | + data = { | ||
94 | + "miType": "mi_type1", | ||
95 | + "enable": 1, # 启用 | ||
96 | + "businessKey": self.businessKey, | ||
97 | + "businessName": "课程中心", | ||
98 | + "businessAct": "one_evaluation", | ||
99 | + "businessActName": "单课程测评", | ||
100 | + "triggers": [ | ||
101 | + { | ||
102 | + "triggerKey": "pass", | ||
103 | + "triggerName": "通过", | ||
104 | + "unit": "次", | ||
105 | + "computeType": 2, | ||
106 | + "enabled": True, | ||
107 | + "applicableScope": 2, | ||
108 | + "triggerValue": [ | ||
109 | + { | ||
110 | + "condition": "1", | ||
111 | + "score": 10 | ||
112 | + } | ||
113 | + ] | ||
114 | + }, | ||
115 | + { | ||
116 | + "triggerKey": "number", | ||
117 | + "triggerName": "通过题数百分比", | ||
118 | + "unit": "%", | ||
119 | + "computeType": 4, | ||
120 | + "enabled": True, | ||
121 | + "triggerValue": [ | ||
122 | + { | ||
123 | + "condition": "60", | ||
124 | + "score": 2 | ||
125 | + }, | ||
126 | + { | ||
127 | + "condition": "80", | ||
128 | + "score": 5 | ||
129 | + }, | ||
130 | + { | ||
131 | + "condition": "100", | ||
132 | + "score": 10 | ||
133 | + } | ||
134 | + ] | ||
135 | + }, | ||
136 | + { | ||
137 | + "triggerKey": "pass_number", | ||
138 | + "triggerName": "通过单课程数", | ||
139 | + "unit": "门", | ||
140 | + "computeType": 1, | ||
141 | + "enabled": True, | ||
142 | + "triggerValue": [ | ||
143 | + { | ||
144 | + "condition": "5", | ||
145 | + "score": 60 | ||
146 | + } | ||
147 | + ] | ||
148 | + } | ||
149 | + ] | ||
150 | + } | ||
151 | + result = self.post(self.url, json=data, headers=header_json) | ||
152 | + print(self.url) | ||
153 | + print(result.json()) | ||
0 | \ No newline at end of file | 154 | \ No newline at end of file |
tests/Integral/UC_xuefen/test_integralIndexList.py
@@ -8,12 +8,12 @@ class IntegralIndexList(ATDDCase): | @@ -8,12 +8,12 @@ class IntegralIndexList(ATDDCase): | ||
8 | pass | 8 | pass |
9 | 9 | ||
10 | def test_integralIndexList(self): | 10 | def test_integralIndexList(self): |
11 | - app = "integral" | 11 | + app = "yuanquan" |
12 | header_json = {"Content-Type": "application/json; charset=utf-8"} | 12 | header_json = {"Content-Type": "application/json; charset=utf-8"} |
13 | url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/integralIndexList" | 13 | url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/integralIndexList" |
14 | data = { | 14 | data = { |
15 | "memUid": self.jipeihong_uid, | 15 | "memUid": self.jipeihong_uid, |
16 | - "miType": "mi_type1" | 16 | + "miType": "mi_type0" |
17 | } | 17 | } |
18 | result = self.post(url, json=data, headers=header_json) | 18 | result = self.post(url, json=data, headers=header_json) |
19 | print(url) | 19 | print(url) |
tests/Integral/UC_xuefen/test_member_list.py
@@ -12,7 +12,7 @@ class MemberList(ATDDCase): | @@ -12,7 +12,7 @@ class MemberList(ATDDCase): | ||
12 | header_json = {"Content-Type": "application/json; charset=utf-8"} | 12 | header_json = {"Content-Type": "application/json; charset=utf-8"} |
13 | url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/member-list" | 13 | url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/member-list" |
14 | data = { | 14 | data = { |
15 | - "pageNum": 2, | 15 | + "pageNum": 1, |
16 | "miType": "mi_type1" | 16 | "miType": "mi_type1" |
17 | } | 17 | } |
18 | result = self.post(url, json=data, headers=header_json) | 18 | result = self.post(url, json=data, headers=header_json) |
tests/Integral/UC_xuefen/test_update.py
@@ -9,17 +9,17 @@ class Update(ATDDCase): | @@ -9,17 +9,17 @@ class Update(ATDDCase): | ||
9 | 9 | ||
10 | # 增加积分 | 10 | # 增加积分 |
11 | def test_update_add(self): | 11 | def test_update_add(self): |
12 | - app = "yuanquan" | ||
13 | header_json = {"Content-Type": "application/json; charset=utf-8"} | 12 | header_json = {"Content-Type": "application/json; charset=utf-8"} |
14 | - url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/update" | 13 | + url = self.uc_host + "/a/" + self.domain + "/" + self.app + "/qy/integral/update" |
15 | data = { | 14 | data = { |
16 | "milOptType": 2, | 15 | "milOptType": 2, |
17 | "miType": "mi_type1", | 16 | "miType": "mi_type1", |
18 | - "integral": 100, | 17 | + "integral": 1, |
19 | "uids": self.jipeihong_uid, | 18 | "uids": self.jipeihong_uid, |
20 | "remark": "测试", | 19 | "remark": "测试", |
21 | "milCreateMemUsername": "季培红", | 20 | "milCreateMemUsername": "季培红", |
22 | - "milCreateMemUid": self.jipeihong_uid | 21 | + "milCreateMemUid": self.jipeihong_uid, |
22 | + "msgIdentifier": self.app | ||
23 | } | 23 | } |
24 | result = self.post(url, json=data, headers=header_json) | 24 | result = self.post(url, json=data, headers=header_json) |
25 | print(url) | 25 | print(url) |
@@ -27,17 +27,17 @@ class Update(ATDDCase): | @@ -27,17 +27,17 @@ class Update(ATDDCase): | ||
27 | 27 | ||
28 | # 扣减积分 | 28 | # 扣减积分 |
29 | def test_update_detection(self): | 29 | def test_update_detection(self): |
30 | - app = "yuanquan" | ||
31 | header_json = {"Content-Type": "application/json; charset=utf-8"} | 30 | header_json = {"Content-Type": "application/json; charset=utf-8"} |
32 | - url = self.uc_host + "/a/" + self.domain + "/" + app + "/qy/integral/update" | 31 | + url = self.uc_host + "/a/" + self.domain + "/" + self.app + "/qy/integral/update" |
33 | data = { | 32 | data = { |
34 | "milOptType": 3, | 33 | "milOptType": 3, |
35 | "miType": "mi_type0", | 34 | "miType": "mi_type0", |
36 | - "integral": 22, | 35 | + "integral": 99999, |
37 | "uids": self.jipeihong_uid, | 36 | "uids": self.jipeihong_uid, |
38 | "remark": "测试", | 37 | "remark": "测试", |
39 | "milCreateMemUsername": "季培红", | 38 | "milCreateMemUsername": "季培红", |
40 | - "milCreateMemUid": self.jipeihong_uid | 39 | + "milCreateMemUid": self.jipeihong_uid, |
40 | + "msgIdentifier": self.app | ||
41 | } | 41 | } |
42 | result = self.post(url, json=data, headers=header_json) | 42 | result = self.post(url, json=data, headers=header_json) |
43 | print(url) | 43 | print(url) |
tests/Integral/publicMethods/PCpublicMethods.py
@@ -126,7 +126,7 @@ class PCpublicMethods(PcPost): | @@ -126,7 +126,7 @@ class PCpublicMethods(PcPost): | ||
126 | 126 | ||
127 | # 积分策略:获取业务应用的触发行为的value,并构造成字典 | 127 | # 积分策略:获取业务应用的触发行为的value,并构造成字典 |
128 | # 参数:businessKey | 128 | # 参数:businessKey |
129 | - def getTriggerValue(self,businessKey): | 129 | + def getTriggerValue(self, businessKey): |
130 | 130 | ||
131 | self.do_login(self.host, self.mobile, self.psw, self.domain) | 131 | self.do_login(self.host, self.mobile, self.psw, self.domain) |
132 | interfaceUrl = "/Integral/Apicp/Integral/DefaultList" | 132 | interfaceUrl = "/Integral/Apicp/Integral/DefaultList" |