Skip to content

Commit 1420413

Browse files
committed
解决回归测试场景串联用例点帐号后死循环;解决错误吗断言报错 toUpperCase is not function
1 parent c0fce08 commit 1420413

2 files changed

Lines changed: 25 additions & 17 deletions

File tree

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/apijson/JSONResponse.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ var JSONResponse = {
198198
obj = obj[JSONResponse.KEY_CODE];
199199
}
200200

201-
return obj == JSONResponse.CODE_SUCCESS || obj == 200 || (obj != null && (obj.toUpperCase() == "OK" || obj.toUpperCase() == "SUCCESS" || obj.toUpperCase() == "SUCCEED"))
201+
return obj == JSONResponse.CODE_SUCCESS || obj == 200 || (typeof obj == 'string' && (obj.toUpperCase() == "OK" || obj.toUpperCase() == "SUCCESS" || obj.toUpperCase() == "SUCCEED"))
202202
},
203203

204204
/**校验服务端是否存在table
@@ -210,9 +210,6 @@ var JSONResponse = {
210210
},
211211

212212

213-
214-
215-
216213
/**格式化key名称
217214
* @param object
218215
* @return

‎APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js/main.js‎

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4573,7 +4573,7 @@ https://github.com/Tencent/APIJSON/issues
45734573
}
45744574
},
45754575

4576-
onClickAccount: function (index, item, callback) {
4576+
onClickAccount: function (index, item, callback, noShowCase) {
45774577
this.isReportShow = false
45784578
var accounts = this.accounts
45794579
var num = accounts == null ? 0 : accounts.length
@@ -4605,10 +4605,10 @@ https://github.com/Tencent/APIJSON/issues
46054605
this.changeScriptType(App.scriptType)
46064606

46074607
var accountIdStr = String(item != null && item.isLoggedIn ? item.id || 0 : 0)
4608-
var tests = this.isCrossEnabled && this.isStatisticsEnabled && this.reportId != null && this.reportId > 0 ? this.tests[accountIdStr] : null
4608+
var tests = App.doneCount >= App.allCount && noShowCase != true && this.isCrossEnabled && this.isStatisticsEnabled && this.reportId != null && this.reportId > 0 ? this.tests[accountIdStr] : null
46094609
if (JSONObject.isEmpty(tests) != true) {
46104610
this.showCompare4TestCaseList(true)
4611-
if (! this.isTestCaseShow) {
4611+
if (App.deepDoneCount >= App.deepAllCount && ! this.isTestCaseShow) {
46124612
this.showCompare4RandomList(true, false)
46134613
this.showCompare4RandomList(true, true)
46144614
}
@@ -4675,7 +4675,7 @@ https://github.com/Tencent/APIJSON/issues
46754675
callback(true, index, err)
46764676
}
46774677

4678-
if (App.isCrossEnabled && App.isStatisticsEnabled && App.reportId != null && App.reportId > 0) {
4678+
if (App.doneCount >= App.allCount && noShowCase != true && App.isStatisticsEnabled && App.reportId != null && App.reportId > 0) {
46794679
if (item != null) {
46804680
item.isLoggedIn = true
46814681
}
@@ -4684,7 +4684,7 @@ https://github.com/Tencent/APIJSON/issues
46844684
var tests = App.tests[accountIdStr]
46854685
if (JSONObject.isEmpty(tests) != true) {
46864686
App.showCompare4TestCaseList(true)
4687-
if (! App.isTestCaseShow) {
4687+
if (App.deepDoneCount >= App.deepAllCount && ! App.isTestCaseShow) {
46884688
App.showCompare4RandomList(true, false)
46894689
App.showCompare4RandomList(true, true)
46904690
}
@@ -4754,7 +4754,7 @@ https://github.com/Tencent/APIJSON/issues
47544754
this.showLogin(true, false)
47554755
},
47564756

4757-
showCompare4TestCaseList: function (show) {
4757+
showCompare4TestCaseList: function (show, isCheckAccount) {
47584758
var testCases = show ? App.testCases : null
47594759
var allCount = testCases == null ? 0 : testCases.length
47604760
App.allCount = allCount
@@ -4787,7 +4787,7 @@ https://github.com/Tencent/APIJSON/issues
47874787
continue
47884788
}
47894789

4790-
var chain = item.Chain
4790+
var chain = isCheckAccount ? item.Chain : null
47914791
var testInfo = chain == null ? null : chain.testInfo
47924792
var testAccount = testInfo == null ? null : testInfo.account
47934793
if (StringUtil.isNotEmpty(testAccount, true)) {
@@ -4816,7 +4816,7 @@ https://github.com/Tencent/APIJSON/issues
48164816

48174817
var isStatisticsEnabled = this.isStatisticsEnabled
48184818
this.isStatisticsEnabled = false
4819-
// this.onClickAccount(accounts.length - 1, testInfo)
4819+
this.onClickAccount(accounts.length - 1, testInfo, null, true)
48204820
this.isStatisticsEnabled = isStatisticsEnabled
48214821
}
48224822
map[chain.testAccountId] = true
@@ -5356,7 +5356,7 @@ https://github.com/Tencent/APIJSON/issues
53565356
'Chain': isChainShow ? {
53575357
// TODO 后续再支持嵌套子组合 'toGroupId': groupId,
53585358
'groupId': groupId,
5359-
'@column': "id,groupId,documentId,randomId,documentName,randomName,rank", // ;unix_timestamp(rank):rank",
5359+
'@column': "id,groupId,documentId,randomId,documentName,randomName,rank,testAccountId,testName,testInfo", // ;unix_timestamp(rank):rank",
53605360
'@order': 'rank+,id+',
53615361
'documentId>': 0
53625362
} : null,
@@ -5468,7 +5468,7 @@ https://github.com/Tencent/APIJSON/issues
54685468
this.showDoc()
54695469
}
54705470

5471-
this.showCompare4TestCaseList(show)
5471+
this.showCompare4TestCaseList(show, this.isChainShow)
54725472

54735473
//this.onChange(false)
54745474
} else if (IS_BROWSER) { // 解决一旦错了,就只能清缓存
@@ -7987,7 +7987,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
79877987
groupId = new Date().getTime()
79887988
}
79897989

7990-
//修改 Document
7990+
//修改 Chain
79917991
this.request(true, REQUEST_TYPE_POST, REQUEST_TYPE_JSON, this.server + (isAdd ? '/post' : '/put'), {
79927992
Chain: {
79937993
'groupName': groupName,
@@ -8006,6 +8006,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
80068006
alert((isAdd ? '新增' : '修改') + (isOk ? '成功' : '失败') + (isAdd ? '! \n' :'!\ngroupId: ' + groupId) + '\ngroupName: ' + groupName + '\n' + msg)
80078007

80088008
App.isCaseGroupEditable = ! isOk
8009+
App.selectChainGroup(App.currentChainGroupIndex, null)
80098010
})
80108011

80118012
return
@@ -8171,6 +8172,9 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
81718172
type = type || ''
81728173
var page
81738174
switch (type) {
8175+
case 'chainGroup':
8176+
page = this.chainGroupPage
8177+
break
81748178
case 'caseGroup':
81758179
page = this.caseGroupPage
81768180
break
@@ -8195,6 +8199,9 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
81958199
if (page > 0) {
81968200
page --
81978201
switch (type) {
8202+
case 'chainGroup':
8203+
this.chainGroupPage = page
8204+
break
81988205
case 'caseGroup':
81998206
this.caseGroupPage = page
82008207
break
@@ -8218,6 +8225,9 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
82188225
pageUp: function(type) {
82198226
type = type || ''
82208227
switch (type) {
8228+
case 'chainGroup':
8229+
this.chainGroupPage ++
8230+
break
82218231
case 'caseGroup':
82228232
this.caseGroupPage ++
82238233
break
@@ -10809,7 +10819,7 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
1080910819

1081010820
if (isCross) {
1081110821
var isCrossDone = accountIndex >= accounts.length
10812-
this.crossProcess = isCrossDone ? '交叉账号:已开启' : ('交叉账号: ' + ((this.testAccountIndex || 0) + 1) + '/' + accounts.length)
10822+
this.crossProcess = isCrossDone ? '交叉账号:已开启' : ('交叉账号: ' + (accountIndex + 1) + '/' + accounts.length)
1081310823
if (isCrossDone) {
1081410824
this.testProcess = (this.isMLEnabled ? '机器学习:已开启' : '机器学习:已关闭')
1081510825
this.testRandomProcess = ''
@@ -11406,7 +11416,8 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
1140611416
App.testRandomProcess = ''
1140711417
if (isCross) {
1140811418
if (deepDoneCount == deepAllCount) {
11409-
App.test(false, accInd + 1, isCross)
11419+
App.testAccountIndex = (App.testAccountIndex || 0) + 1
11420+
App.test(false, App.testAccountIndex, isCross)
1141011421
}
1141111422
} else {
1141211423
if (deepDoneCount == deepAllCount) {

0 commit comments

Comments
 (0)