提交 45f8d31d 编写于 作者: C chengxingzhen

Add form fuzz test

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 7e76bf46
......@@ -17,15 +17,7 @@ group("formmanager") {
testonly = true
if (is_standard_system) {
deps = [
# "formsystemtesthost/actsformfuzztest:ActsFormFuzzTest",
# "formsystemtesthost/actsformsoneandonetest:ActsFormsOneAndOneTest",
# "formsystemtesthost/actsformsoneandtwotest:ActsFormsOneAndTwoTest",
# "formsystemtesthost/actsformszeroandonetest:ActsFormsZeroAndOneTest",
# "formsystemtesthost/actsformszerotest:ActsFormsZeroTest",
# "formsystemtestservice/formsystemtestservicea:ActsFormSystemTestServiceA",
# "formsystemtestservice/formsystemtestserviceb:ActsFormSystemTestServiceB",
# "formsystemtestservice/formsystemtestservicec:ActsFormSystemTestServiceC",
# "formsystemtestservice/formsystemtestserviced:ActsFormSystemTestServiceD",
"formsystemtest_ets/formfuzztest:FormFuzzTest",
]
}
}
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
......@@ -13,17 +13,18 @@
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsFormFuzzTest") {
ohos_js_hap_suite("FormFuzzTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsFormFuzzTest"
hap_name = "FormFuzzTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/resources" ]
......
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "420000",
"package": "com.example.formfuzztest",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsFormFuzzTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"package": "com.ohos.st.formfuzztest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"FormFuzzTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.formfuzztest",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.formfuzztest",
"name": ".MyApplication",
"mainAbility": "com.example.formfuzztest.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.formfuzztest.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"defPermissions": [
{
"name": "com.permission.CAMERA",
"grantMode": "system_grant",
"availableScope": ["signature"],
"label": "$string:testFormA",
"description": "CAMERA permission in detail"
},
{
"name": "ohos.permission.REQUIRE_FORM",
"grantMode": "system_grant",
"label": "$string:testForm",
"description": "REQUIRE_FORM permission in detail"
}
],
"reqPermissions": [
{
"name": "ohos.permission.REQUIRE_FORM",
"reason": "require form",
"usedScene": {
"ability": [
".MainAbility"
],
"when": "always"
}
},
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name":"ohos.permission.REQUIRE_FORM",
"reason":"need use ohos.permission.REQUIRE_FORM"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
{
"app": {
"bundleName": "com.ohos.st.formfuzztest",
"vendor": "ohos",
"version": {
"code": 1000000,
"name": "1.0.0"
},
"apiVersion": {
"compatible": 9,
"releaseType": "Release",
"target": 9
}
},
"deviceConfig": {},
"module": {
"package": "com.ohos.st.formfuzztest",
"name": ".FormFuzzSTApp",
"mainAbility": ".MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:description_mainability",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"defPermissions": [
{
"availableScope": [],
"grantMode": "system_grant",
"name": "FMS_FormDelete_commonEvent"
},
{
"availableScope": [],
"grantMode": "system_grant",
"name": "FMS_FormOnAcquired_commonEvent"
},
{
"availableScope": [],
"grantMode": "system_grant",
"name": "FMS_FormOnError_commonEvent"
},
{
"availableScope": [],
"grantMode": "system_grant",
"name": "FMS_FormCast_commonEvent"
},
{
"availableScope": [],
"grantMode": "system_grant",
"name": "FMS_FormSupply_commonEvent"
}
],
"reqPermissions": [
{
"name": "FMS_FormOnAcquired_commonEvent",
"reason": "need use onAcquired commonEvent"
},
{
"name": "FMS_FormDelete_commonEvent",
"reason": "need use delete commonEvent"
},
{
"name": "FMS_FormOnError_commonEvent",
"reason": "need use OnError commonEvent"
},
{
"name": "FMS_FormCast_commonEvent",
"reason": "need use castFrom commonEvent"
},
{
"name": "FMS_FormSupply_commonEvent",
"reason": "need use FormSupply commonEvent"
},
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name": "ohos.permission.REMOVE_CACHE_FILES",
"reason": "need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name": "ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES",
"reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name": "ohos.permission.REQUIRE_FORM"
}
],
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('Application onCreate');
},
onDestroy() {
console.info('Application onDestroy');
},
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import app from '@system.app'
import file from '@system.file'
import router from '@system.router'
import device from '@system.device'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = "FMS Fuzz Test";
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
console.info('onShow end')
},
onReady() {
},
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import featureAbility from "@ohos.ability.featureAbility";
import file from '@system.file';
import { Core, ExpectExtend, ReportExtend } from 'deccjsunit/index.ets';
import testsuite from "../test/List.test.ets";
@Entry
@Component
struct Index {
private componentName: string = `FormSystemFuzzTest`;
aboutToAppear() {
console.info(`${this.componentName} start run testcase!!!!`);
featureAbility.getWant()
.then((want: any) => {
console.info(`${this.componentName} Operation successful. Data: ${JSON.stringify(want)}`);
const core = Core.getInstance();
const expectExtend = new ExpectExtend({
'id': 'extend'
});
core.addService('expect', expectExtend);
const reportExtend = new ReportExtend(file);
core.addService('report', reportExtend);
core.init();
core.subscribeEvent('task', reportExtend);
const configService = core.getDefaultService('config');
configService.setConfig(want.parameters);
testsuite();
core.execute();
})
.catch((error: any) => {
console.error(`${this.componentName} Operation failed. Cause: ${JSON.stringify(error)}`);
})
}
build() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Text(`${this.componentName}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const castTempFormFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_casttempform`;
const promiseName = `FMS_fuzzTest_casttempform`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_casttempform_0100 ~ FMS_fuzzTest_casttempform_0800
* @tc.desc Check whether the castTempForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
try {
formHost.castTempForm(formId, (error, data) => {
console.log(`${callbackName} ${tcNumber} castTempForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_casttempform_0900 ~ FMS_fuzzTest_casttempform_1600
* @tc.desc Check whether the castTempForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`);
try {
const data = await formHost.castTempForm(formId);
console.log(`${promiseName} ${tcNumber} castTempForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const deleteFormFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_deleteform`;
const promiseName = `FMS_fuzzTest_deleteform`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_deleteform_0100 ~ FMS_fuzzTest_deleteform_0800
* @tc.desc Check whether the deleteForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
try {
formHost.deleteForm(formId, (error, data) => {
console.log(`${callbackName} ${tcNumber} deleteForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_deleteform_0900 ~ FMS_fuzzTest_deleteform_1600
* @tc.desc Check whether the deleteForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`);
try {
const data = await formHost.deleteForm(formId);
console.log(`${promiseName} ${tcNumber} deleteForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const disableFormsUpdateFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_disable`;
const promiseName = `FMS_fuzzTest_disable`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_disable_0100 ~ FMS_fuzzTest_disable_0800
* @tc.desc Check whether the disableFormsUpdate interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`);
try {
formHost.disableFormsUpdate(formIds, (error, data) => {
console.log(`${callbackName} ${tcNumber} disableFormsUpdate data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_disable_0900 ~ FMS_fuzzTest_disable_1600
* @tc.desc Check whether the disableFormsUpdate interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`);
try {
const data = await formHost.disableFormsUpdate(formIds);
console.log(`${promiseName} ${tcNumber} disableFormsUpdate data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const enableFormsUpdateFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_enable`;
const promiseName = `FMS_fuzzTest_enable`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_enable_0100 ~ FMS_fuzzTest_enable_0800
* @tc.desc Check whether the enableFormsUpdate interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`);
try {
formHost.enableFormsUpdate(formIds, (error, data) => {
console.log(`${callbackName} ${tcNumber} enableFormsUpdate data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_enable_0900 ~ FMS_fuzzTest_enable_1600
* @tc.desc Check whether the enableFormsUpdate interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`);
try {
const data = await formHost.enableFormsUpdate(formIds);
console.log(`${promiseName} ${tcNumber} enableFormsUpdate data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const getFormsInfoFuzzTest = (describeName, filterParameter) => {
const ERR_GET_BUNDLE_FAILED_CODE = 5;
const ERR_GET_BUNDLE_FAILED = `failed to obtain the bundle information`;
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_getinfobundle`;
const promiseName = `FMS_fuzzTest_getinfobundle`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_getinfobundle_0100 ~ FMS_fuzzTest_getinfobundle_0800
* @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const bundleName = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`);
try {
formHost.getFormsInfo(bundleName, (error, data) => {
console.log(`${callbackName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
if (`STRING` === dataType) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_getinfobundle_0900 ~ FMS_fuzzTest_getinfobundle_1600
* @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const bundleName = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`);
try {
const data = await formHost.getFormsInfo(bundleName);
console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`STRING` === dataType) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
}
});
}
});
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_getinfomodule`;
const promiseName = `FMS_fuzzTest_getinfomodule`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_getinfomodule_0100 ~ FMS_fuzzTest_getinfomodule_0800
* @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const bundleName = getFuzzData(dataType);
const moduleName = `com.test.module_name_${tcNumber}`;
console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`);
console.log(`${callbackName} ${tcNumber} moduleName typeof: ${typeof moduleName}`);
try {
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) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_getinfomodule_0900 ~ FMS_fuzzTest_getinfomodule_1600
* @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const bundleName = getFuzzData(dataType);
const moduleName = `com.test.module_name_${tcNumber}`;
console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`);
console.log(`${promiseName} ${tcNumber} ${describeName} moduleName typeof: ${typeof moduleName}`);
try {
const data = await formHost.getFormsInfo(bundleName, moduleName);
console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`STRING` === dataType) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 2) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_getinfomodule_1700 ~ FMS_fuzzTest_getinfomodule_2400
* @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const bundleName = `com.test.bundle_name_${tcNumber}`;
const moduleName = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} bundleName typeof: ${typeof bundleName}`);
console.log(`${callbackName} ${tcNumber} moduleName typeof: ${typeof moduleName}`);
try {
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) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 3) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_getinfomodule_2500 ~ FMS_fuzzTest_getinfomodule_3200
* @tc.desc Check whether the getFormsInfo interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const bundleName = `com.test.bundle_name_${tcNumber}`;
const moduleName = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} bundleName typeof: ${typeof bundleName}`);
console.log(`${promiseName} ${tcNumber} ${describeName} moduleName typeof: ${typeof moduleName}`);
try {
const data = await formHost.getFormsInfo(bundleName, moduleName);
console.log(`${promiseName} ${tcNumber} getFormsInfo data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`STRING` === dataType) {
expect(error.code).assertEqual(ERR_GET_BUNDLE_FAILED_CODE);
expect(error.message).assertEqual(ERR_GET_BUNDLE_FAILED);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
}
});
}
})
};
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { castTempFormFuzzTest } from './CastTempFormFuzz.test.ets';
import { deleteFormFuzzTest } from './DeleteFormFuzz.test.ets';
import { disableFormsUpdateFuzzTest } from './DisableFormsUpdateFuzz.test.ets';
import { enableFormsUpdateFuzzTest } from './EnableFormsUpdateFuzz.test.ets';
import { getFormsInfoFuzzTest } from './GetFormsInfoFuzz.test.ets';
import { notifyInvisibleFormsFuzzTest } from './NotifyInvisibleFormsFuzz.test.ets';
import { notifyVisibleFormsFuzzTest } from './NotifyVisibleFormsFuzz.test.ets';
import { releaseFormFuzzTest } from './ReleaseFormFuzz.test.ets';
import { requestFormFuzzTest } from './RequestFormFuzz.test.ets';
import { setFormNextRefreshTimeFuzzTest } from './SetFormNextRefreshTimeFuzz.test.ets';
import { updateFormFuzzTest } from './UpdateFormFuzz.test.ets';
export default function testsuite() {
// FMS_fuzzTest_deleteform
deleteFormFuzzTest(`DeleteFormFuzzTest`, 0);
// FMS_fuzzTest_releaseform
releaseFormFuzzTest(`ReleaseFormFuzzTest`, 0);
// FMS_fuzzTest_casttempform
castTempFormFuzzTest(`CastTempFormFuzzTest`, 0);
// FMS_fuzzTest_invisible
notifyVisibleFormsFuzzTest(`NotifyVisibleFormsFuzzTest`, 0);
// FMS_fuzzTest_visible
notifyInvisibleFormsFuzzTest(`NotifyInvisibleFormsFuzzTest`, 0);
// FMS_fuzzTest_requestform
requestFormFuzzTest(`RequestFormFuzzTest`, 0);
// FMS_fuzzTest_updateform
updateFormFuzzTest(`UpdateFormFuzzTest`, 0);
// FMS_fuzzTest_setnexttime
setFormNextRefreshTimeFuzzTest(`SetFormNextRefreshTimeFuzzTest`, 0);
// FMS_fuzzTest_enable
enableFormsUpdateFuzzTest(`EnableFormsUpdateFuzzTest`, 0);
// FMS_fuzzTest_disable
disableFormsUpdateFuzzTest(`DisableFormsUpdateFuzzTest`, 0);
// FMS_fuzzTest_getinfobundle
// FMS_fuzzTest_getinfomodule
getFormsInfoFuzzTest(`GetFormsInfoFuzzTest`, 0);
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const notifyInvisibleFormsFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_invisible`;
const promiseName = `FMS_fuzzTest_invisible`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_invisible_0100 ~ FMS_fuzzTest_invisible_0800
* @tc.desc Check whether the notifyInvisibleForms interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`);
try {
formHost.notifyInvisibleForms(formIds, (error, data) => {
console.log(`${callbackName} ${tcNumber} notifyInvisibleForms data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_invisible_0900 ~ FMS_fuzzTest_invisible_1600
* @tc.desc Check whether the notifyInvisibleForms interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`);
try {
const data = await formHost.notifyInvisibleForms(formIds);
console.log(`${promiseName} ${tcNumber} notifyInvisibleForms data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const notifyVisibleFormsFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_visible`;
const promiseName = `FMS_fuzzTest_visible`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_visible_0100 ~ FMS_fuzzTest_visible_0800
* @tc.desc Check whether the notifyVisibleForms interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formIds typeof: ${typeof formIds}`);
try {
formHost.notifyVisibleForms(formIds, (error, data) => {
console.log(`${callbackName} ${tcNumber} notifyVisibleForms data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_visible_0900 ~ FMS_fuzzTest_visible_1600
* @tc.desc Check whether the notifyVisibleForms interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formIds = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formIds typeof: ${typeof formIds}`);
try {
const data = await formHost.notifyVisibleForms(formIds);
console.log(`${promiseName} ${tcNumber} notifyVisibleForms data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const releaseFormFuzzTest = (describeName, filterParameter) => {
const ERR_COMMON_CODE = 1;
const ERR_COMMON = `internal error`;
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
const ERR_NOT_EXIST_ID_CODE = 9;
const ERR_NOT_EXIST_ID = `the ID of the form to be operated does not exist`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_releaseform`;
const promiseName = `FMS_fuzzTest_releaseform`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_releaseform_0100 ~ FMS_fuzzTest_releaseform_0800
* @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
try {
formHost.releaseForm(formId, (error, data) => {
console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_releaseform_0900 ~ FMS_fuzzTest_releaseform_1600
* @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`);
try {
const data = await formHost.releaseForm(formId);
console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`STRING` === dataType) {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 2) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_releaseform_1700 ~ FMS_fuzzTest_releaseform_2400
* @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
const isReleaseCache = true;
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${callbackName} ${tcNumber} isReleaseCache typeof: ${typeof isReleaseCache}`);
try {
formHost.releaseForm(formId, isReleaseCache, (error, data) => {
console.log(`${callbackName} ${tcNumber} releaseForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 3) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_releaseform_2500 ~ FMS_fuzzTest_releaseform_3200
* @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
const isReleaseCache = true;
console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`);
console.log(`${promiseName} ${tcNumber} ${describeName} isReleaseCache typeof: ${typeof isReleaseCache}`);
try {
const data = await formHost.releaseForm(formId, isReleaseCache);
console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`STRING` === dataType) {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
} else {
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
}
done();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 4) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_releaseform_3300 ~ FMS_fuzzTest_releaseform_4000
* @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = `${tcNumber}`;
const isReleaseCache = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${callbackName} ${tcNumber} isReleaseCache typeof: ${typeof isReleaseCache}`);
try {
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) {
expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE);
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else {
expect(error.code).assertEqual(ERR_COMMON_CODE);
expect(error.message).assertEqual(ERR_COMMON);
}
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 5) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_releaseform_4100 ~ FMS_fuzzTest_releaseform_4800
* @tc.desc Check whether the releaseForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = `${tcNumber}`;
const isReleaseCache = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`);
console.log(`${promiseName} ${tcNumber} ${describeName} isReleaseCache typeof: ${typeof isReleaseCache}`);
try {
const data = await formHost.releaseForm(formId, isReleaseCache);
console.log(`${promiseName} ${tcNumber} releaseForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`BOOLEAN` === dataType) {
expect(error.code).assertEqual(ERR_NOT_EXIST_ID_CODE);
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else {
expect(error.code).assertEqual(ERR_COMMON_CODE);
expect(error.message).assertEqual(ERR_COMMON);
}
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formHost from '@ohos.application.formHost';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const requestFormFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_requestform`;
const promiseName = `FMS_fuzzTest_requestform`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_requestform_0100 ~ FMS_fuzzTest_requestform_0800
* @tc.desc Check whether the requestForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
try {
formHost.requestForm(formId, (error, data) => {
console.log(`${callbackName} ${tcNumber} requestForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_requestform_0900 ~ FMS_fuzzTest_requestform_1600
* @tc.desc Check whether the requestForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} ${describeName} formId typeof: ${typeof formId}`);
try {
const data = await formHost.requestForm(formId);
console.log(`${promiseName} ${tcNumber} requestForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formProvider from '@ohos.application.formProvider';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const setFormNextRefreshTimeFuzzTest = (describeName, filterParameter) => {
const ERR_COMMON_CODE = 1;
const ERR_COMMON = `internal error`;
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
const ERR_NOT_EXIST_ID_CODE = 9;
const ERR_NOT_EXIST_ID = `the ID of the form to be operated does not exist`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_setnexttime`;
const promiseName = `FMS_fuzzTest_setnexttime`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_setnexttime_0100 ~ FMS_fuzzTest_setnexttime_0800
* @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
const nextTime = 5;
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${callbackName} ${tcNumber} nextTime typeof: ${typeof nextTime}`);
try {
formProvider.setFormNextRefreshTime(formId, nextTime, (error, data) => {
console.log(`${callbackName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_setnexttime_0900 ~ FMS_fuzzTest_setnexttime_1600
* @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
const nextTime = 5;
console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${promiseName} ${tcNumber} nextTime typeof: ${typeof nextTime}`);
try {
const data = await formProvider.setFormNextRefreshTime(formId, nextTime);
console.log(`${promiseName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 2) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_setnexttime_1700 ~ FMS_fuzzTest_setnexttime_2400
* @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = `${tcNumber}`;
const nextTime = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${callbackName} ${tcNumber} nextTime typeof: ${typeof nextTime}`);
try {
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 (ERR_NOT_EXIST_ID_CODE === error.code) {
expect(error.message).assertEqual(ERR_NOT_EXIST_ID);
} else if (ERR_ADD_INVALID_PARAM_CODE === error.code) {
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
} else {
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
} else {
expect(error.code).assertEqual(ERR_COMMON_CODE);
expect(error.message).assertEqual(ERR_COMMON);
}
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 3) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_setnexttime_2500 ~ FMS_fuzzTest_setnexttime_3200
* @tc.desc Check whether the setFormNextRefreshTime interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = `${tcNumber}`;
const nextTime = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${promiseName} ${tcNumber} nextTime typeof: ${typeof nextTime}`);
try {
const data = await formProvider.setFormNextRefreshTime(formId, nextTime);
console.log(`${promiseName} ${tcNumber} setFormNextRefreshTime data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
if (`NUMBER` === dataType) {
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) {
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
} else {
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
}
} else {
expect(error.code).assertEqual(ERR_COMMON_CODE);
expect(error.message).assertEqual(ERR_COMMON);
}
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formProvider from '@ohos.application.formProvider';
import { describe, expect, it } from 'deccjsunit/index.ets';
import { DATA_TYPE_LIST, getFuzzData } from './getParam.ets';
export const updateFormFuzzTest = (describeName, filterParameter) => {
const ERR_ADD_INVALID_PARAM_CODE = 7;
const ERR_ADD_INVALID_PARAM = `invalid input parameter during form operation`;
describe(`${describeName}`, () => {
const callbackName = `FMS_fuzzTest_updateform`;
const promiseName = `FMS_fuzzTest_updateform`;
const length = DATA_TYPE_LIST.length;
for (let i = 0; i < length; ++i) {
const tcNumber = `0${(i + 1) * 100}`;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_updateform_0100 ~ FMS_fuzzTest_updateform_0800
* @tc.desc Check whether the updateForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
const formBindingData = {};
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${callbackName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`);
try {
formProvider.updateForm(formId, formBindingData, (error, data) => {
console.log(`${callbackName} ${tcNumber} updateForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
let tcNumber: any = (i + 1 + length) * 100;
tcNumber = tcNumber < 1000 ? `0${tcNumber}` : tcNumber;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_updateform_0900 ~ FMS_fuzzTest_updateform_1600
* @tc.desc Check whether the updateForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = getFuzzData(dataType);
const formBindingData = {};
console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${promiseName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`);
try {
const data = await formProvider.updateForm(formId, formBindingData);
console.log(`${promiseName} ${tcNumber} updateForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 2) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_updateform_1700 ~ FMS_fuzzTest_updateform_2400
* @tc.desc Check whether the updateForm interface can pass the fuzzy test (by AsyncCallback)
*/
it(`${callbackName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = `${tcNumber}`;
const formBindingData = getFuzzData(dataType);
console.log(`${callbackName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${callbackName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`);
try {
formProvider.updateForm(formId, formBindingData, (error, data) => {
console.log(`${callbackName} ${tcNumber} updateForm data: ${JSON.stringify(data)} error: ${JSON.stringify(error)}`);
expect(data).assertUndefined();
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
});
} catch (error) {
console.log(`${callbackName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
console.log(`${callbackName} ${tcNumber} should not reach here`);
expect().assertFail();
}
});
}
for (let i = 0; i < length; ++i) {
const tcNumber: any = (i + 1 + length * 3) * 100;
/**
* @tc.name fuzzTest
* @tc.number FMS_fuzzTest_updateform_2500 ~ FMS_fuzzTest_updateform_3200
* @tc.desc Check whether the updateForm interface can pass the fuzzy test (by Promise)
*/
it(`${promiseName}_${tcNumber}`, filterParameter, async (done) => {
const dataType = DATA_TYPE_LIST[i];
const formId = `${tcNumber}`;
const formBindingData = getFuzzData(dataType);
console.log(`${promiseName} ${tcNumber} formId typeof: ${typeof formId}`);
console.log(`${promiseName} ${tcNumber} formBindingData typeof: ${typeof formBindingData}`);
try {
const data = await formProvider.updateForm(formId, formBindingData);
console.log(`${promiseName} ${tcNumber} updateForm data: ${JSON.stringify(data)}`);
console.log(`${promiseName} ${tcNumber} should not reach here`);
expect().assertFail();
} catch (error) {
console.log(`${promiseName} ${tcNumber} exception caught: ${JSON.stringify(error)}`);
expect(error.code).assertEqual(ERR_ADD_INVALID_PARAM_CODE);
expect(error.message).assertEqual(ERR_ADD_INVALID_PARAM);
done();
}
});
}
});
};
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const REPEAT_COUNT = 2;
var RANDOM_BEGIN_POSITION = 0;
var RANDOM_BEGIN_POSITION_A = 2;
var STRING_RANDOM_LENGTH = 2064;
var BOOLEAN_RANDOM_LENGTH = 2;
var ARRAY_RANDOM_LENGTH = 10;
var ARRAY_RANDOM_TYPE_LENGTH = 3;
var OBJECT_RANDOM_LENGTH = 2;
var FUNCTION_RANDOM_LENGTH = 2;
//string ascii
var STRING_RANDOM_LENGTH_A = 48;
var STRING_RANDOM_LENGTH_B = 58;
var STRING_RANDOM_LENGTH_C = 65;
var STRING_RANDOM_LENGTH_D = 91;
var STRING_RANDOM_LENGTH_E = 97;
var STRING_RANDOM_LENGTH_F = 122;
// Return integer random, the range is: [iStart, iEnd)
function getIntegerRandom(iStart, iEnd) {
var decimal = iStart + (iEnd - iStart) * Math.random();
return Math.floor(decimal);
}
// return string random, the string length is: [0, 2064)
const stringTest = function() {
// string
var res = "";
// string length
var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, STRING_RANDOM_LENGTH);
for(var iAsciiToChar = RANDOM_BEGIN_POSITION; iAsciiToChar < iNumber ; iAsciiToChar ++) {
var iNumberString = getIntegerRandom(RANDOM_BEGIN_POSITION, RANDOM_BEGIN_POSITION_A);
switch (iNumberString) {
case 0:
// get ascii [0-9]
iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_A, STRING_RANDOM_LENGTH_B);
break;
case 1:
// get ascii [A-Z]
iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_C, STRING_RANDOM_LENGTH_D);
break;
case 2:
default:
// get ascii [a-z]
iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_E, STRING_RANDOM_LENGTH_F);
break;
}
// from ascii to char
var asciiToChar = String.fromCharCode(iNumber);
res += asciiToChar;
}
console.log("The stringTest of this fuzzTest random:" + res);
return res;
};
// return number random, the number length is: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]
const numberTest = function() {
console.log("The numberTest of this fuzzTest random" );
return getIntegerRandom(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER + 1);
};
// return boolean random, the boolean value is: 0->(false), 1->(true)
const booleanTest = function() {
console.log("The booleanTest of this fuzzTest random" );
return Boolean(getIntegerRandom(RANDOM_BEGIN_POSITION, BOOLEAN_RANDOM_LENGTH));
};
// null
const nullTest = function() {
console.log("The nullTest of this fuzzTest random" );
return null;
};
// undefined
const undefinedTest = function() {
console.log("The undefinedTest of this fuzzTest random" );
return undefined;
};
// return array random, the array value is: string,number,bool
const arrayTest = function() {
var arrValue = [];
// array length
var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_LENGTH);
for(var iArrNumber = 0; iArrNumber < iNumber ; iArrNumber ++) {
// string,number,bool
iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_TYPE_LENGTH);
switch(iNumber) {
case 0:
arrValue[iArrNumber] = stringTest();
break;
case 1:
arrValue[iArrNumber] = numberTest();
break;
case 2:
arrValue[iArrNumber] = booleanTest();
break;
default:
arrValue[iArrNumber] = '';
}
}
console.log("The arrayTest of this fuzzTest random:" + arrValue);
return arrValue;
};
// return objectTest random, the objectTest value is: null, not null
const objectTest = function() {
var objectA = {};
var objectb = {id : 'objectTest'};
var objectB = Object.create(objectb);
console.log("The objectTest of this fuzzTest random" );
return getIntegerRandom(RANDOM_BEGIN_POSITION, OBJECT_RANDOM_LENGTH) ? objectA: objectB;
};
// return functionTest random, the functionTest value is: null, not null
const functionTest = function() {
var functionA = {};
var functionB = {id:"functionTest"};
console.log("The functionTest of this fuzzTest random" );
return getIntegerRandom(RANDOM_BEGIN_POSITION, FUNCTION_RANDOM_LENGTH) ? functionA: functionB;
};
export {
stringTest, numberTest, booleanTest, nullTest, undefinedTest, objectTest, arrayTest, functionTest
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const REPEAT_COUNT = 2;
export const DATA_TYPE_LIST = ['ARRAY', 'NUMBER', 'BOOLEAN', 'FUNCTION', 'STRING', 'OBJECT', 'NULL', 'UNDEFINED'];
var RANDOM_BEGIN_POSITION = 0;
var RANDOM_BEGIN_POSITION_A = 2;
var STRING_RANDOM_LENGTH = 2064;
var BOOLEAN_RANDOM_LENGTH = 2;
var ARRAY_RANDOM_LENGTH = 10;
var ARRAY_RANDOM_TYPE_LENGTH = 3;
var OBJECT_RANDOM_LENGTH = 2;
var FUNCTION_RANDOM_LENGTH = 2;
//string ascii
var STRING_RANDOM_LENGTH_A = 48;
var STRING_RANDOM_LENGTH_B = 58;
var STRING_RANDOM_LENGTH_C = 65;
var STRING_RANDOM_LENGTH_D = 91;
var STRING_RANDOM_LENGTH_E = 97;
var STRING_RANDOM_LENGTH_F = 122;
// Return integer random, the range is: [iStart, iEnd)
function getIntegerRandom(iStart, iEnd) {
var decimal = iStart + (iEnd - iStart) * Math.random();
return Math.floor(decimal);
}
// return string random, the string length is: [0, 2064)
const stringTest = function () {
// string
var res = '';
// string length
var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, STRING_RANDOM_LENGTH);
for (var iAsciiToChar = RANDOM_BEGIN_POSITION; iAsciiToChar < iNumber; iAsciiToChar++) {
var iNumberString = getIntegerRandom(RANDOM_BEGIN_POSITION, RANDOM_BEGIN_POSITION_A);
switch (iNumberString) {
case 0:
// get ascii [0-9]
iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_A, STRING_RANDOM_LENGTH_B);
break;
case 1:
// get ascii [A-Z]
iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_C, STRING_RANDOM_LENGTH_D);
break;
case 2:
default:
// get ascii [a-z]
iNumber = getIntegerRandom(STRING_RANDOM_LENGTH_E, STRING_RANDOM_LENGTH_F);
break;
}
// from ascii to char
var asciiToChar = String.fromCharCode(iNumber);
res += asciiToChar;
}
console.log('The stringTest of this fuzzTest random:' + res);
return res;
};
// return number random, the number length is: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER]
const numberTest = function () {
const res = getIntegerRandom(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER + 1);
console.log('The numberTest of this fuzzTest random:' + res);
return res;
};
// return boolean random, the boolean value is: 0->(false), 1->(true)
const booleanTest = function () {
console.log('The booleanTest of this fuzzTest random');
return Boolean(getIntegerRandom(RANDOM_BEGIN_POSITION, BOOLEAN_RANDOM_LENGTH));
};
// null
const nullTest = function () {
console.log('The nullTest of this fuzzTest random');
return null;
};
// undefined
const undefinedTest = function () {
console.log('The undefinedTest of this fuzzTest random');
return undefined;
};
// return array random, the array value is: string,number,bool
const arrayTest = function () {
var arrValue = [];
// array length
var iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_LENGTH);
for (var iArrNumber = 0; iArrNumber < iNumber; iArrNumber++) {
// string,number,bool
iNumber = getIntegerRandom(RANDOM_BEGIN_POSITION, ARRAY_RANDOM_TYPE_LENGTH);
switch (iNumber) {
case 0:
arrValue[iArrNumber] = stringTest();
break;
case 1:
arrValue[iArrNumber] = numberTest();
break;
case 2:
arrValue[iArrNumber] = booleanTest();
break;
default:
arrValue[iArrNumber] = '';
}
}
console.log('The arrayTest of this fuzzTest random:' + arrValue);
return arrValue;
};
// return objectTest random, the objectTest value is: null, not null
const objectTest = function () {
var objectA = {};
var objectb = { id: 'objectTest' };
var objectB = Object.create(objectb);
console.log('The objectTest of this fuzzTest random');
return getIntegerRandom(RANDOM_BEGIN_POSITION, OBJECT_RANDOM_LENGTH) ? objectA : objectB;
};
// return functionTest random, the functionTest value is: null, not null
const functionTest = function () {
var functionA = {};
var functionB = { id: 'functionTest' };
console.log('The functionTest of this fuzzTest random');
return getIntegerRandom(RANDOM_BEGIN_POSITION, FUNCTION_RANDOM_LENGTH) ? functionA : functionB;
};
// return fuzz data
const getFuzzData = (datatype: string) => {
switch (datatype) {
case 'ARRAY':
return arrayTest();
case 'BOOLEAN':
return booleanTest();
case 'FUNCTION':
return functionTest();
case 'NULL':
return nullTest();
case 'NUMBER':
return numberTest();
case 'OBJECT':
return objectTest();
case 'STRING':
return stringTest();
case 'UNDEFINED':
return undefinedTest();
default:
return stringTest();
}
};
export { getFuzzData, stringTest, numberTest, booleanTest, nullTest, undefinedTest, objectTest, arrayTest, functionTest };
{
"string": [
{
"name": "entry_MainAbility",
"value": "B_fms"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
{
"string": [
{
"name": "entry_MainAbility",
"value": "formsttest"
},
{
"name": "description_mainability",
"value": "ETS_Empty Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./FormFuzzArray.test.js')
require('./FormFuzzBool.test.js')
require('./FormFuzzFunction.test.js')
require('./FormFuzzNull.test.js')
require('./FormFuzzNum.test.js')
require('./FormFuzzObject.test.js')
require('./FormFuzzString.test.js')
require('./FormFuzzUndefined.test.js')
{
"string": [
{
"name": "entry_MainAbility",
"value": "fuzztest"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
},
{
"name": "testForm",
"value": "REQUIRE_FORM permission"
},
{
"name": "testFormA",
"value": "CAMERA permission"
}
]
}
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsFormsOneAndOneTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsFormsOneAndOneTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.formsoneandone",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsFormsOneAndOneTest.hap",
"ActsFormSystemTestServiceB.hap",
"ActsFormSystemTestServiceC.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.formsoneandone",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.formsoneandone",
"name": ".MyApplication",
"mainAbility": "com.example.formsoneandone.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.formsoneandone.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"reqPermissions": [
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import app from '@system.app'
import file from '@system.file'
import router from '@system.router'
import device from '@system.device'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = "卡片配置信息查询 \n有权限、是系统应用";
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
console.info('onShow end')
},
onReady() {
},
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formManager from '@ohos.ability.formManager'
import {describe, it, expect} from 'deccjsunit/index'
const TIMEOUT = 3000;
describe('ActsFormsOneAndOneTest', function () {
console.log("ActsFormsOneAndOneTest===start");
/**
* @tc.name getAllFormsInfo test
* @tc.number FMS_getFormsInfo_0500
* @tc.desc All form configuration information is queried successfully (by AsyncCallback)
*/
it('FMS_getFormsInfo_0500_callback', 0, async function (done) {
console.log("FMS_getFormsInfo_0500_callback begin");
var ret = formManager.getAllFormsInfo(
(result, data) => {
console.log("FMS_getFormsInfo_0500_callback, the forms number:" + data.length);
var dataB = data.filter((p) => {
return p.bundleName == "com.form.formsystemtestserviceb";
});
var dataC = data.filter((p) => {
return p.bundleName == "com.form.formsystemtestservicec";
});
console.log("FMS_getFormsInfo_0500_callback async::sucess, dataB json:" + JSON.stringify(dataB));
console.log("FMS_getFormsInfo_0500_callback async::sucess, dataA json:" + JSON.stringify(dataC));
console.log("FMS_getFormsInfo_0500_callback getAllFormsInfo async::result, result:" + result);
expect(result).assertEqual(1);
function expe(datainfo) {
for(var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].description).assertEqual("form_description");
expect(datainfo[i].type).assertEqual(1);
expect(datainfo[i].colorMode).assertEqual(-1);
expect(datainfo[i].jsComponentName).assertEqual("card");
expect(datainfo[i].isDefault).assertEqual(1);
expect(datainfo[i].updateEnabled).assertEqual(1);
expect(datainfo[i].updateDuration).assertEqual(1);
expect(datainfo[i].scheduledUpdateTime).assertEqual("10:30");
expect(datainfo[i].formVisibleNotify).assertEqual(1);
expect(datainfo[i].defaultDimension).assertEqual(1);
expect(datainfo[i].supportDimensions[0]).assertEqual(1);
expect(datainfo[i].supportDimensions[1]).assertEqual(2);
expect(datainfo[i].metaData.customizeData[0].name).assertEqual("originWidgetName");
expect(datainfo[i].metaData.customizeData[0].value).assertEqual("myTest");
console.log("FMS_getFormsInfo_0500_callback=========expe, formName:" + datainfo[i].name);
}
}
expe(dataB);
expe(dataC);
expect(dataB[0].name).assertEqual("FormB_Js001");
expect(dataC[0].name).assertEqual("FormC_Js001");
console.log("FMS_getFormsInfo_0500_callback result end");
done();
}
);
setTimeout(function () {
console.info('=====================FMS_getFormsInfo_0500_callback==================end');
}, TIMEOUT)
console.log("FMS_getFormsInfo_0500_callback end, ret:"+ret);
})
/**
* @tc.name getAllFormsInfo test
* @tc.number FMS_getFormsInfo_0500
* @tc.desc All form configuration information is queried successfully (by Promise)
*/
it('FMS_getFormsInfo_0500_promise', 0, async function (done) {
console.log("FMS_getFormsInfo_0500_promise begin");
var promise = formManager.getAllFormsInfo();
promise.then((data) => {
console.log("FMS_getFormsInfo_0500_promise, the forms number:" + data.length);
var dataB = data.filter((p) => {
return p.bundleName == "com.form.formsystemtestserviceb";
});
var dataC = data.filter((p) => {
return p.bundleName == "com.form.formsystemtestservicec";
});
console.log("FMS_getFormsInfo_0500_promise async::sucess, dataB json:" + JSON.stringify(dataB));
console.log("FMS_getFormsInfo_0500_promise async::sucess, dataA json:" + JSON.stringify(dataC));
function expe(datainfo) {
for(var i = 0; i < datainfo.length; i++) {
expect(datainfo[i].description).assertEqual("form_description");
expect(datainfo[i].type).assertEqual(1);
expect(datainfo[i].colorMode).assertEqual(-1);
expect(datainfo[i].jsComponentName).assertEqual("card");
expect(datainfo[i].isDefault).assertEqual(1);
expect(datainfo[i].updateEnabled).assertEqual(1);
expect(datainfo[i].updateDuration).assertEqual(1);
expect(datainfo[i].scheduledUpdateTime).assertEqual("10:30");
expect(datainfo[i].formVisibleNotify).assertEqual(1);
expect(datainfo[i].defaultDimension).assertEqual(1);
expect(datainfo[i].supportDimensions[0]).assertEqual(1);
expect(datainfo[i].supportDimensions[1]).assertEqual(2);
expect(datainfo[i].metaData.customizeData[0].name).assertEqual("originWidgetName");
expect(datainfo[i].metaData.customizeData[0].value).assertEqual("myTest");
console.log("FMS_getFormsInfo_0500_promise=========expe, formName:" + datainfo[i].name);
}
}
expe(dataB);
expe(dataC);
expect(dataB[0].name).assertEqual("FormB_Js001");
expect(dataC[0].name).assertEqual("FormC_Js001");
console.log("FMS_getFormsInfo_0500_promise result end");
done();
});
setTimeout(function () {
console.info('=====================FMS_getFormsInfo_0500_promise==================end');
}, TIMEOUT)
})
})
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./FormsOneAndOneJsunit.test.js')
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "formsoneandone"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsFormsOneAndTwoTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsFormsOneAndTwoTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "120000",
"package": "com.example.formsoneandtwo",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsFormsOneAndTwoTest.hap",
"ActsFormSystemTestServiceA.hap",
"ActsFormSystemTestServiceB.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.formsoneandtwo",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.formsoneandtwo",
"name": ".MyApplication",
"mainAbility": "com.example.formsoneandtwo.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.formsoneandtwo.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"reqPermissions": [
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import app from '@system.app'
import file from '@system.file'
import router from '@system.router'
import device from '@system.device'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = "卡片配置信息查询 \n有权限、是系统应用";
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
console.info('onShow end')
},
onReady() {
},
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./FormsOneAndTwoJsunit.test.js')
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "formsoneandtwo"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsFormsZeroAndOneTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsFormsZeroAndOneTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.formszeroandone",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsFormsZeroAndOneTest.hap",
"ActsFormSystemTestServiceB.hap",
"ActsFormSystemTestServiceD.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.formszeroandone",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.formszeroandone",
"name": ".MyApplication",
"mainAbility": "com.example.formszeroandone.MainAbility",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "com.example.formszeroandone.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
],
"reqPermissions": [
{
"name": "ohos.permission.INSTALL_BUNDLE",
"reason": "need use ohos.permission.INSTALL_BUNDLE"
},
{
"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
"reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE",
"reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name":"ohos.permission.REMOVE_CACHE_FILES",
"reason":"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name":"ohos.permission.LISTEN_BUNDLE_CHANGE",
"reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("/common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import app from '@system.app'
import file from '@system.file'
import router from '@system.router'
import device from '@system.device'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: ""
},
onInit() {
this.title = "卡片配置信息查询 \n有权限、是系统应用";
},
onShow() {
console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
const reportExtend = new ReportExtend(file)
core.addService('expect', expectExtend)
core.addService('report', reportExtend)
core.init()
const configService = core.getDefaultService('config')
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
console.info('onShow end')
},
onReady() {
},
}
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import formManager from '@ohos.ability.formManager'
import {describe, it, expect} from 'deccjsunit/index'
const TIMEOUT = 3000;
describe('ActsFormsZeroAndOneTest', function () {
console.log("ActsFormsZeroAndOneTest===start");
/**
* @tc.name getAllFormsInfo test
* @tc.number FMS_getFormsInfo_0400
* @tc.desc All form configuration information is queried successfully (by AsyncCallback)
*/
it('FMS_getFormsInfo_0400_callback', 0, async function (done) {
console.log("FMS_getFormsInfo_0400_callback begin");
var ret = formManager.getAllFormsInfo(
(result, data) => {
console.log("FMS_getFormsInfo_0400_callback, the forms number:" + data.length);
console.log("FMS_getFormsInfo_0400_callback async::sucess, data json:" + JSON.stringify(data));
var dataB = data.filter((p) => {
return p.bundleName == "com.form.formsystemtestserviceb";
});
console.log("FMS_getFormsInfo_0400_callback async::sucess, dataB json:" + JSON.stringify(dataB));
console.log("FMS_getFormsInfo_0400_callback async::result, result:" + result);
expect(result).assertEqual(1);
expect(dataB[0].name).assertEqual("FormB_Js001");
expect(dataB[0].description).assertEqual("form_description");
expect(dataB[0].type).assertEqual(1);
expect(dataB[0].colorMode).assertEqual(-1);
expect(dataB[0].jsComponentName).assertEqual("card");
expect(dataB[0].isDefault).assertEqual(1);
expect(dataB[0].updateEnabled).assertEqual(1);
expect(dataB[0].updateDuration).assertEqual(1);
expect(dataB[0].scheduledUpdateTime).assertEqual("10:30");
expect(dataB[0].formVisibleNotify).assertEqual(1);
expect(dataB[0].defaultDimension).assertEqual(1);
expect(dataB[0].supportDimensions[0]).assertEqual(1);
expect(dataB[0].supportDimensions[1]).assertEqual(2);
expect(dataB[0].metaData.customizeData[0].name).assertEqual("originWidgetName");
expect(dataB[0].metaData.customizeData[0].value).assertEqual("myTest");
console.log("FMS_getFormsInfo_0400_callback result end");
done();
}
);
setTimeout(function () {
console.info('=====================FMS_getFormsInfo_0400_callback==================end');
}, TIMEOUT)
console.log("FMS_getFormsInfo_0400_callback end, ret:"+ret);
})
/**
* @tc.name getAllFormsInfo test
* @tc.number FMS_getFormsInfo_0400
* @tc.desc All form configuration information is queried successfully (by Promise)
*/
it('FMS_getFormsInfo_0400_promise', 0, async function (done) {
console.log("FMS_getFormsInfo_0400_promise begin");
var promise = formManager.getAllFormsInfo();
promise.then((data) => {
console.log("FMS_getFormsInfo_0400_promise, the forms number:" + data.length);
console.log("FMS_getFormsInfo_0400_promise async::sucess, data json:" + JSON.stringify(data));
var dataB = data.filter((p) => {
return p.bundleName == "com.form.formsystemtestserviceb";
});
console.log("FMS_getFormsInfo_0400_promise async::sucess, dataB json:" + JSON.stringify(dataB));
expect(dataB[0].name).assertEqual("FormB_Js001");
expect(dataB[0].description).assertEqual("form_description");
expect(dataB[0].type).assertEqual(1);
expect(dataB[0].colorMode).assertEqual(-1);
expect(dataB[0].jsComponentName).assertEqual("card");
expect(dataB[0].isDefault).assertEqual(1);
expect(dataB[0].updateEnabled).assertEqual(1);
expect(dataB[0].updateDuration).assertEqual(1);
expect(dataB[0].scheduledUpdateTime).assertEqual("10:30");
expect(dataB[0].formVisibleNotify).assertEqual(1);
expect(dataB[0].defaultDimension).assertEqual(1);
expect(dataB[0].supportDimensions[0]).assertEqual(1);
expect(dataB[0].supportDimensions[1]).assertEqual(2);
expect(dataB[0].metaData.customizeData[0].name).assertEqual("originWidgetName");
expect(dataB[0].metaData.customizeData[0].value).assertEqual("myTest");
console.log("FMS_getFormsInfo_0400_promise result end");
done();
}
);
setTimeout(function () {
console.info('=====================FMS_getFormsInfo_0400_promise==================end');
}, TIMEOUT)
})
})
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./FormsZeroAndOneJsunit.test.js')
\ No newline at end of file
{
"string": [
{
"name": "entry_MainAbility",
"value": "formszeroandone"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "300000",
"package": "com.example.formszero",
"shell-timeout": "600000"
},
"kits": [
{
"test-file-name": [
"ActsFormsZeroTest.hap",
"ActsFormSystemTestServiceD.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册