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

!2428 【XTS】删除冗余XTS代码getAllFormInfo

Merge pull request !2428 from ry/cherry-pick-1647260414
......@@ -27,44 +27,6 @@ const BUNDLE_NAME6 = "com.ohos.callui"
const ABILITIY_NAME = "com.ohos.callui.MainAbility"
describe('ActsBmsFormsInfoTest', function () {
/**
* @tc.number: bms_getAllFormsInfo_0100
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check forms information include system and vendor apps (by promise)
*/
it('bms_getAllFormsInfo_0100', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0100==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
let formsInfo = await bundle.getAllFormsInfo();
console.debug('======all form======' + JSON.stringify(formsInfo));
expect(formsInfo.length).assertEqual(4);
checkFormIsExist('Form_JS1', formsInfo, '1');
checkFormIsExist('Form_JS1S', formsInfo, '1S', true);
checkFormIsExist('Form_JS1V', formsInfo, '1V', false, true);
checkFormIsExist('Form_JS1V2', formsInfo, '1V2');
installer.uninstall(BUNDLE_NAME1, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
}
})
function checkSystemHapForm(dataInfo) {
console.debug('===system formInfo is ' + JSON.stringify(dataInfo))
expect(dataInfo.name).assertEqual('Form_JS1S');
......@@ -117,349 +79,6 @@ describe('ActsBmsFormsInfoTest', function () {
expect(dataInfo.window.autoDesignWidth).assertEqual(true);
}
/**
* @tc.number: bms_getAllFormsInfo_0200
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check forms information include system and vendor apps (by callback)
*/
it('bms_getAllFormsInfo_0200', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0200==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getAllFormsInfo((err, formsInfo) => {
expect(err.code).assertEqual(0);
expect(formsInfo.length).assertLarger(0);
checkFormIsExist('Form_JS1', formsInfo, '1');
checkFormIsExist('Form_JS1S', formsInfo, '1S', true);
checkFormIsExist('Form_JS1V', formsInfo, '1V', false, true);
checkFormIsExist('Form_JS1V2', formsInfo, '1V2');
installer.uninstall(BUNDLE_NAME1, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0300
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the update app is updated (by promise)
*/
it('bms_getAllFormsInfo_0300', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0300==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
installer.install(['/data/test/bmsThirdBundleTestA1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var formsInfo = await bundle.getAllFormsInfo();
expect(formsInfo.length).assertLarger(0);
checkFormNoExist(formsInfo, 'Form_JS1');
checkFormIsExist('Form_JSA1', formsInfo, 'A1')
installer.uninstall(BUNDLE_NAME1, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0400
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the update app is updated (by callback)
*/
it('bms_getAllFormsInfo_0400', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0400==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
installer.install(['/data/test/bmsThirdBundleTestA1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getAllFormsInfo((err, formsInfo) => {
expect(err.code).assertEqual(0);
expect(formsInfo.length).assertLarger(0);
checkFormNoExist(formsInfo, 'Form_JS1');
checkFormIsExist('Form_JSA1', formsInfo, 'A1');
installer.uninstall(BUNDLE_NAME1, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0500
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the uninstall app is removed (by promise)
*/
it('bms_getAllFormsInfo_0500', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0500==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
installer.uninstall(BUNDLE_NAME1, {
userId: 100,
installFlag: 1,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var formsInfo = await bundle.getAllFormsInfo();
checkFormNoExist(formsInfo, 'Form_JS1');
done();
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0600
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the uninstall app is removed (by callback)
*/
it('bms_getAllFormsInfo_0600', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0600==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
installer.uninstall(BUNDLE_NAME1, {
userId: 100,
installFlag: 1,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getAllFormsInfo((err, formsInfo) => {
expect(err.code).assertEqual(0);
checkFormNoExist(formsInfo, 'Form_JS1');
done();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0700
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two forms (by promise)
*/
it('bms_getAllFormsInfo_0700', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0700==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest4.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var formsInfo = await bundle.getAllFormsInfo();
expect(formsInfo.length).assertLarger(0);
checkFormIsExist('Form_JS4A', formsInfo, '4A');
checkFormIsExist('Form_JS4B', formsInfo, '4B');
installer.uninstall(BUNDLE_NAME4, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0800
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two forms (by callback)
*/
it('bms_getAllFormsInfo_0800', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0800==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest4.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getAllFormsInfo((err, formsInfo) => {
expect(err.code).assertEqual(0);
expect(formsInfo.length).assertLarger(0);
checkFormIsExist('Form_JS4A', formsInfo, '4A');
checkFormIsExist('Form_JS4B', formsInfo, '4B');
installer.uninstall(BUNDLE_NAME4, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0900
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two abilities,
* and each ability has forms (by promise)
*/
it('bms_getAllFormsInfo_0900', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_0900==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest5.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var formsInfo = await bundle.getAllFormsInfo();
expect(formsInfo.length).assertLarger(0);
checkFormIsExist('Form_JS5A', formsInfo, '5A');
checkFormIsExist('Form_JS5B', formsInfo, '5B');
installer.uninstall(BUNDLE_NAME5, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_1000
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two abilities,
* and each ability has forms (by callback)
*/
it('bms_getAllFormsInfo_1000', 0, async function (done) {
console.info('=====================bms_getAllFormsInfo_1000==================');
let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest5.hap'], {
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getAllFormsInfo((err, formsInfo) => {
expect(err.code).assertEqual(0);
expect(formsInfo.length).assertLarger(0);
checkFormIsExist('Form_JS5A', formsInfo, '5A');
checkFormIsExist('Form_JS5B', formsInfo, '5B');
installer.uninstall(BUNDLE_NAME5, {
userId: 100,
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_0100
* @tc.name: getFormsInfo : get forms information for one app
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册