diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets index 9ec7ce2d67c2b0adc3a0d326487f4d4ca61477d6..cd248861eeb1a25cdbd1bab32b9e266f03cf2d8a 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/pages/index.ets @@ -40,7 +40,7 @@ struct Index { core.init(); core.subscribeEvent('task', reportExtend); const configService = core.getDefaultService('config'); - want.parameters['timeout'] = 10000; + want.parameters['timeout'] = 20000; console.info('[FormComponent] parameters---->' + JSON.stringify(want.parameters)); configService.setConfig(want.parameters); testsuite(); diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets index 2b2dbf69f1f59ecc7c9b98382fc0768e32b0a267..a441a41cab763d925c649dd0ad5e749472bac451 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets @@ -599,7 +599,6 @@ export default function test() { async function delPublishCallbackB() { console.info(`${tcNumber} delPublishCallbackB`); - await sleep(1000); console.info(`${tcNumber} delPublishCallbackB end`); console.info(`${tcNumber} end`); done(); diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets index 9f9d15cf6c88c8bd388025fecf7d244c8fe89df2..31f4d1f1c3b27ac24a08d898b5c6e207853637cd 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets @@ -81,6 +81,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); console.log(`${callbackName} should not reach here`); expect().assertFail(); + done(); } }); @@ -97,6 +98,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${promiseName} getFormsInfo data: ${JSON.stringify(data)}`); console.log(`${promiseName} should not reach here`); expect().assertFail(); + done(); } catch (error) { console.log(`${promiseName} exception caught: ${JSON.stringify(error)})`); expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); @@ -177,7 +179,6 @@ export const getFormsInfoTest = (describeName, filterParameter) => { tempDataB = dataB[0] expect(error.code).assertEqual(ERR_OK_CODE); expect(error.message).assertEqual(ERR_OK); - done(); console.log(`==========${callbackName2} ${describeName} end==========`); }); await sleep(2000) @@ -232,9 +233,9 @@ export const getFormsInfoTest = (describeName, filterParameter) => { expect(FormInfo.FormType.JS).assertEqual(formInfo.type) expect('card_b').assertEqual(formInfo.jsComponentName) expect(FormInfo.ColorMode.MODE_AUTO).assertEqual(formInfo.colorMode) - expect(1).assertEqual(formInfo.isDefault) - expect(1).assertEqual(formInfo.updateEnabled) - expect(1).assertEqual(formInfo.formVisibleNotify) + expect(formInfo.isDefault).assertTrue() + expect(formInfo.updateEnabled).assertTrue() + expect(formInfo.formVisibleNotify).assertTrue() expect(undefined).assertEqual(formInfo.relatedBundleName) expect("abilityb").assertEqual(formInfo.formConfigAbility) expect(3).assertEqual(formInfo.updateDuration) @@ -242,8 +243,8 @@ export const getFormsInfoTest = (describeName, filterParameter) => { expect('10:30').assertEqual(formInfo.scheduledUpdateTime) expect(1).assertEqual(formInfo.supportDimensions[0]) expect(2).assertEqual(formInfo.supportDimensions[1]) - expect('originWidgetNameB').assertEqual(formInfo.metaData.customizeData[0].name) - expect('valueB').assertEqual(formInfo.metaData.customizeData[0].value) + expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name) + expect('valueB').assertEqual(formInfo.customizeData[0].value) } /** @@ -283,6 +284,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${promiseName3} getFormsInfo data: ${JSON.stringify(data)}`); console.log(`${promiseName3} should not reach here`); expect().assertFail(); + done(); } catch (error) { console.log(`${promiseName3} exception caught: ${JSON.stringify(error)})`); expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); @@ -312,6 +314,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${callbackName4} exception caught: ${JSON.stringify(error)})`); console.log(`${callbackName4} should not reach here`); expect().assertFail(); + done(); } }); @@ -328,6 +331,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${promiseName4} getFormsInfo data: ${JSON.stringify(data)}`); console.log(`${promiseName4} should not reach here`); expect().assertFail(); + done(); } catch (error) { console.log(`${promiseName4} exception caught: ${JSON.stringify(error)})`); expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); @@ -357,6 +361,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${callbackName5} exception caught: ${JSON.stringify(error)})`); console.log(`${callbackName5} should not reach here`); expect().assertFail(); + done(); } }); @@ -373,6 +378,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${promiseName5} getFormsInfo data: ${JSON.stringify(data)}`); console.log(`${promiseName5} should not reach here`); expect().assertFail(); + done(); } catch (error) { console.log(`${promiseName5} exception caught: ${JSON.stringify(error)})`); expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); @@ -403,6 +409,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${callbackName6} exception caught: ${JSON.stringify(error)})`); console.log(`${callbackName6} should not reach here`); expect().assertFail(); + done(); } }); @@ -424,6 +431,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${promiseName6} exception caught: ${JSON.stringify(error)})`); console.log(`${promiseName6} should not reach here`); expect().assertFail(); + done(); } }); @@ -460,6 +468,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${callbackName7} exception caught: ${JSON.stringify(error)})`); console.log(`${callbackName7} should not reach here`); expect().assertFail(); + done(); } }); @@ -492,6 +501,7 @@ export const getFormsInfoTest = (describeName, filterParameter) => { console.log(`${promiseName7} exception caught: ${JSON.stringify(error)})`); console.log(`${promiseName7} should not reach here`); expect().assertFail(); + done(); } }); @@ -504,17 +514,17 @@ export const getFormsInfoTest = (describeName, filterParameter) => { expect(FormInfo.FormType.JS).assertEqual(formInfo.type) expect('card_c').assertEqual(formInfo.jsComponentName) expect(FormInfo.ColorMode.MODE_LIGHT).assertEqual(formInfo.colorMode) - expect(1).assertEqual(formInfo.isDefault) - expect(1).assertEqual(formInfo.updateEnabled) - expect(1).assertEqual(formInfo.formVisibleNotify) + expect(formInfo.isDefault).assertTrue() + expect(formInfo.updateEnabled).assertTrue() + expect(formInfo.formVisibleNotify).assertTrue() expect(undefined).assertEqual(formInfo.relatedBundleName) expect("abilityc").assertEqual(formInfo.formConfigAbility) expect(4).assertEqual(formInfo.updateDuration) expect(3).assertEqual(formInfo.defaultDimension) expect(3).assertEqual(formInfo.supportDimensions[0]) expect(4).assertEqual(formInfo.supportDimensions[1]) - expect('originWidgetNameC').assertEqual(formInfo.metaData.customizeData[0].name) - expect('valueC').assertEqual(formInfo.metaData.customizeData[0].value) + expect('originWidgetNameC').assertEqual(formInfo.customizeData[0].name) + expect('valueC').assertEqual(formInfo.customizeData[0].value) } }); }; diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets index c6729cded35792779ddf4762228df60e3c12ad13..3437587e817b12ce0c0e62ac824233437df4f14f 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets @@ -31,7 +31,9 @@ var deleteForm_Event = "FMS_FormDelete_commonEvent"; var subscriberOnAcquired; var subscriberOnDeleted; var subscriberOnReleased; - +function sleep(time) { + return new Promise((resolve)=>setTimeout(resolve,time)); +} export default function test() { describe(`FmsReleaseFormTest`, () => { @@ -437,12 +439,12 @@ export default function test() { } } } - function releaseForms() { + async function releaseForms() { console.debug("====>FMS_releaseForm_1300 releaseForms====>"); commonEvent.subscribe(subscriberOnReleased, onReleasedCallBack); for(var iIndex = 0; iIndex < formIdList.length; iIndex++) { console.log(`FMS_releaseForm_1300 featureAbility.startAbility start`); - featureAbility.startAbility({ + await featureAbility.startAbility({ want: { bundleName: "com.ohos.st.formsystemhostc", abilityName: "com.ohos.st.formsystemhostc.MainAbility", @@ -465,6 +467,7 @@ export default function test() { expect().assertFail(); done(); }); + await sleep(1000) console.log(`FMS_releaseForm_1300 featureAbility.startAbility end`); } }