Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a26f829

Browse files
APIAuto: 解决回归测试场景串联及切换帐号查看结果时用例与帐号关联错误
1 parent 55d469c commit a26f829

File tree

1 file changed

+61
-48
lines changed
  • APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/resources/static/api/js

1 file changed

+61
-48
lines changed

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

Lines changed: 61 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,9 +2587,10 @@ https://github.com/Tencent/APIJSON/issues
25872587
var accounts = (StringUtil.isEmpty(testAccountId == null ? null : String(testAccountId), true) ? null : this.accounts) || []
25882588
for (var i = 0; i < accounts.length; i ++) {
25892589
var acc = accounts[i]
2590-
if (acc != null && (acc.id == chain.testAccountId || ( acc.baseUrl = testInfo.baseUrl && (
2591-
(StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
2592-
|| (StringUtil.isNotEmpty(acc.email) && acc.email == testInfo.email) )
2590+
if (acc != null && (acc.id == chain.testAccountId || (
2591+
(StringUtil.isEmpty(testInfo.baseUrl) || acc.baseUrl == testInfo.baseUrl) && (
2592+
(StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
2593+
|| (StringUtil.isNotEmpty(acc.email) && acc.email == testInfo.email) )
25932594
))) {
25942595
this.currentAccountIndex = i
25952596
acc.isLoggedIn = true
@@ -4795,13 +4796,18 @@ https://github.com/Tencent/APIJSON/issues
47954796
var find = false
47964797
for (var i = 0; i < accounts.length; i ++) {
47974798
var acc = accounts[i]
4798-
if (acc != null && (acc.id == chain.testAccountId || ( acc.baseUrl = testInfo.baseUrl && (
4799-
(StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
4799+
if (acc != null && (acc.id == chain.testAccountId || (
4800+
(StringUtil.isEmpty(testInfo.baseUrl) || acc.baseUrl == testInfo.baseUrl) && (
4801+
(StringUtil.isEmpty(testInfo.phone) && StringUtil.isEmpty(testInfo.email))
4802+
|| (StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
48004803
|| (StringUtil.isNotEmpty(acc.email) && acc.email == testInfo.email) )
48014804
))) {
4802-
if (! map[chain.testAccountId]) {
4805+
if (! map[acc.id]) {
4806+
chain.testAccountId = acc.id
48034807
accountIndex = i
48044808
acc.isLoggedIn = true
4809+
// acc.isLoggedIn = ! acc.isLoggedIn
4810+
// this.onClickAccount(i, acc, null, true)
48054811
}
48064812

48074813
find = true
@@ -4810,13 +4816,15 @@ https://github.com/Tencent/APIJSON/issues
48104816
}
48114817

48124818
if (! find) {
4813-
testInfo.isLoggedIn = false
4819+
testInfo.isLoggedIn = ! testInfo.isLoggedIn
4820+
chain.testAccountId = testInfo.testAccountId
48144821
accounts.push(testInfo)
48154822
// this.saveAccounts()
48164823

48174824
var isStatisticsEnabled = this.isStatisticsEnabled
48184825
this.isStatisticsEnabled = false
4819-
this.onClickAccount(accounts.length - 1, testInfo, null, true)
4826+
accountIndex = accounts.length - 1
4827+
this.onClickAccount(accountIndex, testInfo, null, true)
48204828
this.isStatisticsEnabled = isStatisticsEnabled
48214829
}
48224830
map[chain.testAccountId] = true
@@ -10909,46 +10917,48 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
1090910917
var stepCount = stepList == null ? 0 : stepList.length
1091010918
allCount += (stepCount - 1)
1091110919

10912-
var chain = item.Chain
10913-
var testInfo = chain == null ? null : chain.testInfo
10914-
var testAccount = testInfo == null ? null : testInfo.account
10915-
if (StringUtil.isEmpty(testAccount, true)) {
10916-
continue
10917-
}
10918-
10919-
var map = {}
10920-
var find = false
10921-
for (var i = 0; i < accounts.length; i ++) {
10922-
var acc = accounts[i]
10923-
if (acc != null && (acc.id == chain.testAccountId || ( acc.baseUrl = testInfo.baseUrl && (
10924-
(StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
10925-
|| (StringUtil.isNotEmpty(acc.email) && acc.email == testInfo.email) )
10926-
))) {
10927-
if (! map[chain.testAccountId]) {
10928-
// this.currentAccountIndex = i
10929-
acc.isLoggedIn = true
10930-
}
10931-
10932-
find = true
10933-
break
10934-
}
10935-
}
10936-
10937-
if (! find) {
10938-
testInfo.isLoggedIn = false
10939-
accounts.push(testInfo)
10940-
// this.saveAccounts()
10941-
10942-
var isStatisticsEnabled = this.isStatisticsEnabled
10943-
this.isStatisticsEnabled = false
10944-
// this.onClickAccount(accounts.length - 1, testInfo)
10945-
this.isStatisticsEnabled = isStatisticsEnabled
10946-
}
10947-
map[chain.testAccountId] = true
10920+
// var chain = item.Chain
10921+
// var testInfo = chain == null ? null : chain.testInfo
10922+
// var testAccount = testInfo == null ? null : testInfo.account
10923+
// if (StringUtil.isEmpty(testAccount, true)) {
10924+
// continue
10925+
// }
10926+
//
10927+
// var map = {}
10928+
// var find = false
10929+
// for (var i = 0; i < accounts.length; i ++) {
10930+
// var acc = accounts[i]
10931+
// if (acc != null && (acc.id == chain.testAccountId || ( acc.baseUrl == testInfo.baseUrl && (
10932+
// (StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
10933+
// || (StringUtil.isNotEmpty(acc.email) && acc.email == testInfo.email) )
10934+
// ))) {
10935+
// if (! map[chain.testAccountId]) {
10936+
// chain.testAccountId = acc.id
10937+
//// this.currentAccountIndex = i
10938+
// acc.isLoggedIn = true
10939+
//
10940+
// }
10941+
//
10942+
// find = true
10943+
// break
10944+
// }
10945+
// }
10946+
//
10947+
// if (! find) {
10948+
// testInfo.isLoggedIn = false
10949+
// accounts.push(testInfo)
10950+
//// this.saveAccounts()
10951+
//
10952+
// var isStatisticsEnabled = this.isStatisticsEnabled
10953+
// this.isStatisticsEnabled = false
10954+
//// this.onClickAccount(accounts.length - 1, testInfo)
10955+
// this.isStatisticsEnabled = isStatisticsEnabled
10956+
// }
10957+
// map[chain.testAccountId] = true
1094810958
}
1094910959

1095010960
// this.currentAccountIndex = lastAccountIndex || 0
10951-
curAccount.isLoggedIn = isLoggedIn
10961+
// curAccount.isLoggedIn = isLoggedIn
1095210962
}
1095310963

1095410964
if (isCross) {
@@ -11098,8 +11108,10 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
1109811108
} else {
1109911109
for (var i = 0; i < accounts.length; i ++) {
1110011110
var acc = accounts[i]
11101-
if (acc != null && (acc.id == testAccountId || ( acc.baseUrl = testInfo.baseUrl && (
11102-
(StringUtil.isNotEmpty(item.phone) && acc.phone == testInfo.phone)
11111+
if (acc != null && (acc.id == testAccountId || (
11112+
(StringUtil.isEmpty(testInfo.baseUrl) || acc.baseUrl == testInfo.baseUrl) && (
11113+
(StringUtil.isEmpty(testInfo.phone) && StringUtil.isEmpty(testInfo.email))
11114+
|| (StringUtil.isNotEmpty(item.phone) && acc.phone == testInfo.phone)
1110311115
|| (StringUtil.isNotEmpty(item.email) && acc.email == testInfo.email) )
1110411116
))) {
1110511117
chain.testAccountId = acc.id
@@ -11881,7 +11893,8 @@ Content-Type: ` + contentType) + (StringUtil.isEmpty(headerStr, true) ? '' : hea
1188111893
const accounts = this.accounts || []
1188211894
for (var i = 0; i < accounts.length; i ++) {
1188311895
var acc = accounts[i]
11884-
if (acc != null && (acc.id == testAccountId || ( acc.baseUrl = testInfo.baseUrl && (
11896+
if (acc != null && (acc.id == testAccountId || (
11897+
(StringUtil.isEmpty(testInfo.baseUrl) || acc.baseUrl == testInfo.baseUrl) && (
1188511898
(StringUtil.isNotEmpty(acc.phone) && acc.phone == testInfo.phone)
1188611899
|| (StringUtil.isNotEmpty(acc.email) && acc.email == testInfo.email) )
1188711900
))) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /