提交 51ca365b 编写于 作者: L logic42

change multimodalinput and powermgr testcase

Signed-off-by: Nlogic42 <wanglong108@huawei.com>
上级 b6ce85bb
...@@ -189,4 +189,68 @@ describe('MultimodalInput_test', function () { ...@@ -189,4 +189,68 @@ describe('MultimodalInput_test', function () {
console.log(`inputDevice::getKeyboardType_test-03 exit`); console.log(`inputDevice::getKeyboardType_test-03 exit`);
}); });
}) })
/**
* @tc.number MultimodalInputDevice_js_0010
* @tc.name remainingChargeTime_test
* @tc.desc Battry Present Interface Test
*/
it('MultimodalInputDevice_KeyboardType_NONE_test', 0, function () {
console.info('MultimodalInputDevice_KeyboardType_NONE_test = ' + inputDevice.KeyboardType.NONE);
expect(inputDevice.KeyboardType.NONE == 0).assertTrue();
})
/**
* @tc.number MultimodalInputDevice_js_0020
* @tc.name remainingChargeTime_test
* @tc.desc Battry Present Interface Test
*/
it('MultimodalInputDevice_KeyboardType_UNKNOWN_test', 0, function () {
console.info('MultimodalInputDevice_KeyboardType_UNKNOWN_test = ' + inputDevice.KeyboardType.UNKNOWN);
expect(inputDevice.KeyboardType.UNKNOWN == 1).assertTrue();
})
/**
* @tc.number MultimodalInputDevice_js_0030
* @tc.name remainingChargeTime_test
* @tc.desc Battry Present Interface Test
*/
it('MultimodalInputDevice_KeyboardType_ALPHABETIC_KEYBOARD_test', 0, function () {
console.info('MultimodalInputDevice_KeyboardType_ALPHABETIC_KEYBOARD_test = '
+ inputDevice.KeyboardType.ALPHABETIC_KEYBOARD);
expect(inputDevice.KeyboardType.ALPHABETIC_KEYBOARD == 2).assertTrue();
})
/**
* @tc.number MultimodalInputDevice_js_0040
* @tc.name remainingChargeTime_test
* @tc.desc Battry Present Interface Test
*/
it('MultimodalInputDevice_KeyboardType_ALPHABETIC_DIGITAL_KEYBOARD_test', 0, function () {
console.info('MultimodalInputDevice_KeyboardType_ALPHABETIC_DIGITAL_KEYBOARD_test = '
+ inputDevice.KeyboardType.DIGITAL_KEYBOARD);
expect(inputDevice.KeyboardType.DIGITAL_KEYBOARD == 3).assertTrue();
})
/**
* @tc.number MultimodalInputDevice_js_0040
* @tc.name remainingChargeTime_test
* @tc.desc Battry Present Interface Test
*/
it('MultimodalInputDevice_KeyboardType_ALPHABETIC_HANDWRITING_PEN_test', 0, function () {
console.info('MultimodalInputDevice_KeyboardType_ALPHABETIC_HANDWRITING_PEN_test = '
+ inputDevice.KeyboardType.HANDWRITING_PEN);
expect(inputDevice.KeyboardType.HANDWRITING_PEN == 4).assertTrue();
})
/**
* @tc.number MultimodalInputDevice_js_0040
* @tc.name remainingChargeTime_test
* @tc.desc Battry Present Interface Test
*/
it('MultimodalInputDevice_KeyboardType_ALPHABETIC_REMOTE_CONTROL_test', 0, function () {
console.info('MultimodalInputDevice_KeyboardType_ALPHABETIC_REMOTE_CONTROL_test = '
+ inputDevice.KeyboardType.REMOTE_CONTROL);
expect(inputDevice.KeyboardType.REMOTE_CONTROL == 5).assertTrue();
})
}) })
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
require('./InputDevice.test.js') require('./InputDevice.test.js')
require('./MultimodalInputKey_Code.test.js')
...@@ -14,8 +14,7 @@ ...@@ -14,8 +14,7 @@
*/ */
import app from '@system.app' import app from '@system.app'
import Context from '@ohos.napi_context' import batteryInfo from '@ohos.batteryinfo';
import batteryInfo from '@ohos.batteryInfo';
import brightness from '@ohos.brightness'; import brightness from '@ohos.brightness';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
...@@ -322,7 +321,7 @@ describe('appInfoTest', function () { ...@@ -322,7 +321,7 @@ describe('appInfoTest', function () {
let batteryLevel = batteryInfo.batteryCapacityLevel; let batteryLevel = batteryInfo.batteryCapacityLevel;
console.info('batteryLevel = ' + batteryLevel); console.info('batteryLevel = ' + batteryLevel);
expect(batteryLevel >= batteryInfo.BatteryCapacityLevel.LEVEL_NONE && expect(batteryLevel >= batteryInfo.BatteryCapacityLevel.LEVEL_NONE &&
batteryLevel <= batteryInfo.BatteryCapacityLevel.LEVEL_CRITICAL).assertTrue(); batteryLevel <= batteryInfo.BatteryCapacityLevel.LEVEL_CRITICAL).assertTrue();
}) })
/** /**
...@@ -393,16 +392,133 @@ describe('appInfoTest', function () { ...@@ -393,16 +392,133 @@ describe('appInfoTest', function () {
/** /**
* @tc.number battery_manager_js_3400 * @tc.number battery_manager_js_3400
* @tc.name remainingChargeTime_test * @tc.name battery_manager_js_3400
* @tc.desc Battry Present Interface Test * @tc.desc Battry Present Interface Test
*/ */
it('remainingChargeTime_test', 0, function () { it('remainingChargeTime_test', 0, function () {
let remainingChargeTime = batteryInfo.estimatedRemainingChargeTime; let remainingChargeTime = batteryInfo.estimatedRemainingChargeTime;
console.info('remainingChargeTime = ' + remainingChargeTime); console.info('remainingChargeTime = ' + remainingChargeTime);
expect(remainingChargeTime >= 0).assertTrue(); expect(remainingChargeTime >= 0).assertTrue();
}) })
/**
* @tc.number battery_manager_js_3500
* @tc.name battery_manager_js_3500
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_SOC_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_SOC = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_SOC);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_SOC == 0).assertTrue();
})
/**
* @tc.number battery_manager_js_3600
* @tc.name battery_manager_js_3600
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_VOLTAGE_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_VOLTAGE = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_VOLTAGE);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_VOLTAGE == 1).assertTrue();
})
/**
* @tc.number battery_manager_js_3700
* @tc.name battery_manager_js_3700
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_TEMPERATURE_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_TEMPERATURE = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_TEMPERATURE);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_TEMPERATURE == 2).assertTrue();
})
/**
* @tc.number battery_manager_js_3800
* @tc.name battery_manager_js_3800
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_HEALTH_STATE_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_HEALTH_STATE = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_HEALTH_STATE);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_HEALTH_STATE == 3).assertTrue();
})
/**
* @tc.number battery_manager_js_3900
* @tc.name battery_manager_js_3900
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_PLUGGED_TYPE_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_PLUGGED_TYPE = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_PLUGGED_TYPE);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_PLUGGED_TYPE == 4).assertTrue();
})
/**
* @tc.number battery_manager_js_4000
* @tc.name battery_manager_js_4000
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_MAX_CURRENT_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_MAX_CURRENT = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_MAX_CURRENT);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_MAX_CURRENT == 5).assertTrue();
})
/**
* @tc.number battery_manager_js_4100
* @tc.name battery_manager_js_4100
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_MAX_VOLTAGE_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_MAX_VOLTAGE = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_MAX_VOLTAGE);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_MAX_VOLTAGE == 6).assertTrue();
})
/**
* @tc.number battery_manager_js_4200
* @tc.name battery_manager_js_4200
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_CHARGE_STATE_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_CHARGE_STATE = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_CHARGE_STATE);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_CHARGE_STATE == 7).assertTrue();
})
/**
* @tc.number battery_manager_js_4300
* @tc.name battery_manager_js_4300
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_CHARGE_COUNTER_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_CHARGE_COUNTER = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_CHARGE_COUNTER);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_CHARGE_COUNTER == 8).assertTrue();
})
/**
* @tc.number battery_manager_js_4400
* @tc.name battery_manager_js_4400
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_PRESENT_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_PRESENT = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_PRESENT);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_PRESENT == 9).assertTrue();
})
/**
* @tc.number battery_manager_js_4500
* @tc.name battery_manager_js_4500
* @tc.desc Battry Present Interface Test
*/
it('CommonEventBatteryChangedCode_EXTRA_TECHNOLOGY_test', 0, function () {
console.info('CommonEventBatteryChangedCode_EXTRA_TECHNOLOGY = '
+ batteryInfo.CommonEventBatteryChangedCode.EXTRA_TECHNOLOGY);
expect(batteryInfo.CommonEventBatteryChangedCode.EXTRA_TECHNOLOGY == 10).assertTrue();
})
}) })
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import batteryInfo from '@ohos.batteryInfo'; import batteryInfo from '@ohos.batteryinfo';
import { describe, it, expect } from 'deccjsunit/index'; import { describe, it, expect } from 'deccjsunit/index';
describe('appInfoTest', function () { describe('appInfoTest', function () {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import runningLock from '@ohos.runningLock'; import runningLock from '@ohos.runninglock';
import '@ohos.permission.RUNNING_LOCK' import '@ohos.permission.RUNNING_LOCK'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
import runningLock from '@ohos.runningLock'; import runningLock from '@ohos.runninglock';
import power from '@ohos.power'; import power from '@ohos.power';
import brightness from '@ohos.brightness'; import brightness from '@ohos.brightness';
import { describe, it, expect } from 'deccjsunit/index'; import { describe, it, expect } from 'deccjsunit/index';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册