diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets index 7870950c2f224e462b107a950d784b0a4ebaac6d..c8d058de57b2c1cc43d4e4078f3a1bc02885e4c9 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/GetFormsInfoFuzz.test.ets @@ -43,7 +43,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => { formHost.getFormsInfo(bundleName, (error, data) => { console.log(`FMS_fuzzTest_getinfobundle ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); expect(data).assertUndefined(); - if (`STRING` === dataType) { + if (`string` === typeof bundleName) { expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); } else { @@ -79,7 +79,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => { expect().assertFail(); } catch (error) { console.log(`FMS_fuzzTest_getinfobundle ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { + if (`string` === typeof bundleName) { expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); } else { @@ -108,7 +108,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => { formHost.getFormsInfo(bundleName, moduleName, (error, data) => { console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); expect(data).assertUndefined(); - if (`STRING` === dataType) { + if (`string` === typeof bundleName) { expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); } else { @@ -146,7 +146,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => { expect().assertFail(); } catch (error) { console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { + if (`string` === typeof bundleName) { expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); } else { @@ -175,7 +175,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => { formHost.getFormsInfo(bundleName, moduleName, (error, data) => { console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); expect(data).assertUndefined(); - if (`STRING` === dataType) { + if (`string` === typeof moduleName) { expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); } else { @@ -212,7 +212,7 @@ export const getFormsInfoFuzzTest = (describeName, filterParameter) => { expect().assertFail(); } catch (error) { console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { + if (`string` === typeof moduleName) { expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE); expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED); } else { diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets index 0dc146dba93b773d41c0babe10c55ead09a73f4d..a5c4ddfe781c75cba27f0d19c4da6d4b19bdea47 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/ReleaseFormFuzz.test.ets @@ -76,7 +76,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => { expect().assertFail(); } catch (error) { console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { + if (`string` === typeof formId) { expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); } else { @@ -137,7 +137,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => { expect().assertFail(); } catch (error) { console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`STRING` === dataType) { + if (`string` === typeof formId) { expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE); expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM); } else { @@ -166,7 +166,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => { formHost.releaseForm(formId, isReleaseCache, (error, data) => { console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); expect(data).assertUndefined(); - if (`BOOLEAN` === dataType) { + if (`boolean` === typeof isReleaseCache) { expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE); expect(error.message).assertEqual(ERR_NOT_EXIST_ID); } else { @@ -203,7 +203,7 @@ export const releaseFormFuzzTest = (describeName, filterParameter) => { expect().assertFail(); } catch (error) { console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`BOOLEAN` === dataType) { + if (`boolean` === typeof isReleaseCache) { expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE); expect(error.message).assertEqual(ERR_NOT_EXIST_ID); } else { diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets index 4d030380aa50610615aaf7b07dcaa68999bfaa2c..70c2eb0ca30b6295ed75c7e63a881d3cc211bf89 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/SetFormNextRefreshTimeFuzz.test.ets @@ -104,7 +104,7 @@ export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) => formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => { console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`); expect(data).assertUndefined(); - if (`NUMBER` === dataType) { + if (`number` === typeof nextTime) { if (ERR_NOT_EXIST_ID_CODE === error.code) { expect(error.message).assertEqual(ERR_NOT_EXIST_ID); } else if (ERR_ADD_INVALID_PARAM_CODE === error.code) { @@ -147,7 +147,7 @@ export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) => expect().assertFail(); } catch (error) { console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`); - if (`NUMBER` === dataType) { + if (`number` === typeof nextTime) { if (ERR_NOT_EXIST_ID_CODE === error.code) { expect(error.message).assertEqual(ERR_NOT_EXIST_ID); } else if (ERR_ADD_INVALID_PARAM_CODE === error.code) { diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets index 440f7aaa956c860d494a70e89a4913aee266673c..f4cf0821260244921a28156973d46ff277e6541b 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formfuzztest/entry/src/main/ets/test/getParam.ets @@ -149,9 +149,9 @@ const getFuzzData = (datatype: string) => { switch (datatype) { case 'ARRAY': let array1 = arrayTest(); - let array2 = array1.join("") - if (isNaN(Number(array2))) { - return array1; + let array2 = array1 + if (isNaN(Number(array1.join("")))) { + return array2; } else { getFuzzData(DATA_TYPE_LIST[0]); } diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets index 4c1f78b33dd9874973265b89cfaece97c59fb8fd..371a116803bf0aad3401409221e6da622d44d7d4 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/test/FmsStress.test.ets @@ -68,7 +68,6 @@ export default function test() { commonEvent.unsubscribe(onDeletedEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onDeletedEventSubscriber")); commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber")); commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber")); - await sleep(1000); await featureAbility.startAbility({ want: { bundleName: "com.ohos.st.formstresstest", @@ -79,6 +78,7 @@ export default function test() { }).catch((err) => { console.log("FmsStressTest startAbility err: " + JSON.stringify(err)); }) + await sleep(2000); }) const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => { diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets index 2e1c9c888dcc66407e2fd6f7227052dd1cdb5f80..9d84b65cab527595a82b8b76cadefc9137a5b839 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/test/FmsUpdateRefreshForm.test.ets @@ -65,7 +65,6 @@ export default function test() { commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted")); commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh")); commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRequest")); - await sleep(1000); await featureAbility.startAbility({ want: { bundleName: "com.ohos.st.formupdaterefreshtest", @@ -76,6 +75,7 @@ export default function test() { }).catch((err) => { console.log("FmsUpdateRefreshFormTest startAbility err: " + JSON.stringify(err)); }) + await sleep(2000); }) /** * @tc.number: FMS_updateForm_0100