|
226 | 226 | var newVal = {}; |
227 | 227 | for (var k in vi) { |
228 | 228 | newVal[k] = vi[k]; //提升性能 |
229 | | - try { |
230 | | - var tr = App.currentRemoteItem.TestRecord || {}; |
231 | | - var d = App.currentRemoteItem.Document || {}; |
232 | | - var standard = App.isMLEnabled ? tr.standard : tr.response; |
233 | | - var standardObj = StringUtil.isEmpty(standard, true) ? null : JSON.parse(standard); |
234 | | - var tests = App.tests[String(App.currentAccountIndex)] || {}; |
235 | | - var responseObj = (tests[d.id] || {})[0] |
236 | | - |
237 | | - var pathUri = (StringUtil.isEmpty(curPath, false) ? '' : curPath + '/') + k; |
238 | | - var pathKeys = StringUtil.split(pathUri, '/'); |
239 | | - var target = App.isMLEnabled ? JSONResponse.getStandardByPath(standardObj, pathKeys) : JSONResponse.getValByPath(standardObj, pathKeys); |
240 | | - var real = JSONResponse.getValByPath(responseObj, pathKeys); |
241 | | - var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, path) : JSONResponse.compareWithBefore(target, real, path); |
242 | | - cmp.path = pathUri; |
243 | | - var cmpShowObj = JSONResponse.getCompareShowObj(cmp); |
244 | | - thiz[k] = [cmpShowObj.compareType, cmpShowObj.compareColor, cmpShowObj.compareMessage]; |
245 | | - var countKey = '_$_' + cmpShowObj.compareColor + 'Count_$_'; |
246 | | - thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
247 | | - } catch (e) { |
248 | | - thiz[k] = [JSONResponse.COMPARE_ERROR, 'red', e.message]; |
249 | | - var countKey = '_$_redCount_$_'; |
250 | | - thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
| 229 | + if (App.isFullAssert) { |
| 230 | + try { |
| 231 | + var tr = App.currentRemoteItem.TestRecord || {}; |
| 232 | + var d = App.currentRemoteItem.Document || {}; |
| 233 | + var standard = App.isMLEnabled ? tr.standard : tr.response; |
| 234 | + var standardObj = StringUtil.isEmpty(standard, true) ? null : JSON.parse(standard); |
| 235 | + var tests = App.tests[String(App.currentAccountIndex)] || {}; |
| 236 | + var responseObj = (tests[d.id] || {})[0] |
| 237 | + |
| 238 | + var pathUri = (StringUtil.isEmpty(curPath, false) ? '' : curPath + '/') + k; |
| 239 | + var pathKeys = StringUtil.split(pathUri, '/'); |
| 240 | + var target = App.isMLEnabled ? JSONResponse.getStandardByPath(standardObj, pathKeys) : JSONResponse.getValByPath(standardObj, pathKeys); |
| 241 | + var real = JSONResponse.getValByPath(responseObj, pathKeys); |
| 242 | + var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, path) : JSONResponse.compareWithBefore(target, real, path); |
| 243 | + cmp.path = pathUri; |
| 244 | + var cmpShowObj = JSONResponse.getCompareShowObj(cmp); |
| 245 | + thiz[k] = [cmpShowObj.compareType, cmpShowObj.compareColor, cmpShowObj.compareMessage]; |
| 246 | + var countKey = '_$_' + cmpShowObj.compareColor + 'Count_$_'; |
| 247 | + thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
| 248 | + } catch (e) { |
| 249 | + thiz[k] = [JSONResponse.COMPARE_ERROR, 'red', e.message]; |
| 250 | + var countKey = '_$_redCount_$_'; |
| 251 | + thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
| 252 | + } |
251 | 253 | } |
252 | 254 |
|
253 | 255 | delete vi[k] |
|
283 | 285 | var newVal = {}; |
284 | 286 | for (var k in val) { |
285 | 287 | newVal[k] = val[k]; //提升性能 |
286 | | - try { |
287 | | - var tr = App.currentRemoteItem.TestRecord || {}; |
288 | | - var d = App.currentRemoteItem.Document || {}; |
289 | | - var standard = App.isMLEnabled ? tr.standard : tr.response; |
290 | | - var standardObj = StringUtil.isEmpty(standard, true) ? null : JSON.parse(standard); |
291 | | - var tests = App.tests[String(App.currentAccountIndex)] || {}; |
292 | | - var responseObj = (tests[d.id] || {})[0] |
293 | | - |
294 | | - var pathUri = (StringUtil.isEmpty(curPath, false) ? '' : curPath + '/') + k; |
295 | | - var pathKeys = StringUtil.split(pathUri, '/'); |
296 | | - var target = App.isMLEnabled ? JSONResponse.getStandardByPath(standardObj, pathKeys) : JSONResponse.getValByPath(standardObj, pathKeys); |
297 | | - var real = JSONResponse.getValByPath(responseObj, pathKeys); |
298 | | - // c = JSONResponse.compareWithBefore(target, real, path); |
299 | | - var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, path) : JSONResponse.compareWithBefore(target, real, path); |
300 | | - cmp.path = pathUri; |
301 | | - var cmpShowObj = JSONResponse.getCompareShowObj(cmp); |
302 | | - thiz[k] = [cmpShowObj.compareType, cmpShowObj.compareColor, cmpShowObj.compareMessage]; |
303 | | - var countKey = '_$_' + cmpShowObj.compareColor + 'Count_$_'; |
304 | | - thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
305 | | - } catch (e) { |
306 | | - thiz[k] = [JSONResponse.COMPARE_ERROR, 'red', e.message]; |
307 | | - var countKey = '_$_redCount_$_'; |
308 | | - thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
| 288 | + if (App.isFullAssert) { |
| 289 | + try { |
| 290 | + var tr = App.currentRemoteItem.TestRecord || {}; |
| 291 | + var d = App.currentRemoteItem.Document || {}; |
| 292 | + var standard = App.isMLEnabled ? tr.standard : tr.response; |
| 293 | + var standardObj = StringUtil.isEmpty(standard, true) ? null : JSON.parse(standard); |
| 294 | + var tests = App.tests[String(App.currentAccountIndex)] || {}; |
| 295 | + var responseObj = (tests[d.id] || {})[0] |
| 296 | + |
| 297 | + var pathUri = (StringUtil.isEmpty(curPath, false) ? '' : curPath + '/') + k; |
| 298 | + var pathKeys = StringUtil.split(pathUri, '/'); |
| 299 | + var target = App.isMLEnabled ? JSONResponse.getStandardByPath(standardObj, pathKeys) : JSONResponse.getValByPath(standardObj, pathKeys); |
| 300 | + var real = JSONResponse.getValByPath(responseObj, pathKeys); |
| 301 | + // c = JSONResponse.compareWithBefore(target, real, path); |
| 302 | + var cmp = App.isMLEnabled ? JSONResponse.compareWithStandard(target, real, path) : JSONResponse.compareWithBefore(target, real, path); |
| 303 | + cmp.path = pathUri; |
| 304 | + var cmpShowObj = JSONResponse.getCompareShowObj(cmp); |
| 305 | + thiz[k] = [cmpShowObj.compareType, cmpShowObj.compareColor, cmpShowObj.compareMessage]; |
| 306 | + var countKey = '_$_' + cmpShowObj.compareColor + 'Count_$_'; |
| 307 | + thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
| 308 | + } catch (e) { |
| 309 | + thiz[k] = [JSONResponse.COMPARE_ERROR, 'red', e.message]; |
| 310 | + var countKey = '_$_redCount_$_'; |
| 311 | + thiz[countKey] = thiz[countKey] == null ? 1 : thiz[countKey] + 1; |
| 312 | + } |
309 | 313 | } |
310 | 314 |
|
311 | 315 | delete val[k]; |
@@ -10405,6 +10409,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
10405 | 10409 | // }) |
10406 | 10410 | }, |
10407 | 10411 |
|
| 10412 | + isFullAssert: true, |
10408 | 10413 | toTestDocIndexes: [], |
10409 | 10414 |
|
10410 | 10415 | startTest: function (list, allCount, isRandom, accountIndex, isCross, callback) { |
@@ -10434,6 +10439,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
10434 | 10439 | }, |
10435 | 10440 |
|
10436 | 10441 | startTestSingle: function (list, allCount, index, item, isRandom, accountIndex, isCross, callback, singleCallback, ctx) { |
| 10442 | + this.isFullAssert = false |
10437 | 10443 | try { |
10438 | 10444 | const isMLEnabled = this.isMLEnabled |
10439 | 10445 | const standardKey = isMLEnabled != true ? 'response' : 'standard' |
@@ -10604,6 +10610,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
10604 | 10610 | }, |
10605 | 10611 |
|
10606 | 10612 | onTestResponse: function(res, allCount, list, index, it, d, r, tr, response, cmp, isRandom, accountIndex, justRecoverTest, isCross, callback, singleCallback) { |
| 10613 | + this.isFullAssert = false |
10607 | 10614 | tr = tr || {} |
10608 | 10615 | cmp = cmp || {} |
10609 | 10616 | tr.compare = cmp |
@@ -11227,6 +11234,8 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea |
11227 | 11234 | document = item.Document = item.Document || {} |
11228 | 11235 | } |
11229 | 11236 |
|
| 11237 | + this.isFullAssert = true |
| 11238 | + |
11230 | 11239 | var testRecord = item.TestRecord = item.TestRecord || {} |
11231 | 11240 | var pathKeys = StringUtil.split(path, '/') || []; |
11232 | 11241 | var pathNames = pathKeys.slice(0, pathKeys.length - 1); |
|
0 commit comments