|
565 | 565 | isVideoFirst: false, |
566 | 566 | type: OPERATE_TYPE_REVIEW, |
567 | 567 | types: [ OPERATE_TYPE_RECORD, OPERATE_TYPE_REVIEW, OPERATE_TYPE_REPLAY ], |
568 | | - host: 'uiauto.UIAutoApp.', // 'unitauto.test.TestUtil.', |
| 568 | +// host: 'uiauto.UIAutoApp', // 'unitauto.test.TestUtil.', |
| 569 | + host: 'uigo.x.UIAutoApp', // 'unitauto.test.TestUtil.', |
569 | 570 | branch: 'countArray', |
570 | 571 | database: 'MYSQL',// 'POSTGRESQL', |
571 | 572 | schema: 'sys', |
|
713 | 714 | vUrl.value = (isAdminOperation ? this.server : baseUrl) + branchUrl |
714 | 715 | } |
715 | 716 | else { //隐藏(固定)URL Host |
716 | | - if (isAdminOperation) { |
717 | | - this.host = this.server |
718 | | - } |
| 717 | +// if (isAdminOperation) { |
| 718 | +// this.host = this.server |
| 719 | +// } |
719 | 720 | vUrl.value = branchUrl |
720 | 721 | } |
721 | 722 |
|
|
779 | 780 | if (index <= 0) { |
780 | 781 | throw new Error('必须要有类名!完整的 URL 必须符合格式 package.Class.method !') |
781 | 782 | } |
782 | | - url = url.substring(0, index) |
783 | | - index = url.lastIndexOf('.') |
| 783 | + // url = url.substring(0, index) |
| 784 | + // index = url.lastIndexOf('.') |
784 | 785 | var clazz = StringUtil.trim(index < 0 ? url : url.substring(index + 1)) |
785 | 786 | if (App.language == 'Java' || App.language == 'JavaScript' || App.language == 'TypeScript') { |
786 | 787 | if (/[A-Z]{0}[A-Za-z0-9_]/.test(clazz) != true) { |
|
796 | 797 | if (index <= 0) { |
797 | 798 | throw new Error('必须要有类名!完整的 URL 必须符合格式 package.Class.method !') |
798 | 799 | } |
799 | | - url = url.substring(0, index) |
800 | | - index = url.lastIndexOf('.') |
| 800 | + // url = url.substring(0, index) |
| 801 | + // index = url.lastIndexOf('.') |
801 | 802 | return StringUtil.trim(index < 0 ? '' : url.substring(0, index)) |
802 | 803 | }, |
803 | 804 | //获取请求的tag |
|
968 | 969 | showConfig: function (show, index) { |
969 | 970 | App.isConfigShow = false |
970 | 971 | if (App.isTestCaseShow) { |
971 | | - if (index == 3 || index == 4 || index == 5 || index == 10) { |
| 972 | +// if (index == 3 || index == 4 || index == 5 || index == 10) { |
| 973 | + if (index == 4 || index == 5 || index == 10) { |
972 | 974 | App.showTestCase(false, false) |
973 | 975 | } |
974 | 976 | } |
|
980 | 982 | case 0: |
981 | 983 | case 1: |
982 | 984 | case 2: |
| 985 | + case 3: |
983 | 986 | case 6: |
984 | 987 | case 7: |
985 | 988 | case 8: |
986 | 989 | case 10: |
987 | 990 | App.exTxt.name = index == 0 ? App.database : (index == 1 ? App.schema : (index == 2 |
988 | | - ? App.language : (index == 6 ? App.server : (index == 8 ? App.project : '/method/list')))) |
| 991 | + ? App.language : (index == 3 ? App.host : (index == 6 ? App.server : (index == 8 ? App.project : '/method/list'))))) |
989 | 992 | App.isConfigShow = true |
990 | 993 |
|
991 | 994 | if (index == 0) { |
|
1008 | 1011 | , App.getRequest(vInput.value), App.getHeader(vHeader.value)) |
1009 | 1012 | } |
1010 | 1013 | break |
1011 | | - case 3: |
1012 | | - App.host = App.getBaseUrl() |
1013 | | - App.showUrl(false, new String(vUrl.value).substring(App.host.length)) //没必要导致必须重新获取 Response,App.onChange(false) |
1014 | | - App.remotes = null |
1015 | | - break |
| 1014 | +// case 3: |
| 1015 | +// App.host = App.getBaseUrl() |
| 1016 | +// App.showUrl(false, new String(vUrl.value).substring(App.host.length)) //没必要导致必须重新获取 Response,App.onChange(false) |
| 1017 | +// App.remotes = null |
| 1018 | +// break |
1016 | 1019 | case 4: |
1017 | 1020 | App.isHeaderShow = show |
1018 | 1021 | App.saveCache('', 'isHeaderShow', show) |
|
1029 | 1032 | } |
1030 | 1033 | else if (index == 3) { |
1031 | 1034 | var host = StringUtil.get(App.host) |
1032 | | - var branch = new String(vUrl.value) |
1033 | | - App.host = '' |
1034 | | - vUrl.value = host + branch //保证 showUrl 里拿到的 baseUrl = App.host (http://apijson.cn:8080/put /balance) |
1035 | | - App.setBaseUrl() //保证自动化测试等拿到的 baseUrl 是最新的 |
1036 | | - App.showUrl(false, branch) //没必要导致必须重新获取 Response,App.onChange(false) |
1037 | | - App.remotes = null |
| 1035 | +// var branch = new String(vUrl.value) |
| 1036 | + App.host = host |
| 1037 | +// vUrl.value = host + branch //保证 showUrl 里拿到的 baseUrl = App.host (http://apijson.cn:8080/put /balance) |
| 1038 | +// App.setBaseUrl() //保证自动化测试等拿到的 baseUrl 是最新的 |
| 1039 | +// App.showUrl(false, branch) //没必要导致必须重新获取 Response,App.onChange(false) |
| 1040 | +// App.remotes = null |
| 1041 | + App.saveCache('', 'host', host) |
1038 | 1042 | } |
1039 | 1043 | else if (index == 4) { |
1040 | 1044 | App.isHeaderShow = show |
|
1517 | 1521 | doc = null |
1518 | 1522 | App.onChange(false) |
1519 | 1523 | break |
| 1524 | + case 3: |
| 1525 | + App.host = App.exTxt.name |
| 1526 | + App.saveCache('', 'host', App.host) |
| 1527 | + break |
1520 | 1528 | case 6: |
1521 | 1529 | App.server = App.exTxt.name |
1522 | 1530 | App.saveCache('', 'server', App.server) |
|
1619 | 1627 | }, |
1620 | 1628 | 'Output': { |
1621 | 1629 | 'inputId': 0, |
1622 | | - 'host': App.getBaseUrl(), |
| 1630 | + 'host': App.getBaseUrl(), |
1623 | 1631 | 'testAccountId': currentAccountId, |
1624 | 1632 | 'response': '' |
1625 | 1633 | }, |
|
3252 | 3260 | inputList[i] = list[i].Input |
3253 | 3261 | } |
3254 | 3262 |
|
3255 | | - App.request(false, REQUEST_TYPE_JSON, App.project + '/method/invoke', { |
3256 | | - "package": 'uiauto', // 'uiauto', |
3257 | | - "class": 'UIAutoApp', // 'UIAutoApp', |
| 3263 | + var pkg = this.getPackage(this.host) || 'uiauto' |
| 3264 | + var cls = this.getClass(this.host) || 'UIAutoApp' |
| 3265 | + |
| 3266 | + this.request(false, REQUEST_TYPE_JSON, this.project + '/method/invoke', { |
| 3267 | + "package": pkg, // 'uiauto', |
| 3268 | + "class": cls, // 'UIAutoApp', |
3258 | 3269 | "constructor": 'getInstance', |
3259 | 3270 | "method": isRecord ? 'prepareRecord' : 'prepareReplay', |
3260 | 3271 | "methodArgs": isRecord ? ["boolean:true", "boolean:true"] : [ inputList, "int:0", "boolean:true", "boolean:true"] |
|
3274 | 3285 |
|
3275 | 3286 | App.testRandomProcess = '正在' + (isRecord ? '录制' : '回放') + '...' |
3276 | 3287 | App.request(false, REQUEST_TYPE_JSON, App.project + '/method/invoke', { |
3277 | | - "package": 'uiauto', // 'uiauto', |
3278 | | - "class": 'UIAutoApp', // 'UIAutoApp', |
| 3288 | + "package": pkg, // 'uiauto', |
| 3289 | + "class": cls, // 'UIAutoApp', |
3279 | 3290 | "constructor": 'getInstance', |
3280 | 3291 | "method": 'onClickPlay', |
3281 | 3292 | "static": false |
|
3326 | 3337 | }, |
3327 | 3338 |
|
3328 | 3339 | loopRandomTestResult: function (list, inputList, allCount, offset, header) { |
3329 | | - App.request(false, REQUEST_TYPE_JSON, App.project + '/method/invoke', { |
| 3340 | + var pkg = this.getPackage(this.host) || 'uiauto' |
| 3341 | + var cls = this.getClass(this.host) || 'UIAutoApp' |
| 3342 | + this.request(false, REQUEST_TYPE_JSON, App.project + '/method/invoke', { |
3330 | 3343 | "static": true, |
3331 | | - "package": 'uiauto', // 'uiauto', |
3332 | | - "class": 'UIAutoApp', // 'UIAutoApp', |
| 3344 | + "package": pkg, // 'uiauto', |
| 3345 | + "class": cls, // 'UIAutoApp', |
3333 | 3346 | "method": 'getOutputList', |
3334 | 3347 | "methodArgs": [{ // UIAutoApp app |
3335 | 3348 | // "type": "uiauto.UIAutoApp", |
|
0 commit comments