From 6c1277df5d5395d8bf2ba953a71b42c94a1f71cc Mon Sep 17 00:00:00 2001 From: duqingquan Date: Thu, 1 Jun 2023 12:04:57 +0800 Subject: [PATCH] auto test source update --- manifest.json | 2 +- pages.json | 21 -------------- uni_modules/uni-wifi/utssdk/interface.uts | 31 ++++++++++++++------- uni_modules/uni-wifi/utssdk/uni.autotest.js | 18 ++++++++++-- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/manifest.json b/manifest.json index 226056a..6520000 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "uni-api", - "appid" : "__UNI__ED9218B", + "appid" : "__UNI__6EEB705", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", diff --git a/pages.json b/pages.json index 03593a5..24f82b8 100644 --- a/pages.json +++ b/pages.json @@ -5,27 +5,6 @@ "style": { "navigationBarTitleText": "uni-app" } - }, - { - "path": "pages/autotest/uni-getbatteryinfo/uni-getbatteryinfo", - "style": { - "navigationBarTitleText": "uni-getbatteryinfo", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/autotest/uni-memorywarning/uni-memorywarning", - "style": { - "navigationBarTitleText": "uni-memorywarning", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/autotest/uni-usercapturescreen/uni-usercapturescreen", - "style": { - "navigationBarTitleText": "uni-usercapturescreen", - "enablePullDownRefresh": false - } } ], "globalStyle": { diff --git a/uni_modules/uni-wifi/utssdk/interface.uts b/uni_modules/uni-wifi/utssdk/interface.uts index 86d91fd..c2a2767 100644 --- a/uni_modules/uni-wifi/utssdk/interface.uts +++ b/uni_modules/uni-wifi/utssdk/interface.uts @@ -99,6 +99,7 @@ interface Uni { * } * @uniVersion 3.7.7 * @uniVueVersion 2,3 //支持的vue版本 + * @autotest { after: 'stopWifi' } */ startWifi : StartWifi, /** @@ -122,6 +123,7 @@ interface Uni { * } * @uniVersion 3.7.7 * @uniVueVersion 2,3 //支持的vue版本 + * @autotest { before: 'startWifi' } */ stopWifi : StopWifi, /** @@ -130,7 +132,7 @@ interface Uni { * @uniPlatform { * "app": { * "android": { - * "osVer": "<=10.0", + * "osVer": ">=4.4 && <10.0", * "uniVer": "3.7.0", * "unixVer": "3.9.0" * }, @@ -184,15 +186,7 @@ interface Uni { * } * @uniVersion 3.7.7 * @uniVueVersion 2,3 //支持的vue版本 - * @autotest { - generated: false, - cases:[ - { - before: 'startWifi', - after: 'stopWifi' - } - ] - } + * @autotest { before: 'startWifi', after: 'stopWifi' } */ getWifiList : GetWifiList, /** @@ -216,6 +210,23 @@ interface Uni { * } * @uniVersion 3.7.7 * @uniVueVersion 2,3 //支持的vue版本 + * @autotest { expectCallback: true } + * @autotest { + generated: false, + pollution: false, + expectCallback: true, + before: 'startWifi', + after: 'onGetWifiListAfter', + cases: [ + { + output: { + value: 0, + returnKey: '.wifiList.length', + jestExpectSyntax: 'toBeGreaterThan' + }, + } + ] + } */ onGetWifiList : OnGetWifiList, /** diff --git a/uni_modules/uni-wifi/utssdk/uni.autotest.js b/uni_modules/uni-wifi/utssdk/uni.autotest.js index 7889e3c..156387e 100644 --- a/uni_modules/uni-wifi/utssdk/uni.autotest.js +++ b/uni_modules/uni-wifi/utssdk/uni.autotest.js @@ -21,9 +21,23 @@ export function stopWifi() { resolve() }, fail: () => { - console.log('stopWifi success'); - fail() + console.log('stopWifi fail'); + reject() } }) }) } + +export function onGetWifiListAfter() { + return new Promise((resolve, reject) => { + uni.getWifiList({ + success() { + setTimeout(resolve, 500) + }, + fail: reject, + complete() { + stopWifi() + } + }) + }) +} \ No newline at end of file -- GitLab