未验证 提交 9f285899 编写于 作者: O openharmony_ci 提交者: Gitee

!4659 XTS元能力form失败用例适配

Merge pull request !4659 from chengxingzhen/OpenHarmony-3.2-Beta2
...@@ -395,7 +395,7 @@ function checkFormInfoModule1(formInfo){ ...@@ -395,7 +395,7 @@ function checkFormInfoModule1(formInfo){
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertFalse() expect(formInfo.formVisibleNotify).assertFalse()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("ability://xxxxx").assertEqual(formInfo.formConfigAbility) expect("ability://xxxxx").assertEqual(formInfo.formConfigAbility)
expect(1).assertEqual(formInfo.updateDuration) expect(1).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension) expect(2).assertEqual(formInfo.defaultDimension)
...@@ -413,7 +413,7 @@ function checkFormInfo(formInfo){ ...@@ -413,7 +413,7 @@ function checkFormInfo(formInfo){
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertFalse() expect(formInfo.formVisibleNotify).assertFalse()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("ability://xxxxx").assertEqual(formInfo.formConfigAbility) expect("ability://xxxxx").assertEqual(formInfo.formConfigAbility)
expect(1).assertEqual(formInfo.updateDuration) expect(1).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension) expect(2).assertEqual(formInfo.defaultDimension)
......
...@@ -191,7 +191,7 @@ struct Index { ...@@ -191,7 +191,7 @@ struct Index {
commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack); commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack);
}) })
.catch((error) => { .catch((error) => {
console.info('formsystemhost refreshForm error:' + error); console.info('formsystemhost refreshForm error:' + JSON.stringify(error));
let commonEventPublishData = { let commonEventPublishData = {
data: error.code.toString(), data: error.code.toString(),
parameters: { parameters: {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onErrorForm_Event = { var onErrorForm_Event = {
events: ["FMS_FormOnError_commonEvent"], events: ["FMS_FormOnError_commonEvent"],
...@@ -30,6 +30,10 @@ var onSupplyEvent = { ...@@ -30,6 +30,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnError; var subscriberOnError;
...@@ -48,6 +52,14 @@ export default function test() { ...@@ -48,6 +52,14 @@ export default function test() {
await sleep(1000); await sleep(1000);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnError, () => unsubscribeCallback("afterEach unsubscribe subscriberOnError"));
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_acquireForm_0200 * @tc.number: FMS_acquireForm_0200
* @tc.name: The form host does not have permission to use the form * @tc.name: The form host does not have permission to use the form
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onErrorForm_Event = { var onErrorForm_Event = {
events: ["FMS_FormOnError_commonEvent"], events: ["FMS_FormOnError_commonEvent"],
...@@ -30,6 +30,10 @@ var onSupplyEvent = { ...@@ -30,6 +30,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnError; var subscriberOnError;
...@@ -37,6 +41,10 @@ var subscriberOnAcquired; ...@@ -37,6 +41,10 @@ var subscriberOnAcquired;
var subscriberCast; var subscriberCast;
var subscriberSupply; var subscriberSupply;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() { export default function test() {
describe(`FmsAcquiredFormTest2`, () => { describe(`FmsAcquiredFormTest2`, () => {
...@@ -47,6 +55,14 @@ export default function test() { ...@@ -47,6 +55,14 @@ export default function test() {
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent); subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnError, () => unsubscribeCallback("afterEach unsubscribe subscriberOnError"));
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_acquireForm_3800 * @tc.number: FMS_acquireForm_3800
* @tc.name: Failed to add form when parameter ability is wrong. * @tc.name: Failed to add form when parameter ability is wrong.
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import systemTime from '@ohos.systemTime'; import systemTime from '@ohos.systemTime';
import { beforeEach, describe, expect, it } from 'deccjsunit/index'; import { beforeEach, afterEach, describe, expect, it } from 'deccjsunit/index';
const onAcquiredForm_Event = { const onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -31,6 +31,10 @@ const onSupplyEvent = { ...@@ -31,6 +31,10 @@ const onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
const deleteForm_Event = "FMS_FormDelete_commonEvent"; const deleteForm_Event = "FMS_FormDelete_commonEvent";
let subscriberOnAcquired; let subscriberOnAcquired;
...@@ -49,6 +53,14 @@ export default function test() { ...@@ -49,6 +53,14 @@ export default function test() {
await sleep(1000); await sleep(1000);
}); });
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeCallback("afterEach unsubscribe subscriberOnReleased"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_deleteForm_0200 * @tc.number: FMS_deleteForm_0200
* @tc.name: host does not have permission * @tc.name: host does not have permission
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from 'deccjsunit/index'; import { beforeEach, afterEach, describe, expect, it } from 'deccjsunit/index';
const onAcquiredForm_Event = { const onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -33,6 +33,10 @@ const onSupplyEvent = { ...@@ -33,6 +33,10 @@ const onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
const deleteForm_Event = "FMS_FormDelete_commonEvent"; const deleteForm_Event = "FMS_FormDelete_commonEvent";
let subscriberOnAcquired; let subscriberOnAcquired;
...@@ -51,6 +55,14 @@ export default function test() { ...@@ -51,6 +55,14 @@ export default function test() {
await sleep(1000); await sleep(1000);
}); });
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_timedRefresh_0100 * @tc.number: FMS_timedRefresh_0100
* @tc.name: formID id is error(formID < 0) * @tc.name: formID id is error(formID < 0)
......
...@@ -62,12 +62,12 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -62,12 +62,12 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
tempDataC = dataC[0]; tempDataC = dataC[0];
expect(error.code).assertEqual(ERR_OK_CODE); expect(error.code).assertEqual(ERR_OK_CODE);
expect(error.message).assertEqual(ERR_OK); expect(error.message).assertEqual(ERR_OK);
console.log(`==========${callbackName} ${describeName} end==========`);
}); });
await sleep(2000) await sleep(2000)
checkDataB(tempDataB) checkDataB(tempDataB)
checkDataC(tempDataC) checkDataC(tempDataC)
done(); done();
console.log(`==========${callbackName} ${describeName} end==========`);
} catch (error) { } catch (error) {
console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`); console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`);
console.log(`${callbackName} should not reach here`); console.log(`${callbackName} should not reach here`);
...@@ -104,7 +104,8 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -104,7 +104,8 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(dataC.length).assertEqual(1); expect(dataC.length).assertEqual(1);
tempDataB = dataB[0]; tempDataB = dataB[0];
tempDataC = dataC[0]; tempDataC = dataC[0];
checkDataB(tempDataB)
checkDataC(tempDataC)
done(); done();
console.log(`==========${promiseName} ${describeName} end==========`); console.log(`==========${promiseName} ${describeName} end==========`);
} catch (error) { } catch (error) {
...@@ -126,15 +127,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -126,15 +127,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility) expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration) expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension) expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime) expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0]) expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1]) expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name) expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
} }
function checkDataC(formInfo){ function checkDataC(formInfo){
expect("com.ohos.st.formsystemproviderc").assertEqual(formInfo.bundleName) expect("com.ohos.st.formsystemproviderc").assertEqual(formInfo.bundleName)
...@@ -148,15 +148,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -148,15 +148,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilityc").assertEqual(formInfo.formConfigAbility) expect("abilityc").assertEqual(formInfo.formConfigAbility)
expect(4).assertEqual(formInfo.updateDuration) expect(4).assertEqual(formInfo.updateDuration)
expect('15:30').assertEqual(formInfo.scheduledUpdateTime) expect('15:30').assertEqual(formInfo.scheduledUpdateTime)
expect(3).assertEqual(formInfo.defaultDimension) expect(3).assertEqual(formInfo.defaultDimension)
expect(3).assertEqual(formInfo.supportDimensions[0]) expect(3).assertEqual(formInfo.supportDimensions[0])
expect(4).assertEqual(formInfo.supportDimensions[1]) expect(4).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameC').assertEqual(formInfo.customizeData[0].name) expect('valueC').assertEqual(formInfo.customizeData.originWidgetNameC)
expect('valueC').assertEqual(formInfo.customizeData[0].value)
} }
}); });
}; };
...@@ -236,15 +236,14 @@ export const getFormsInfoTest = (describeName, filterParameter) => { ...@@ -236,15 +236,14 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility) expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration) expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension) expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime) expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0]) expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1]) expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name) expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
} }
/** /**
...@@ -517,14 +516,13 @@ export const getFormsInfoTest = (describeName, filterParameter) => { ...@@ -517,14 +516,13 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilityc").assertEqual(formInfo.formConfigAbility) expect("abilityc").assertEqual(formInfo.formConfigAbility)
expect(4).assertEqual(formInfo.updateDuration) expect(4).assertEqual(formInfo.updateDuration)
expect(3).assertEqual(formInfo.defaultDimension) expect(3).assertEqual(formInfo.defaultDimension)
expect(3).assertEqual(formInfo.supportDimensions[0]) expect(3).assertEqual(formInfo.supportDimensions[0])
expect(4).assertEqual(formInfo.supportDimensions[1]) expect(4).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameC').assertEqual(formInfo.customizeData[0].name) expect('valueC').assertEqual(formInfo.customizeData.originWidgetNameC)
expect('valueC').assertEqual(formInfo.customizeData[0].value)
} }
}); });
}; };
...@@ -132,15 +132,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -132,15 +132,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility) expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration) expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension) expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime) expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0]) expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1]) expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name) expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
} }
function checkDataA1(formInfo){ function checkDataA1(formInfo){
...@@ -155,15 +154,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -155,15 +154,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilitya01").assertEqual(formInfo.formConfigAbility) expect("abilitya01").assertEqual(formInfo.formConfigAbility)
expect(1).assertEqual(formInfo.updateDuration) expect(1).assertEqual(formInfo.updateDuration)
expect(1).assertEqual(formInfo.defaultDimension) expect(1).assertEqual(formInfo.defaultDimension)
expect('5:30').assertEqual(formInfo.scheduledUpdateTime) expect('5:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0]) expect(1).assertEqual(formInfo.supportDimensions[0])
expect(3).assertEqual(formInfo.supportDimensions[1]) expect(3).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameA01').assertEqual(formInfo.customizeData[0].name) expect('valueA01').assertEqual(formInfo.customizeData.originWidgetNameA01)
expect('valueA01').assertEqual(formInfo.customizeData[0].value)
} }
function checkDataA2(formInfo){ function checkDataA2(formInfo){
...@@ -178,7 +176,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -178,7 +176,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertFalse() expect(formInfo.isDefault).assertFalse()
expect(formInfo.updateEnabled).assertFalse() expect(formInfo.updateEnabled).assertFalse()
expect(formInfo.formVisibleNotify).assertFalse() expect(formInfo.formVisibleNotify).assertFalse()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilitya02").assertEqual(formInfo.formConfigAbility) expect("abilitya02").assertEqual(formInfo.formConfigAbility)
expect(2).assertEqual(formInfo.updateDuration) expect(2).assertEqual(formInfo.updateDuration)
expect(4).assertEqual(formInfo.defaultDimension) expect(4).assertEqual(formInfo.defaultDimension)
...@@ -187,8 +185,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -187,8 +185,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(2).assertEqual(formInfo.supportDimensions[1]) expect(2).assertEqual(formInfo.supportDimensions[1])
expect(3).assertEqual(formInfo.supportDimensions[2]) expect(3).assertEqual(formInfo.supportDimensions[2])
expect(4).assertEqual(formInfo.supportDimensions[3]) expect(4).assertEqual(formInfo.supportDimensions[3])
expect('originWidgetNameA02').assertEqual(formInfo.customizeData[0].name) expect('valueA02').assertEqual(formInfo.customizeData.originWidgetNameA02)
expect('valueA02').assertEqual(formInfo.customizeData[0].value)
} }
}); });
}; };
...@@ -122,15 +122,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => { ...@@ -122,15 +122,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue() expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue() expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue() expect(formInfo.formVisibleNotify).assertTrue()
expect(undefined).assertEqual(formInfo.relatedBundleName) expect('').assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility) expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration) expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension) expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime) expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0]) expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1]) expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name) expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
} }
}); });
}; };
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from 'deccjsunit/index'; import { beforeEach, afterEach, describe, expect, it } from 'deccjsunit/index';
const onAcquiredEvent = { const onAcquiredEvent = {
events: [`FMS_FormOnAcquired_commonEvent`], events: [`FMS_FormOnAcquired_commonEvent`],
...@@ -28,6 +28,11 @@ const onRequestEvent = { ...@@ -28,6 +28,11 @@ const onRequestEvent = {
}; };
const formOnTerminateEvent = `FMS_FormTerminate_commonEvent`; const formOnTerminateEvent = `FMS_FormTerminate_commonEvent`;
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
let tcNumber; let tcNumber;
let hostCounter; let hostCounter;
let providerCounter; let providerCounter;
...@@ -47,6 +52,13 @@ export default function test() { ...@@ -47,6 +52,13 @@ export default function test() {
onRequestEventSubscriber = await commonEvent.createSubscriber(onRequestEvent); onRequestEventSubscriber = await commonEvent.createSubscriber(onRequestEvent);
}); });
afterEach(async() => {
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
commonEvent.unsubscribe(onRequestEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onRequestEventSubscriber"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_hostDeathRecipient_0200 * @tc.number: FMS_hostDeathRecipient_0200
* @tc.name: Reset host ability and requestForm. * @tc.name: Reset host ability and requestForm.
......
...@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility';
import formHost from '@ohos.application.formHost'; import formHost from '@ohos.application.formHost';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import systemTime from '@ohos.systemTime'; import systemTime from '@ohos.systemTime';
import { beforeEach, describe, expect, it } from 'deccjsunit/index'; import { beforeEach, afterEach, describe, expect, it } from 'deccjsunit/index';
const onAcquiredEvent = { const onAcquiredEvent = {
events: [`FMS_FormOnAcquired_commonEvent`], events: [`FMS_FormOnAcquired_commonEvent`],
...@@ -38,9 +38,17 @@ const publishOnDeleteCallback = (tcNumber, done) => { ...@@ -38,9 +38,17 @@ const publishOnDeleteCallback = (tcNumber, done) => {
done(); done();
} }
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
let onAcquiredEventSubscriber; let onAcquiredEventSubscriber;
let onSupplyEventSubscriber; let onSupplyEventSubscriber;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() { export default function test() {
describe(`FmsPerformanceTest`, () => { describe(`FmsPerformanceTest`, () => {
...@@ -49,6 +57,12 @@ export default function test() { ...@@ -49,6 +57,12 @@ export default function test() {
onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent); onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent);
}); });
afterEach(async() => {
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_performanceTest_0100 * @tc.number: FMS_performanceTest_0100
* @tc.name: Performance test. * @tc.name: Performance test.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeAll, beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -28,6 +28,10 @@ var onReleasedFormEvent = { ...@@ -28,6 +28,10 @@ var onReleasedFormEvent = {
}; };
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var subscriberOnAcquired; var subscriberOnAcquired;
var subscriberOnDeleted; var subscriberOnDeleted;
var subscriberOnReleased; var subscriberOnReleased;
...@@ -45,6 +49,14 @@ export default function test() { ...@@ -45,6 +49,14 @@ export default function test() {
subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event);
subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent); subscriberOnDeleted = await commonEvent.createSubscriber(onDeletedFormEvent);
subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent); subscriberOnReleased = await commonEvent.createSubscriber(onReleasedFormEvent);
await sleep(1000);
})
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnReleased, () => unsubscribeCallback("afterEach unsubscribe subscriberOnReleased"));
await sleep(1000);
}) })
/** /**
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeAll, beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -33,6 +33,10 @@ var onSupplyEvent = { ...@@ -33,6 +33,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnAcquired; var subscriberOnAcquired;
...@@ -55,6 +59,14 @@ export default function test() { ...@@ -55,6 +59,14 @@ export default function test() {
await sleep(1000); await sleep(1000);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberDel, () => unsubscribeCallback("afterEach unsubscribe subscriberDel"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_disableFormsUpdate_0200 * @tc.number: FMS_disableFormsUpdate_0200
* @tc.name: The form user does not have permission. * @tc.name: The form user does not have permission.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeAll, beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -33,6 +33,10 @@ var onSupplyEvent = { ...@@ -33,6 +33,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnAcquired; var subscriberOnAcquired;
...@@ -55,6 +59,13 @@ export default function test() { ...@@ -55,6 +59,13 @@ export default function test() {
await sleep(1000); await sleep(1000);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberDel, () => unsubscribeCallback("afterEach unsubscribe subscriberDel"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_enableFormsUpdate_0200 * @tc.number: FMS_enableFormsUpdate_0200
* @tc.name: The form user does not have permission. * @tc.name: The form user does not have permission.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { describe, beforeEach, expect, it } from "deccjsunit/index"; import { describe, afterEach, beforeEach, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -33,6 +33,10 @@ var onSupplyEvent = { ...@@ -33,6 +33,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnAcquired; var subscriberOnAcquired;
...@@ -51,6 +55,13 @@ export default function test() { ...@@ -51,6 +55,13 @@ export default function test() {
await sleep(1000); await sleep(1000);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberDel, () => unsubscribeCallback("afterEach unsubscribe subscriberDel"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_notifyInvisibleForms_0200 * @tc.number: FMS_notifyInvisibleForms_0200
* @tc.name: The form user does not have permission. * @tc.name: The form user does not have permission.
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -29,6 +29,10 @@ var onSupplyEvent = { ...@@ -29,6 +29,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnAcquired; var subscriberOnAcquired;
...@@ -46,6 +50,12 @@ export default function test() { ...@@ -46,6 +50,12 @@ export default function test() {
await sleep(1000); await sleep(1000);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_notifyInvisibleForms_0900 * @tc.number: FMS_notifyInvisibleForms_0900
* @tc.name: There are correct and wrong formId in the form ID parameter list * @tc.name: There are correct and wrong formId in the form ID parameter list
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeAll, beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -29,6 +29,10 @@ var onSupplyEvent = { ...@@ -29,6 +29,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"], events: ["FMS_FormSupply_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnAcquired; var subscriberOnAcquired;
...@@ -49,7 +53,12 @@ export default function test() { ...@@ -49,7 +53,12 @@ export default function test() {
await sleep(1000); await sleep(1000);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnState, () => unsubscribeCallback("afterEach unsubscribe subscriberOnState"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_notifyVisibleForms_0200 * @tc.number: FMS_notifyVisibleForms_0200
* @tc.name: The form user does not have permission. * @tc.name: The form user does not have permission.
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
import formHost from '@ohos.application.formHost'; import formHost from '@ohos.application.formHost';
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from 'deccjsunit/index'; import { beforeEach, afterEach, describe, expect, it } from 'deccjsunit/index';
const onDeletedEvent = { const onDeletedEvent = {
events: [`FMS_FormOnDeleted_commonEvent`] events: [`FMS_FormOnDeleted_commonEvent`]
...@@ -29,6 +29,10 @@ const onSupplyEvent = { ...@@ -29,6 +29,10 @@ const onSupplyEvent = {
}; };
const formOnDeleteEvent = `FMS_FormDelete_commonEvent`; const formOnDeleteEvent = `FMS_FormDelete_commonEvent`;
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
const unsubscribeOnDeletedCallback = (tcNumber, done) => { const unsubscribeOnDeletedCallback = (tcNumber, done) => {
console.info(`${tcNumber} unsubscribeOnDeleted Callback`); console.info(`${tcNumber} unsubscribeOnDeleted Callback`);
done(); done();
...@@ -47,6 +51,10 @@ let onDeletedEventSubscriber; ...@@ -47,6 +51,10 @@ let onDeletedEventSubscriber;
let onAcquiredEventSubscriber; let onAcquiredEventSubscriber;
let onSupplyEventSubscriber; let onSupplyEventSubscriber;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() { export default function test() {
describe(`FmsStressTest`, () => { describe(`FmsStressTest`, () => {
...@@ -56,6 +64,13 @@ export default function test() { ...@@ -56,6 +64,13 @@ export default function test() {
onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent); onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent);
}); });
afterEach(async() => {
commonEvent.unsubscribe(onDeletedEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onDeletedEventSubscriber"));
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
await sleep(1000);
})
const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => { const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => {
commonEvent.subscribe(onDeletedEventSubscriber, async (err, data) => { commonEvent.subscribe(onDeletedEventSubscriber, async (err, data) => {
const formIds = data.parameters.formIds; const formIds = data.parameters.formIds;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility"; import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent'; import commonEvent from '@ohos.commonEvent';
import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index"; import { beforeAll, beforeEach, afterEach, describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = { var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"], events: ["FMS_FormOnAcquired_commonEvent"],
...@@ -30,6 +30,10 @@ var onRequestFormEvent = { ...@@ -30,6 +30,10 @@ var onRequestFormEvent = {
events: ["FMS_FormOnRequest_commonEvent"], events: ["FMS_FormOnRequest_commonEvent"],
}; };
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent"; var deleteForm_Event = "FMS_FormDelete_commonEvent";
...@@ -38,6 +42,10 @@ var subscriberOnDeleted; ...@@ -38,6 +42,10 @@ var subscriberOnDeleted;
var subscriberOnRefresh; var subscriberOnRefresh;
var subscriberOnRequest; var subscriberOnRequest;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() { export default function test() {
describe(`FmsUpdateRefreshFormTest`, () => { describe(`FmsUpdateRefreshFormTest`, () => {
...@@ -52,6 +60,13 @@ export default function test() { ...@@ -52,6 +60,13 @@ export default function test() {
subscriberOnRequest = await commonEvent.createSubscriber(onRequestFormEvent); subscriberOnRequest = await commonEvent.createSubscriber(onRequestFormEvent);
}) })
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRequest"));
await sleep(1000);
})
/** /**
* @tc.number: FMS_updateForm_0100 * @tc.number: FMS_updateForm_0100
* @tc.name: formID id is error(formID < 0) * @tc.name: formID id is error(formID < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册