diff --git a/aafwk/aafwk_standard/formmanager/BUILD.gn b/aafwk/aafwk_standard/formmanager/BUILD.gn old mode 100644 new mode 100755 index f40aec09e44ecea9d10fbe70b2f8f17108590302..93b87102d296ed873a108c8837342911117beac1 --- a/aafwk/aafwk_standard/formmanager/BUILD.gn +++ b/aafwk/aafwk_standard/formmanager/BUILD.gn @@ -18,10 +18,10 @@ group("formmanager") { if (is_standard_system) { deps = [ "formsystemtesthost/FormFuzzTest:FormFuzzTest", - "formsystemtesthost/getallformsinfo10:GetAllFormsInfo10", - "formsystemtesthost/getallformsinfo201:GetAllFormsInfo201", - "formsystemtesthost/getallformsinfo211:GetAllFormsInfo211", - "formsystemtesthost/getallformsinfo212:GetAllFormsInfo212", + "formsystemtesthost/actsformsoneandonetest:ActsFormsOneAndOneTest", + "formsystemtesthost/actsformsoneandtwotest:ActsFormsOneAndTwoTest", + "formsystemtesthost/actsformszeroandonetest:ActsFormsZeroAndOneTest", + "formsystemtesthost/actsformszerotest:ActsFormsZeroTest", "formsystemtestservice/formsystemtestservicea:ActsFormSystemTestServiceA", "formsystemtestservice/formsystemtestserviceb:ActsFormSystemTestServiceB", "formsystemtestservice/formsystemtestservicec:ActsFormSystemTestServiceC", diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/BUILD.gn b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/BUILD.gn old mode 100644 new mode 100755 similarity index 92% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/BUILD.gn rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/BUILD.gn index a28e366b3de9c133294195a2fb8f8d59e6076748..ec45783a5b37afc25a3c8234ad99e2f05d9b50ba --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/BUILD.gn +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("GetAllFormsInfo211") { +ohos_js_hap_suite("ActsFormsOneAndOneTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "GetAllFormsInfo211" + hap_name = "ActsFormsOneAndOneTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/Test.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/Test.json old mode 100644 new mode 100755 similarity index 82% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/Test.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/Test.json index 466167efc89dd2932a82ecf89a020026ae771056..d02beeba295b0b0993b1beca8bd0acaecad8df1e --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/Test.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.getallformsinfo211", + "package": "com.example.formsoneandone", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "GetAllFormsInfo211.hap", + "ActsFormsOneAndOneTest.hap", "ActsFormSystemTestServiceB.hap", "ActsFormSystemTestServiceC.hap" ], diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 80% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/config.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/config.json index 6e7a68842e769cbd64a8d1c6a885db6c83c01495..150036c7788ab27f467776cee53ce75f6a72abe9 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/config.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/config.json @@ -1,63 +1,63 @@ -{ - "app": { - "bundleName": "com.example.getallformsinfo211", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.getallformsinfo211", - "name": ".MyApplication", - "mainAbility": "com.example.getallformsinfo211.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.example.getallformsinfo211.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } +{ + "app": { + "bundleName": "com.example.formsoneandone", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.formsoneandone", + "name": ".MyApplication", + "mainAbility": "com.example.formsoneandone.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.example.formsoneandone.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/app.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/i18n/en-US.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/i18n/zh-CN.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/pages/index/index.css rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/pages/index/index.hml rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/default/pages/index/index.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/test/FormsOneAndOneJsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/test/FormsOneAndOneJsunit.test.js new file mode 100755 index 0000000000000000000000000000000000000000..05bc394a609415020e3e9f0f176553fe88e8a6c4 --- /dev/null +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/test/FormsOneAndOneJsunit.test.js @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formManager from '@ohos.ability.formManager' +import {describe, it, expect} from 'deccjsunit/index' + +const TIMEOUT = 3000; +describe('ActsFormsOneAndOneTest', function () { + console.log("ActsFormsOneAndOneTest===start"); + + /** + * @tc.name getAllFormsInfo test + * @tc.number FMS_getFormsInfo_0500 + * @tc.desc All form configuration information is queried successfully (by AsyncCallback) + */ + it('FMS_getFormsInfo_0500_callback', 0, async function (done) { + console.log("FMS_getFormsInfo_0500_callback begin"); + var ret = formManager.getAllFormsInfo( + (result, data) => { + console.log("FMS_getFormsInfo_0500_callback, the forms number:" + data.length); + var dataB = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviceb"; + }); + var dataC = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestservicec"; + }); + console.log("FMS_getFormsInfo_0500_callback async::sucess, dataB json:" + JSON.stringify(dataB)); + console.log("FMS_getFormsInfo_0500_callback async::sucess, dataA json:" + JSON.stringify(dataC)); + console.log("FMS_getFormsInfo_0500_callback getAllFormsInfo async::result, result:" + result); + expect(result).assertEqual(1); + + function expe(datainfo) { + for(var i = 0; i < datainfo.length; i++) { + expect(datainfo[i].description).assertEqual("form_description"); + expect(datainfo[i].type).assertEqual(1); + expect(datainfo[i].colorMode).assertEqual(-1); + expect(datainfo[i].jsComponentName).assertEqual("card"); + expect(datainfo[i].isDefault).assertEqual(1); + expect(datainfo[i].updateEnabled).assertEqual(1); + expect(datainfo[i].updateDuration).assertEqual(1); + expect(datainfo[i].scheduledUpdateTime).assertEqual("10:30"); + expect(datainfo[i].formVisibleNotify).assertEqual(1); + expect(datainfo[i].defaultDimension).assertEqual(1); + expect(datainfo[i].supportDimensions[0]).assertEqual(1); + expect(datainfo[i].supportDimensions[1]).assertEqual(2); + expect(datainfo[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); + expect(datainfo[i].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0500_callback=========expe, formName:" + datainfo[i].name); + } + } + expe(dataB); + expe(dataC); + expect(dataB[0].name).assertEqual("FormB_Js001"); + expect(dataC[0].name).assertEqual("FormC_Js001"); + console.log("FMS_getFormsInfo_0500_callback result end"); + done(); + } + ); + setTimeout(function () { + console.info('=====================FMS_getFormsInfo_0500_callback==================end'); + }, TIMEOUT) + console.log("FMS_getFormsInfo_0500_callback end, ret:"+ret); + }) + + /** + * @tc.name getAllFormsInfo test + * @tc.number FMS_getFormsInfo_0500 + * @tc.desc All form configuration information is queried successfully (by Promise) + */ + it('FMS_getFormsInfo_0500_promise', 0, async function (done) { + console.log("FMS_getFormsInfo_0500_promise begin"); + + var promise = formManager.getAllFormsInfo(); + promise.then((data) => { + console.log("FMS_getFormsInfo_0500_promise, the forms number:" + data.length); + var dataB = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviceb"; + }); + var dataC = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestservicec"; + }); + console.log("FMS_getFormsInfo_0500_promise async::sucess, dataB json:" + JSON.stringify(dataB)); + console.log("FMS_getFormsInfo_0500_promise async::sucess, dataA json:" + JSON.stringify(dataC)); + + function expe(datainfo) { + for(var i = 0; i < datainfo.length; i++) { + expect(datainfo[i].description).assertEqual("form_description"); + expect(datainfo[i].type).assertEqual(1); + expect(datainfo[i].colorMode).assertEqual(-1); + expect(datainfo[i].jsComponentName).assertEqual("card"); + expect(datainfo[i].isDefault).assertEqual(1); + expect(datainfo[i].updateEnabled).assertEqual(1); + expect(datainfo[i].updateDuration).assertEqual(1); + expect(datainfo[i].scheduledUpdateTime).assertEqual("10:30"); + expect(datainfo[i].formVisibleNotify).assertEqual(1); + expect(datainfo[i].defaultDimension).assertEqual(1); + expect(datainfo[i].supportDimensions[0]).assertEqual(1); + expect(datainfo[i].supportDimensions[1]).assertEqual(2); + expect(datainfo[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); + expect(datainfo[i].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0500_promise=========expe, formName:" + datainfo[i].name); + } + } + expe(dataB); + expe(dataC); + expect(dataB[0].name).assertEqual("FormB_Js001"); + expect(dataC[0].name).assertEqual("FormC_Js001"); + console.log("FMS_getFormsInfo_0500_promise result end"); + done(); + }); + setTimeout(function () { + console.info('=====================FMS_getFormsInfo_0500_promise==================end'); + }, TIMEOUT) + }) +}) diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 similarity index 93% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/test/List.test.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/test/List.test.js index 0bf02e9ef3590c596c20b20e3b1e4bb530751673..c33585ebe843fd090aa83be4f728d590448548a9 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/js/test/List.test.js @@ -13,4 +13,4 @@ * limitations under the License. */ -require('./GetAllFormsInfo10Jsunit.test.js') \ No newline at end of file +require('./FormsOneAndOneJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 similarity index 77% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/resources/base/element/string.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/resources/base/element/string.json index 098147ed10fdde46dfec784fe2baf03f1a0fcad2..f92c362cd744365819e19feb6e31806f8cbfb9ad --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "GetAllFormsInfo201" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsoneandone" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/resources/base/media/icon.png rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/signature/openharmony_sx.p7b rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandonetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/BUILD.gn b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/BUILD.gn old mode 100644 new mode 100755 similarity index 92% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/BUILD.gn rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/BUILD.gn index 5e9f6a25dbba488dd9c3c97f1d3d974b0d25022a..8d092ea8606dc30c163261e1c365ee5bdd332742 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/BUILD.gn +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("GetAllFormsInfo212") { +ohos_js_hap_suite("ActsFormsOneAndTwoTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "GetAllFormsInfo212" + hap_name = "ActsFormsOneAndTwoTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/Test.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/Test.json old mode 100644 new mode 100755 similarity index 82% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/Test.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/Test.json index 7ae86bac542f3a0820cb3c050a9b970438eec39d..a642ac0bee0a05ea30cb82fc2c65896058701ec3 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/Test.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "120000", - "package": "com.example.getallformsinfo", + "package": "com.example.formsoneandtwo", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "GetAllFormsInfo212.hap", + "ActsFormsOneAndTwoTest.hap", "ActsFormSystemTestServiceA.hap", "ActsFormSystemTestServiceB.hap" ], diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 80% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/config.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/config.json index d3c11a2284b28d8ff2e1b2396192c25f72a1a304..d3937e960f3bfc3b0ff79eff6280946a8b675c44 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/config.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/config.json @@ -1,63 +1,63 @@ -{ - "app": { - "bundleName": "com.example.getallformsinfo10", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.getallformsinfo10", - "name": ".MyApplication", - "mainAbility": "com.example.getallformsinfo10.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.example.getallformsinfo10.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } +{ + "app": { + "bundleName": "com.example.formsoneandtwo", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.formsoneandtwo", + "name": ".MyApplication", + "mainAbility": "com.example.formsoneandtwo.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.example.formsoneandtwo.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/app.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/i18n/en-US.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/i18n/zh-CN.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/pages/index/index.css rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/pages/index/index.hml rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/default/pages/index/index.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/test/GetAllFormsInfo212Jsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/test/FormsOneAndTwoJsunit.test.js old mode 100644 new mode 100755 similarity index 81% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/test/GetAllFormsInfo212Jsunit.test.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/test/FormsOneAndTwoJsunit.test.js index 0f25595b3c9205739a1b5481a87b89ef50dd37d2..35120a3f59bf4645358a981aa64d2f8255f47d3f --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/test/GetAllFormsInfo212Jsunit.test.js +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/test/FormsOneAndTwoJsunit.test.js @@ -14,11 +14,11 @@ */ import formManager from '@ohos.ability.formManager' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import {describe, it, expect} from 'deccjsunit/index' const TIMEOUT = 5000; -describe('getAllFormsInfoTest', function () { - console.log("system application and has permissions Test"); +describe('ActsFormsOneAndTwoTest', function () { + console.log("ActsFormsOneAndTwoTest===start"); /** * @tc.name getAllFormsInfo test @@ -30,41 +30,50 @@ describe('getAllFormsInfoTest', function () { var ret = formManager.getAllFormsInfo( (result, data) => { - console.log("FMS_getFormsInfo_0600_callback async::sucess, data json:" - + JSON.stringify(data)); - console.log("FMS_getFormsInfo_0600_callback async::result, result:" + result); + console.log("FMS_getFormsInfo_0600_callback, the forms number:" + data.length); + var dataA = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestservicea"; + }); + var dataB = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviceb"; + }); + console.log("FMS_getFormsInfo_0600_callback, the formA number:" + dataA.length); + console.log("FMS_getFormsInfo_0600_callback async::sucess, dataA json:" + JSON.stringify(dataA)); + console.log("FMS_getFormsInfo_0600_callback async::sucess, dataB json:" + JSON.stringify(dataB)); + console.log("FMS_getFormsInfo_0600_callback getAllFormsInfo async::result, result:" + result); expect(result).assertEqual(1); - - for(var i = 0; i < data.length; i++) { - expect(typeof (data[i].description)).assertEqual("string"); - expect(data[i].description).assertEqual("form_description"); - expect(data[i].type).assertEqual(1); - expect(data[i].colorMode).assertEqual(-1); - expect(data[i].jsComponentName).assertEqual("card"); - expect(data[i].isDefault).assertEqual(1); - expect(data[i].updateEnabled).assertEqual(1); - expect(data[i].updateDuration).assertEqual(1); - expect(data[i].scheduledUpdateTime).assertEqual("10:30"); - expect(data[i].formVisibleNotify).assertEqual(1); - expect(data[i].defaultDimension).assertEqual(1); - expect(data[i].supportDimensions[0]).assertEqual(1); - expect(data[i].supportDimensions[1]).assertEqual(2); - expect(data[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); - expect(data[i].metaData.customizeData[0].value).assertEqual("myTest"); + function expe(datainfo) { + for(var i = 0; i < datainfo.length; i++) { + expect(datainfo[i].description).assertEqual("form_description"); + expect(datainfo[i].type).assertEqual(1); + expect(datainfo[i].colorMode).assertEqual(-1); + expect(datainfo[i].jsComponentName).assertEqual("card"); + expect(datainfo[i].isDefault).assertEqual(1); + expect(datainfo[i].updateEnabled).assertEqual(1); + expect(datainfo[i].updateDuration).assertEqual(1); + expect(datainfo[i].scheduledUpdateTime).assertEqual("10:30"); + expect(datainfo[i].formVisibleNotify).assertEqual(1); + expect(datainfo[i].defaultDimension).assertEqual(1); + expect(datainfo[i].supportDimensions[0]).assertEqual(1); + expect(datainfo[i].supportDimensions[1]).assertEqual(2); + expect(datainfo[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); + expect(datainfo[i].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0600_promise=========expe, formName:" + datainfo[i].name); + } } - - expect(data[0].name).assertEqual("FormA_Js001"); - expect(data[1].name).assertEqual("FormA_Js002"); - expect(data[2].name).assertEqual("FormB_Js001"); + expe(dataA); + expe(dataB); + expect(dataA[0].name).assertEqual("FormA_Js001"); + expect(dataA[1].name).assertEqual("FormA_Js002"); + expect(dataB[0].name).assertEqual("FormB_Js001"); console.log("FMS_getFormsInfo_0600_callback result end"); done(); } ); - setTimeout(function () { console.info('=====================FMS_getFormsInfo_0600_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_0600_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_0600_callback end, ret:" + ret); }) /** @@ -77,33 +86,44 @@ describe('getAllFormsInfoTest', function () { var promise = formManager.getAllFormsInfo(); promise.then((data) => { - console.log("FMS_getFormsInfo_0600_promise async::sucess, data json:" + JSON.stringify(data)); - for(var i = 0; i < data.length; i++) { - expect(typeof (data[i].description)).assertEqual("string"); - expect(data[i].description).assertEqual("form_description"); - expect(data[i].type).assertEqual(1); - expect(data[i].colorMode).assertEqual(-1); - expect(data[i].jsComponentName).assertEqual("card"); - expect(data[i].isDefault).assertEqual(1); - expect(data[i].updateEnabled).assertEqual(1); - expect(data[i].updateDuration).assertEqual(1); - expect(data[i].scheduledUpdateTime).assertEqual("10:30"); - expect(data[i].formVisibleNotify).assertEqual(1); - expect(data[i].defaultDimension).assertEqual(1); - expect(data[i].supportDimensions[0]).assertEqual(1); - expect(data[i].supportDimensions[1]).assertEqual(2); - expect(data[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); - expect(data[i].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0600_promise, the forms number:" + data.length); + var dataA = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestservicea"; + }); + var dataB = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviceb"; + }); + console.log("FMS_getFormsInfo_0600_promise, the formA number:" + dataA.length); + console.log("FMS_getFormsInfo_0600_promise async::sucess, dataA json:" + JSON.stringify(dataA)); + console.log("FMS_getFormsInfo_0600_promise async::sucess, dataB json:" + JSON.stringify(dataB)); + + function expe(datainfo) { + for(var i = 0; i < datainfo.length; i++) { + expect(datainfo[i].description).assertEqual("form_description"); + expect(datainfo[i].type).assertEqual(1); + expect(datainfo[i].colorMode).assertEqual(-1); + expect(datainfo[i].jsComponentName).assertEqual("card"); + expect(datainfo[i].isDefault).assertEqual(1); + expect(datainfo[i].updateEnabled).assertEqual(1); + expect(datainfo[i].updateDuration).assertEqual(1); + expect(datainfo[i].scheduledUpdateTime).assertEqual("10:30"); + expect(datainfo[i].formVisibleNotify).assertEqual(1); + expect(datainfo[i].defaultDimension).assertEqual(1); + expect(datainfo[i].supportDimensions[0]).assertEqual(1); + expect(datainfo[i].supportDimensions[1]).assertEqual(2); + expect(datainfo[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); + expect(datainfo[i].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0600_promise=========expe, formName:" + datainfo[i].name); + } } - - expect(data[0].name).assertEqual("FormA_Js001"); - expect(data[1].name).assertEqual("FormA_Js002"); - expect(data[2].name).assertEqual("FormB_Js001"); + expe(dataA); + expe(dataB); + expect(dataA[0].name).assertEqual("FormA_Js001"); + expect(dataA[1].name).assertEqual("FormA_Js002"); + expect(dataB[0].name).assertEqual("FormB_Js001"); console.log("FMS_getFormsInfo_0600_promise result end"); done(); - } - ); - + }); setTimeout(function () { console.info('=====================FMS_getFormsInfo_0600_promise==================end'); }, TIMEOUT) @@ -133,7 +153,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_0900_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_0900_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_0900_callback end, ret:" + ret); }) /** @@ -184,7 +204,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1000_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1000_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1000_callback end, ret:" + ret); }) /** @@ -254,7 +274,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1100_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1100_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1100_callback end, ret:" + ret); }) /** @@ -293,8 +313,7 @@ describe('getAllFormsInfoTest', function () { expect(data[1].name).assertEqual("FormA_Js002"); console.log("FMS_getFormsInfo_1100_promise result end"); done(); - } - ); + }); setTimeout(function () { console.info('=====================FMS_getFormsInfo_1100_promise==================end'); @@ -326,7 +345,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1400_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1400_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1400_callback end, ret:" + ret); }) /** @@ -380,7 +399,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1500_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1500_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1500_callback end, ret:" + ret); }) /** @@ -434,7 +453,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1600_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1600_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1600_callback end, ret:" + ret); }) /** @@ -488,7 +507,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1700_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1700_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1700_callback end, ret:" + ret); }) /** @@ -561,7 +580,7 @@ describe('getAllFormsInfoTest', function () { setTimeout(function () { console.info('=====================FMS_getFormsInfo_1800_callback==================end'); }, TIMEOUT) - console.log("FMS_getFormsInfo_1800_callback end, ret:"+ret); + console.log("FMS_getFormsInfo_1800_callback end, ret:" + ret); }) /** diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 similarity index 93% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/test/List.test.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/test/List.test.js index 198e15ff01c238bb688c2642f03ff521e0335530..e0cc97565827c143066ba7cbb749e54ce3cb66c5 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/js/test/List.test.js @@ -13,4 +13,4 @@ * limitations under the License. */ -require('./GetAllFormsInfo211Jsunit.test.js') \ No newline at end of file +require('./FormsOneAndTwoJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 similarity index 77% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/resources/base/element/string.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/resources/base/element/string.json index 361473e0d163ed9ea4ad0cc788bb5bac2c662059..f1b28c625290e597ed8a1970b69e703081b11528 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "GetAllFormsInfo211" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formsoneandtwo" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/resources/base/media/icon.png rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/signature/openharmony_sx.p7b rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformsoneandtwotest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/BUILD.gn b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/BUILD.gn old mode 100644 new mode 100755 similarity index 92% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/BUILD.gn rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/BUILD.gn index 98b371b18c214af7581767ea2c5622596519224f..b5ab641a85dab7ca47a6ea3701748bc892c07f84 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/BUILD.gn +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("GetAllFormsInfo201") { +ohos_js_hap_suite("ActsFormsZeroAndOneTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "GetAllFormsInfo201" + hap_name = "ActsFormsZeroAndOneTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/Test.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/Test.json old mode 100644 new mode 100755 similarity index 81% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/Test.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/Test.json index 1bcd73446d5b3961a85f84a39ff6a6ac881dfbba..b8fcb93c83768c032db01561b499e9ff442436e2 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/Test.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.getallformsinfo201", + "package": "com.example.formszeroandone", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "GetAllFormsInfo201.hap", + "ActsFormsZeroAndOneTest.hap", "ActsFormSystemTestServiceB.hap", "ActsFormSystemTestServiceD.hap" ], diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 80% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/config.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/config.json index 0e2bc5b99993c687df2ce9293e275a7f2b9218f5..1fc69db17131ba842cc7b6decdff1afeae93f879 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/config.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/config.json @@ -1,63 +1,63 @@ -{ - "app": { - "bundleName": "com.example.getallformsinfo", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.getallformsinfo", - "name": ".MyApplication", - "mainAbility": "com.example.getallformsinfo.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.example.getallformsinfo.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } +{ + "app": { + "bundleName": "com.example.formszeroandone", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.formszeroandone", + "name": ".MyApplication", + "mainAbility": "com.example.formszeroandone.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.example.formszeroandone.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/app.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/i18n/en-US.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/i18n/zh-CN.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/pages/index/index.css rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/pages/index/index.hml rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/default/pages/index/index.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/test/FormsZeroAndOneJsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/test/FormsZeroAndOneJsunit.test.js new file mode 100755 index 0000000000000000000000000000000000000000..d1feeac016e4ad002f93d4815980255952308b6b --- /dev/null +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/test/FormsZeroAndOneJsunit.test.js @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formManager from '@ohos.ability.formManager' +import {describe, it, expect} from 'deccjsunit/index' + +const TIMEOUT = 3000; +describe('ActsFormsZeroAndOneTest', function () { + console.log("ActsFormsZeroAndOneTest===start"); + + /** + * @tc.name getAllFormsInfo test + * @tc.number FMS_getFormsInfo_0400 + * @tc.desc All form configuration information is queried successfully (by AsyncCallback) + */ + it('FMS_getFormsInfo_0400_callback', 0, async function (done) { + console.log("FMS_getFormsInfo_0400_callback begin"); + + var ret = formManager.getAllFormsInfo( + (result, data) => { + console.log("FMS_getFormsInfo_0400_callback, the forms number:" + data.length); + console.log("FMS_getFormsInfo_0400_callback async::sucess, data json:" + JSON.stringify(data)); + var dataB = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviceb"; + }); + console.log("FMS_getFormsInfo_0400_callback async::sucess, dataB json:" + JSON.stringify(dataB)); + console.log("FMS_getFormsInfo_0400_callback async::result, result:" + result); + expect(result).assertEqual(1); + + expect(dataB[0].name).assertEqual("FormB_Js001"); + expect(dataB[0].description).assertEqual("form_description"); + expect(dataB[0].type).assertEqual(1); + expect(dataB[0].colorMode).assertEqual(-1); + expect(dataB[0].jsComponentName).assertEqual("card"); + expect(dataB[0].isDefault).assertEqual(1); + expect(dataB[0].updateEnabled).assertEqual(1); + expect(dataB[0].updateDuration).assertEqual(1); + expect(dataB[0].scheduledUpdateTime).assertEqual("10:30"); + expect(dataB[0].formVisibleNotify).assertEqual(1); + expect(dataB[0].defaultDimension).assertEqual(1); + expect(dataB[0].supportDimensions[0]).assertEqual(1); + expect(dataB[0].supportDimensions[1]).assertEqual(2); + expect(dataB[0].metaData.customizeData[0].name).assertEqual("originWidgetName"); + expect(dataB[0].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0400_callback result end"); + done(); + } + ); + + setTimeout(function () { + console.info('=====================FMS_getFormsInfo_0400_callback==================end'); + }, TIMEOUT) + console.log("FMS_getFormsInfo_0400_callback end, ret:"+ret); + }) + + /** + * @tc.name getAllFormsInfo test + * @tc.number FMS_getFormsInfo_0400 + * @tc.desc All form configuration information is queried successfully (by Promise) + */ + it('FMS_getFormsInfo_0400_promise', 0, async function (done) { + console.log("FMS_getFormsInfo_0400_promise begin"); + + var promise = formManager.getAllFormsInfo(); + promise.then((data) => { + console.log("FMS_getFormsInfo_0400_promise, the forms number:" + data.length); + console.log("FMS_getFormsInfo_0400_promise async::sucess, data json:" + JSON.stringify(data)); + var dataB = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviceb"; + }); + console.log("FMS_getFormsInfo_0400_promise async::sucess, dataB json:" + JSON.stringify(dataB)); + + expect(dataB[0].name).assertEqual("FormB_Js001"); + expect(dataB[0].description).assertEqual("form_description"); + expect(dataB[0].type).assertEqual(1); + expect(dataB[0].colorMode).assertEqual(-1); + expect(dataB[0].jsComponentName).assertEqual("card"); + expect(dataB[0].isDefault).assertEqual(1); + expect(dataB[0].updateEnabled).assertEqual(1); + expect(dataB[0].updateDuration).assertEqual(1); + expect(dataB[0].scheduledUpdateTime).assertEqual("10:30"); + expect(dataB[0].formVisibleNotify).assertEqual(1); + expect(dataB[0].defaultDimension).assertEqual(1); + expect(dataB[0].supportDimensions[0]).assertEqual(1); + expect(dataB[0].supportDimensions[1]).assertEqual(2); + expect(dataB[0].metaData.customizeData[0].name).assertEqual("originWidgetName"); + expect(dataB[0].metaData.customizeData[0].value).assertEqual("myTest"); + console.log("FMS_getFormsInfo_0400_promise result end"); + done(); + } + ); + + setTimeout(function () { + console.info('=====================FMS_getFormsInfo_0400_promise==================end'); + }, TIMEOUT) + }) + +}) diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 similarity index 93% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/test/List.test.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/test/List.test.js index 995113fd45988ecdeb156700f703a2c048121472..ed8dacc746f6f8cda063d23d46c752a1515528a3 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/js/test/List.test.js @@ -13,4 +13,4 @@ * limitations under the License. */ -require('./GetAllFormsInfo201Jsunit.test.js') \ No newline at end of file +require('./FormsZeroAndOneJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 similarity index 77% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/resources/base/element/string.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/resources/base/element/string.json index 4a326ad8850c1e7d4d2fc1f537a3197b346c9d3c..a97c4c16cac15dde2e5abb22d27abf3f103fb8da --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "GetAllFormsInfo212" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formszeroandone" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/resources/base/media/icon.png rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/signature/openharmony_sx.p7b rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszeroandonetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/BUILD.gn b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/BUILD.gn old mode 100644 new mode 100755 similarity index 93% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/BUILD.gn rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/BUILD.gn index e17ccc9a1a4267e40e3e84d52758caeb39634409..b9591a5e13d742a984bd00b33babc82826863704 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/BUILD.gn +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/BUILD.gn @@ -13,14 +13,14 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("GetAllFormsInfo10") { +ohos_js_hap_suite("ActsFormsZeroTest") { hap_profile = "./entry/src/main/config.json" deps = [ ":hjs_demo_js_assets", ":hjs_demo_resources", ] certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "GetAllFormsInfo10" + hap_name = "ActsFormsZeroTest" } ohos_js_assets("hjs_demo_js_assets") { source_dir = "./entry/src/main/js/default" diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/Test.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/Test.json old mode 100644 new mode 100755 similarity index 80% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/Test.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/Test.json index 9f88ec1f7a2e734ab97eda7b61546d9a48668b5c..dd67ec1b9f7ef6ebe489ce5cdd50c3297f3300fe --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/Test.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/Test.json @@ -3,13 +3,13 @@ "driver": { "type": "JSUnitTest", "test-timeout": "60000", - "package": "com.example.getallformsinfo10", + "package": "com.example.formszero", "shell-timeout": "60000" }, "kits": [ { "test-file-name": [ - "GetAllFormsInfo10.hap", + "ActsFormsZeroTest.hap", "ActsFormSystemTestServiceD.hap" ], "type": "AppInstallKit", diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/config.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/config.json old mode 100644 new mode 100755 similarity index 81% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/config.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/config.json index 554be55d7186b6047a9cdafcf59acf62a171fdc0..dd98f5d3ae94f39da83e82bd99ca0d864ff2d34f --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/config.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/config.json @@ -1,63 +1,63 @@ -{ - "app": { - "bundleName": "com.example.getallformsinfo201", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.getallformsinfo201", - "name": ".MyApplication", - "mainAbility": "com.example.getallformsinfo201.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.example.getallformsinfo201.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } +{ + "app": { + "bundleName": "com.example.formszero", + "vendor": "example", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 5, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.formszero", + "name": ".MyApplication", + "mainAbility": "com.example.formszero.MainAbility", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "visible": true, + "name": "com.example.formszero.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/app.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/app.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/app.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/app.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/i18n/en-US.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/i18n/en-US.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/i18n/en-US.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/i18n/en-US.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/i18n/zh-CN.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/i18n/zh-CN.json old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/i18n/zh-CN.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/i18n/zh-CN.json diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/pages/index/index.css b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/pages/index/index.css old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/pages/index/index.css rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/pages/index/index.css diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/pages/index/index.hml b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/pages/index/index.hml old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/pages/index/index.hml rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/pages/index/index.hml diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/pages/index/index.js old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/default/pages/index/index.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/default/pages/index/index.js diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js new file mode 100755 index 0000000000000000000000000000000000000000..6dbf59aeab6267ed9e873982c7a81eed52607f01 --- /dev/null +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/FormsZeroJsunit.test.js @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formManager from '@ohos.ability.formManager' +import {describe, it, expect} from 'deccjsunit/index' + +const TIMEOUT = 3000; +describe('ActsFormsZeroTest', function () { + console.log("ActsFormsZeroTest===start"); + + /** + * @tc.name getAllFormsInfo test + * @tc.number FMS_getFormsInfo_0300 + * @tc.desc All form configuration information is empty (by AsyncCallback) + */ + it('FMS_getFormsInfo_0300_callback', 0, async function (done) { + console.log("FMS_getFormsInfo_0300_callback begin"); + var ret = formManager.getAllFormsInfo( + (result, data) => { + var dataD = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviced"; + }); + console.log("FMS_getFormsInfo_0300_callback, dataB json:" + JSON.stringify(data)); + console.log("FMS_getFormsInfo_0300_callback, dataB json:" + JSON.stringify(dataD)); + console.log("FMS_getFormsInfo_0300_callback, the all forms number:" + data.length); + console.log("FMS_getFormsInfo_0300_callback, the formD number:" + dataD.length); + console.log("FMS_getFormsInfo_0300_callback async::result, result:" + result); + expect(dataD.length).assertEqual(0); + console.log("FMS_getFormsInfo_0300_callback result end"); + done(); + } + ); + setTimeout(function () { + console.info('=====================FMS_getFormsInfo_0300_callback==================end'); + }, TIMEOUT) + console.log("FMS_getFormsInfo_0300_callback end, ret:" + ret); + }) + + /** + * @tc.name getAllFormsInfo test + * @tc.number FMS_getFormsInfo_0300 + * @tc.desc All form configuration information is empty (by Promise) + */ + it('FMS_getFormsInfo_0300_promise', 0, async function (done) { + console.log("FMS_getFormsInfo_0300_promise begin"); + var ret = formManager.getAllFormsInfo( + (result, data) => { + console.log("FMS_getFormsInfo_0300_promise, data json:" + JSON.stringify(data)); + console.log("FMS_getFormsInfo_0300_promise, the all forms number:" + data.length); + console.log("FMS_getFormsInfo_0300_promise async::result, result:" + result); + console.log("FMS_getFormsInfo_0300_promise result end"); + if (data.length != 0){ + var dataD = data.filter((p) => { + return p.bundleName == "com.form.formsystemtestserviced"; + }); + console.log("FMS_getFormsInfo_0300_promise, dataB json:" + JSON.stringify(dataD)); + console.log("FMS_getFormsInfo_0300_promise, the formD number:" + dataD.length); + expect(dataD.length).assertEqual(0); + console.log("FMS_getFormsInfo_0300_promise result end"); + done(); + } else { + var promise = formManager.getAllFormsInfo(); + promise.then((result) => { + console.log("FMS_getFormsInfo_0300_promise result:" + result); + expect(result).assertEqual(0); + console.log("FMS_getFormsInfo_0300_promise result end"); + done(); + }); + } + } + ); + setTimeout(function () { + console.info('=====================FMS_getFormsInfo_0300_promise==================end'); + }, TIMEOUT) + console.log("FMS_getFormsInfo_0300_promise end, ret:" + ret); + }) + +}) diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 similarity index 93% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/test/List.test.js rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/List.test.js index 19587c5de5b0357b91fffdbf34349d8a0bef753f..dffd56ce04ff40f04751919b004095ee0e51a137 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/js/test/List.test.js @@ -13,4 +13,4 @@ * limitations under the License. */ -require('./GetAllFormsInfo212Jsunit.test.js') \ No newline at end of file +require('./FormsZeroJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 similarity index 79% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/resources/base/element/string.json rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/resources/base/element/string.json index 18cf63518c1c74e19236272c28e8aee4ff4b077f..2eacd82ce7a8aa495f1252381f0fb709b1f37124 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "GetAllFormsInfo10" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "formszero" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/entry/src/main/resources/base/media/icon.png rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/entry/src/main/resources/base/media/icon.png diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/signature/openharmony_sx.p7b old mode 100644 new mode 100755 similarity index 100% rename from aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo212/signature/openharmony_sx.p7b rename to aafwk/aafwk_standard/formmanager/formsystemtesthost/actsformszerotest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/test/GetAllFormsInfo10Jsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/test/GetAllFormsInfo10Jsunit.test.js deleted file mode 100644 index 3ad6411abc6ddfd0f4a08861b05c0a570e925d79..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo10/entry/src/main/js/test/GetAllFormsInfo10Jsunit.test.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formManager from '@ohos.ability.formManager' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const TIMEOUT = 3000; -describe('getAllFormsInfoTest', function () { - console.log("system application and has permissions Test"); - - /** - * @tc.name getAllFormsInfo test - * @tc.number FMS_getFormsInfo_0300 - * @tc.desc All form configuration information is empty (by AsyncCallback) - */ - it('FMS_getFormsInfo_0300_callback', 0, async function (done) { - console.log("FMS_getFormsInfo_0300_callback begin"); - - var ret = formManager.getAllFormsInfo( - (result, data) => { - console.log("FMS_getFormsInfo_0300_callback async::sucess, data json:" - + JSON.stringify(data)); - console.log("FMS_getFormsInfo_0300_callback async::result, result:" + result); - expect(result).assertEqual(0); - console.log("FMS_getFormsInfo_0300_callback result end"); - done(); - } - ); - - setTimeout(function () { - console.info('=====================FMS_getFormsInfo_0300_callback==================end'); - }, TIMEOUT) - console.log("FMS_getFormsInfo_0300_callback end, ret:"+ret); - }) - - /** - * @tc.name getAllFormsInfo test - * @tc.number FMS_getFormsInfo_0300 - * @tc.desc All form configuration information is empty (by Promise) - */ - it('FMS_getFormsInfo_0300_promise', 0, async function (done) { - console.log("FMS_getFormsInfo_0300_promise begin"); - - var promise = formManager.getAllFormsInfo(); - promise.then((result) => { - console.log("FMS_getFormsInfo_0300_promise result:" + result); - expect(result).assertEqual(0); - console.log("FMS_getFormsInfo_0300_promise result end"); - done(); - } - ); - - setTimeout(function () { - console.info('=====================FMS_getFormsInfo_0300_promise==================end'); - }, TIMEOUT) - }) - -}) diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/test/GetAllFormsInfo201Jsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/test/GetAllFormsInfo201Jsunit.test.js deleted file mode 100644 index a0eea8c99d428fa69b3068461cf594c6c792e28b..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo201/entry/src/main/js/test/GetAllFormsInfo201Jsunit.test.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formManager from '@ohos.ability.formManager' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const TIMEOUT = 3000; -describe('getAllFormsInfoTest', function () { - console.log("system application and has permissions Test"); - - /** - * @tc.name getAllFormsInfo test - * @tc.number FMS_getFormsInfo_0400 - * @tc.desc All form configuration information is queried successfully (by AsyncCallback) - */ - it('FMS_getFormsInfo_0400_callback', 0, async function (done) { - console.log("FMS_getFormsInfo_0400_callback begin"); - - var ret = formManager.getAllFormsInfo( - (result, data) => { - console.log("FMS_getFormsInfo_0400_callback async::sucess, data json:" - + JSON.stringify(data)); - console.log("FMS_getFormsInfo_0400_callback async::result, result:" + result); - expect(result).assertEqual(1); - - expect(data[0].description).assertEqual("form_description"); - expect(data[0].type).assertEqual(1); - expect(data[0].colorMode).assertEqual(-1); - expect(data[0].jsComponentName).assertEqual("card"); - expect(data[0].isDefault).assertEqual(1); - expect(data[0].updateEnabled).assertEqual(1); - expect(data[0].updateDuration).assertEqual(1); - expect(data[0].scheduledUpdateTime).assertEqual("10:30"); - expect(data[0].formVisibleNotify).assertEqual(1); - expect(data[0].defaultDimension).assertEqual(1); - expect(data[0].supportDimensions[0]).assertEqual(1); - expect(data[0].supportDimensions[1]).assertEqual(2); - expect(data[0].metaData.customizeData[0].name).assertEqual("originWidgetName"); - expect(data[0].metaData.customizeData[0].value).assertEqual("myTest"); - - expect(data[0].name).assertEqual("FormB_Js001"); - console.log("FMS_getFormsInfo_0400_callback result end"); - done(); - } - ); - - setTimeout(function () { - console.info('=====================FMS_getFormsInfo_0400_callback==================end'); - }, TIMEOUT) - console.log("FMS_getFormsInfo_0400_callback end, ret:"+ret); - }) - - /** - * @tc.name getAllFormsInfo test - * @tc.number FMS_getFormsInfo_0400 - * @tc.desc All form configuration information is queried successfully (by Promise) - */ - it('FMS_getFormsInfo_0400_promise', 0, async function (done) { - console.log("FMS_getFormsInfo_0400_promise begin--------111"); - - var promise = formManager.getAllFormsInfo(); - promise.then((data) => { - console.log("FMS_getFormsInfo_0400_promise async::sucess, data json:" + JSON.stringify(data)); - - expect(data[0].description).assertEqual("form_description"); - expect(data[0].type).assertEqual(1); - expect(data[0].colorMode).assertEqual(-1); - expect(data[0].jsComponentName).assertEqual("card"); - expect(data[0].isDefault).assertEqual(1); - expect(data[0].updateEnabled).assertEqual(1); - expect(data[0].updateDuration).assertEqual(1); - expect(data[0].scheduledUpdateTime).assertEqual("10:30"); - expect(data[0].formVisibleNotify).assertEqual(1); - expect(data[0].defaultDimension).assertEqual(1); - expect(data[0].supportDimensions[0]).assertEqual(1); - expect(data[0].supportDimensions[1]).assertEqual(2); - expect(data[0].metaData.customizeData[0].name).assertEqual("originWidgetName"); - expect(data[0].metaData.customizeData[0].value).assertEqual("myTest"); - - expect(data[0].name).assertEqual("FormB_Js001"); - console.log("FMS_getFormsInfo_0400_promise result end"); - done(); - } - ); - - setTimeout(function () { - console.info('=====================FMS_getFormsInfo_0400_promise==================end'); - }, TIMEOUT) - }) - -}) diff --git a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/test/GetAllFormsInfo211Jsunit.test.js b/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/test/GetAllFormsInfo211Jsunit.test.js deleted file mode 100644 index e5be70a3f28265b92ba9d0dcc151d9d422872e64..0000000000000000000000000000000000000000 --- a/aafwk/aafwk_standard/formmanager/formsystemtesthost/getallformsinfo211/entry/src/main/js/test/GetAllFormsInfo211Jsunit.test.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import formManager from '@ohos.ability.formManager' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' - -const TIMEOUT = 3000; -describe('getAllFormsInfoTest', function () { - console.log("system application and has permissions Test"); - - /** - * @tc.name getAllFormsInfo test - * @tc.number FMS_getFormsInfo_0500 - * @tc.desc All form configuration information is queried successfully (by AsyncCallback) - */ - it('FMS_getFormsInfo_0500_callback', 0, async function (done) { - console.log("FMS_getFormsInfo_0500_callback begin"); - - var ret = formManager.getAllFormsInfo( - (result, data) => { - console.log("FMS_getFormsInfo_0500_callback async::sucess, data json:" - + JSON.stringify(data)); - console.log("FMS_getFormsInfo_0500_callback async::result, result:" + result); - expect(result).assertEqual(1); - - for(var i = 0; i < data.length; i++) { - expect(data[i].description).assertEqual("form_description"); - expect(data[i].type).assertEqual(1); - expect(data[i].colorMode).assertEqual(-1); - expect(data[i].jsComponentName).assertEqual("card"); - expect(data[i].isDefault).assertEqual(1); - expect(data[i].updateEnabled).assertEqual(1); - expect(data[i].updateDuration).assertEqual(1); - expect(data[i].scheduledUpdateTime).assertEqual("10:30"); - expect(data[i].formVisibleNotify).assertEqual(1); - expect(data[i].defaultDimension).assertEqual(1); - expect(data[i].supportDimensions[0]).assertEqual(1); - expect(data[i].supportDimensions[1]).assertEqual(2); - expect(data[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); - expect(data[i].metaData.customizeData[0].value).assertEqual("myTest"); - } - - expect(data[0].name).assertEqual("FormB_Js001"); - expect(data[1].name).assertEqual("FormC_Js001"); - console.log("FMS_getFormsInfo_0500_callback result end"); - done(); - } - ); - - setTimeout(function () { - console.info('=====================FMS_getFormsInfo_0500_callback==================end'); - }, TIMEOUT) - console.log("FMS_getFormsInfo_0500_callback end, ret:"+ret); - }) - - /** - * @tc.name getAllFormsInfo test - * @tc.number FMS_getFormsInfo_0500 - * @tc.desc All form configuration information is queried successfully (by Promise) - */ - it('FMS_getFormsInfo_0500_promise', 0, async function (done) { - console.log("FMS_getFormsInfo_0500_promise begin--------111"); - - var promise = formManager.getAllFormsInfo(); - promise.then((data) => { - console.log("FMS_getFormsInfo_0500_promise async::sucess, data json:" + JSON.stringify(data)); - - for(var i = 0; i < data.length; i++) { - expect(data[i].description).assertEqual("form_description"); - expect(data[i].type).assertEqual(1); - expect(data[i].colorMode).assertEqual(-1); - expect(data[i].jsComponentName).assertEqual("card"); - expect(data[i].isDefault).assertEqual(1); - expect(data[i].updateEnabled).assertEqual(1); - expect(data[i].updateDuration).assertEqual(1); - expect(data[i].scheduledUpdateTime).assertEqual("10:30"); - expect(data[i].formVisibleNotify).assertEqual(1); - expect(data[i].defaultDimension).assertEqual(1); - expect(data[i].supportDimensions[0]).assertEqual(1); - expect(data[i].supportDimensions[1]).assertEqual(2); - expect(data[i].metaData.customizeData[0].name).assertEqual("originWidgetName"); - expect(data[i].metaData.customizeData[0].value).assertEqual("myTest"); - } - - expect(data[0].name).assertEqual("FormB_Js001"); - expect(data[1].name).assertEqual("FormC_Js001"); - console.log("FMS_getFormsInfo_0500_promise result end"); - done(); - } - ); - - setTimeout(function () { - console.info('=====================FMS_getFormsInfo_0500_promise==================end'); - }, TIMEOUT) - }) - -})