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

!4406 XTS失败用例适配

Merge pull request !4406 from chengxingzhen/master
......@@ -27,7 +27,7 @@ var getCallingBundleType = {
}
describe('ApplicationInfoTest', function () {
var TAG = '';-
var TAG = '';
/*
* @tc.number SUB_AA_OpenHarmony_FormBase_1000
......@@ -44,11 +44,26 @@ describe('ApplicationInfoTest', function () {
"test":11,
"test3":true
}
var result = formBindingData.createFormBindingData(dataObj)
console.log(TAG + " result is : " + JSON.stringify(result))
expect(JSON.stringify(result)).
assertEqual(JSON.stringify({"data":"{\"temperature\":\"11c\",\"time\":\"11:00\",\"test\":11,\"test3\":true}"}));
done();
var formData = formBindingData.createFormBindingData(dataObj)
console.info(TAG + " result is : " + JSON.stringify(formData))
let formDataStr = JSON.stringify(formData.data);
let formDataStrToObj = JSON.parse(formDataStr);
if (typeof(formDataStrToObj) == "string" ) {
console.info(TAG + " formDataStrToObj1 is : " + typeof formDataStrToObj)
let formDataStrToObj2 = JSON.parse(formDataStrToObj)
console.info(TAG + " formDataStrToObj2 is : " + typeof formDataStrToObj2)
expect(formDataStrToObj2.test).assertEqual(11)
expect(formDataStrToObj2.test3).assertTrue()
expect(formDataStrToObj2.time).assertEqual("11:00")
done();
} else {
console.info(TAG + " formDataStrToObj is : " + typeof formDataStrToObj)
expect(formDataStrToObj.test).assertEqual(11)
expect(formDataStrToObj.test3).assertTrue()
expect(formDataStrToObj.time).assertEqual("11:00")
done();
}
console.info('------------end SUB_AA_OpenHarmony_FormBase_1000-------------');
});
......
......@@ -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();
......
......@@ -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();
......
......@@ -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)
}
});
};
......@@ -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`);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册