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

!1732 多模 xts js用例申请提交合入

Merge pull request !1732 from zhxiaop/zhxiao_xts_acts_01_27
......@@ -14,22 +14,41 @@
*/
import inputDevice from '@ohos.multimodalInput.inputDevice';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import {
describe,
beforeAll,
beforeEach,
afterEach,
afterAll,
it,
expect
} from 'deccjsunit/index'
describe('MultimodalInput_test', function () {
// 参数正确,返回一个数组
it('inputDevice::getDeviceIds_test-01', 0, function () {
console.log(`inputDevice::getDeviceIds_test-01 enter`);
inputDevice.getDeviceIds((obj) => {
if (!obj) {
console.log(`inputDevice::getDeviceIds_test-01 error:${JSON.stringify(obj)}`)
expect(false).assertTrue();
} else {
console.log(`inputDevice::getDeviceIds_test-01 success:${JSON.stringify(obj)}`);
expect(obj).assertInstanceOf('Array');
}
console.log(`inputDevice::getDeviceIds_test-01 exit`);
inputDevice.getDeviceIds((data, err) => {
if (err) {
expect(false).assertTrue();
} else {
expect(data).assertInstanceOf('Array');
}
console.log(`inputDevice::getDeviceIds_test-01 exit`);
})
})
})
})
// 参数正确,判断一种或多种设备
it("inputDevice::getDeviceIds_test-02", 0, function () {
console.log(`inputDevice::getDeviceIds_test-02 enter`);
inputDevice.getDeviceIds((data, err) => {
if (err) {
expect(false).assertTrue();
} else {
expect(data.length > 0).assertTure();
}
console.log(`inputDevice::getDeviceIds_test-02 exit`);
})
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册