Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1f2693fa
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1f2693fa
编写于
7月 21, 2022
作者:
Z
zhangyushuai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
recover 5 case
Signed-off-by:
N
zhangyushuai
<
zhangyushuai1@huawei.com
>
上级
3465b55b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
159 addition
and
73 deletion
+159
-73
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputmethodEngineJsunit.test.ets
.../entry/src/main/ets/test/InputmethodEngineJsunit.test.ets
+83
-48
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputmethohJsunit.test.ets
...st_ets/entry/src/main/ets/test/InputmethohJsunit.test.ets
+76
-25
未找到文件。
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputmethodEngineJsunit.test.ets
浏览文件 @
1f2693fa
...
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect
} from 'hypium/index';
import {
describe, beforeAll, beforeEach, afterEach, afterAll, it, expect
} from 'hypium/index';
import inputMethodEngine from '@ohos.inputmethodengine';
import Utils from './Utils';
import router from '@system.router';
...
...
@@ -26,7 +26,7 @@ export default function inputMethodEngineJsunit() {
var textInputClient = null;
var kbController = null;
console.
log
("************* inputMethodEngine Test start*************");
console.
info
("************* inputMethodEngine Test start*************");
beforeEach(async function (done) {
let options = {
uri: 'pages/input',
...
...
@@ -45,22 +45,22 @@ export default function inputMethodEngineJsunit() {
});
afterEach(async function () {
console.
log
("inputMethodEngine afterEach start:" + inputMethodEngineObject);
console.
info
("inputMethodEngine afterEach start:" + inputMethodEngineObject);
await Utils.sleep(1000);
});
it('inputMethodEngine_test_000', 0, async function (done) {
inputMethodEngineObject.on('inputStart', (kbController, textInputClient) => {
console.
log
("inputMethodEngine beforeEach inputStart:" + JSON.stringify(kbController));
console.
log
("inputMethodEngine beforeEach inputStart:" + JSON.stringify(textInputClient));
console.
info
("inputMethodEngine beforeEach inputStart:" + JSON.stringify(kbController));
console.
info
("inputMethodEngine beforeEach inputStart:" + JSON.stringify(textInputClient));
textInputClient = textInputClient;
kbController = kbController;
});
inputMethodEngineObject.on('keyboardShow', (err) => {
console.
log
("inputMethodEngine beforeEach keyboardShow:" + err);
console.
info
("inputMethodEngine beforeEach keyboardShow:" + err);
});
inputMethodEngineObject.on('keyboardHide', (err) => {
console.
log
("inputMethodEngine beforeEach keyboardHide:" + err);
console.
info
("inputMethodEngine beforeEach keyboardHide:" + err);
});
mKeyboardDelegate = inputMethodEngine.createKeyboardDelegate();
mKeyboardDelegate.on('keyDown', (keyEvent) => {
...
...
@@ -80,200 +80,200 @@ export default function inputMethodEngineJsunit() {
});
mKeyboardDelegate.on('cursorContextChange', (x, y, height) => {
console.
log
("inputMethodEngine beforeEach cursorContextChange x:" + x);
console.
log
("inputMethodEngine beforeEach cursorContextChange y:" + y);
console.
log
("inputMethodEngine beforeEach cursorContextChange height:" + height);
console.
info
("inputMethodEngine beforeEach cursorContextChange x:" + x);
console.
info
("inputMethodEngine beforeEach cursorContextChange y:" + y);
console.
info
("inputMethodEngine beforeEach cursorContextChange height:" + height);
});
mKeyboardDelegate.on('selectionChange', (oldBegin, oldEnd, newBegin, newEnd) => {
console.
log
("inputMethodEngine beforeEach selectionChange oldBegin:" + oldBegin);
console.
log
("inputMethodEngine beforeEach selectionChange oldEnd:" + oldEnd);
console.
log
("inputMethodEngine beforeEach selectionChange newBegin:" + newBegin);
console.
log
("inputMethodEngine beforeEach selectionChange newEnd:" + newEnd);
console.
info
("inputMethodEngine beforeEach selectionChange oldBegin:" + oldBegin);
console.
info
("inputMethodEngine beforeEach selectionChange oldEnd:" + oldEnd);
console.
info
("inputMethodEngine beforeEach selectionChange newBegin:" + newBegin);
console.
info
("inputMethodEngine beforeEach selectionChange newEnd:" + newEnd);
});
mKeyboardDelegate.on('textChange', (text) => {
console.
log
("inputMethodEngine beforeEach textChange:" + text);
console.
info
("inputMethodEngine beforeEach textChange:" + text);
});
done();
});
it('inputMethodEngine_test_001', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_UNSPECIFIED;
console.
log
("inputMethodEngine_test_001 result:" + keyType);
console.
info
("inputMethodEngine_test_001 result:" + keyType);
expect(keyType).assertEqual(0);
done();
});
it('inputMethodEngine_test_002', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_GO;
console.
log
("inputMethodEngine_test_002 result:" + keyType);
console.
info
("inputMethodEngine_test_002 result:" + keyType);
expect(keyType).assertEqual(2);
done();
});
it('inputMethodEngine_test_003', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_SEARCH;
console.
log
("inputMethodEngine_test_003 result:" + keyType);
console.
info
("inputMethodEngine_test_003 result:" + keyType);
expect(keyType).assertEqual(3);
done();
});
it('inputMethodEngine_test_004', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_SEND;
console.
log
("inputMethodEngine_test_004 result:" + keyType);
console.
info
("inputMethodEngine_test_004 result:" + keyType);
expect(keyType).assertEqual(4);
done();
});
it('inputMethodEngine_test_005', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_NEXT;
console.
log
("inputMethodEngine_test_005 result:" + keyType);
console.
info
("inputMethodEngine_test_005 result:" + keyType);
expect(keyType).assertEqual(5);
done();
});
it('inputMethodEngine_test_006', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_DONE;
console.
log
("inputMethodEngine_test_006 result:" + keyType);
console.
info
("inputMethodEngine_test_006 result:" + keyType);
expect(keyType).assertEqual(6);
done();
});
it('inputMethodEngine_test_007', 0, async function (done) {
let keyType = inputMethodEngine.ENTER_KEY_TYPE_PREVIOUS;
console.
log
("inputMethodEngine_test_007 result:" + keyType);
console.
info
("inputMethodEngine_test_007 result:" + keyType);
expect(keyType).assertEqual(7);
done();
});
it('inputMethodEngine_test_008', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_NULL;
console.
log
("inputMethodEngine_test_008 result:" + keyType);
console.
info
("inputMethodEngine_test_008 result:" + keyType);
expect(keyType).assertEqual(-1);
done();
});
it('inputMethodEngine_test_009', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_TEXT;
console.
log
("inputMethodEngine_test_009 result:" + keyType);
console.
info
("inputMethodEngine_test_009 result:" + keyType);
expect(keyType).assertEqual(0);
done();
});
it('inputMethodEngine_test_010', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_NUMBER;
console.
log
("inputMethodEngine_test_010 result:" + keyType);
console.
info
("inputMethodEngine_test_010 result:" + keyType);
expect(keyType).assertEqual(2);
done();
});
it('inputMethodEngine_test_011', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_PHONE;
console.
log
("inputMethodEngine_test_011 result:" + keyType);
console.
info
("inputMethodEngine_test_011 result:" + keyType);
expect(keyType).assertEqual(3);
done();
});
it('inputMethodEngine_test_012', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_DATETIME;
console.
log
("inputMethodEngine_test_012 result:" + keyType);
console.
info
("inputMethodEngine_test_012 result:" + keyType);
expect(keyType).assertEqual(4);
done();
});
it('inputMethodEngine_test_013', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_EMAIL;
console.
log
("inputMethodEngine_test_013 result:" + keyType);
console.
info
("inputMethodEngine_test_013 result:" + keyType);
expect(keyType).assertEqual(5);
done();
});
it('inputMethodEngine_test_014', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_URI;
console.
log
("inputMethodEngine_test_014 result:" + keyType);
console.
info
("inputMethodEngine_test_014 result:" + keyType);
expect(keyType).assertEqual(6);
done();
});
it('inputMethodEngine_test_015', 0, async function (done) {
let keyType = inputMethodEngine.PATTERN_PASSWORD;
console.
log
("inputMethodEngine_test_015 result:" + keyType);
console.
info
("inputMethodEngine_test_015 result:" + keyType);
expect(keyType).assertEqual(7);
done();
});
it('inputMethodEngine_test_016', 0, async function (done) {
let keyType = inputMethodEngine.FLAG_SELECTING;
console.
log
("inputMethodEngine_test_016 result:" + keyType);
console.
info
("inputMethodEngine_test_016 result:" + keyType);
expect(keyType).assertEqual(2);
done();
});
it('inputMethodEngine_test_017', 0, async function (done) {
let keyType = inputMethodEngine.FLAG_SINGLE_LINE;
console.
log
("inputMethodEngine_test_017 result:" + keyType);
console.
info
("inputMethodEngine_test_017 result:" + keyType);
expect(keyType).assertEqual(1);
done();
});
it('inputMethodEngine_test_018', 0, async function (done) {
let keyType = inputMethodEngine.DISPLAY_MODE_PART;
console.
log
("inputMethodEngine_test_018 result:" + keyType);
console.
info
("inputMethodEngine_test_018 result:" + keyType);
expect(keyType).assertEqual(0);
done();
});
it('inputMethodEngine_test_019', 0, async function (done) {
let keyType = inputMethodEngine.DISPLAY_MODE_FULL;
console.
log
("inputMethodEngine_test_019 result:" + keyType);
console.
info
("inputMethodEngine_test_019 result:" + keyType);
expect(keyType).assertEqual(1);
done();
});
it('inputMethodEngine_test_020', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_ASCII;
console.
log
("inputMethodEngine_test_020 result:" + keyType);
console.
info
("inputMethodEngine_test_020 result:" + keyType);
expect(keyType).assertEqual(20);
done();
});
it('inputMethodEngine_test_021', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_NONE;
console.
log
("inputMethodEngine_test_021 result:" + keyType);
console.
info
("inputMethodEngine_test_021 result:" + keyType);
expect(keyType).assertEqual(0);
done();
});
it('inputMethodEngine_test_022', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_AUTO_CAP_CHARACTERS;
console.
log
("inputMethodEngine_test_022 result:" + keyType);
console.
info
("inputMethodEngine_test_022 result:" + keyType);
expect(keyType).assertEqual(2);
done();
});
it('inputMethodEngine_test_023', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_AUTO_CAP_SENTENCES;
console.
log
("inputMethodEngine_test_023 result:" + keyType);
console.
info
("inputMethodEngine_test_023 result:" + keyType);
expect(keyType).assertEqual(8);
done();
});
it('inputMethodEngine_test_024', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_AUTO_WORDS;
console.
log
("inputMethodEngine_test_024 result:" + keyType);
console.
info
("inputMethodEngine_test_024 result:" + keyType);
expect(keyType).assertEqual(4);
done();
});
it('inputMethodEngine_test_025', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_MULTI_LINE;
console.
log
("inputMethodEngine_test_025 result:" + keyType);
console.
info
("inputMethodEngine_test_025 result:" + keyType);
expect(keyType).assertEqual(1);
done();
});
it('inputMethodEngine_test_026', 0, async function (done) {
let keyType = inputMethodEngine.OPTION_NO_FULLSCREEN;
console.
log
("inputMethodEngine_test_026 result:" + keyType);
console.
info
("inputMethodEngine_test_026 result:" + keyType);
expect(keyType).assertEqual(10);
done();
});
...
...
@@ -304,7 +304,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.sendKeyFunction(0, (value) => {
console.
log
("inputMethodEngine_test_028 textInputClient sendKeyFunction:" + value);
console.
info
("inputMethodEngine_test_028 textInputClient sendKeyFunction:" + value);
expect(value).assertEqual(true);
});
}
...
...
@@ -332,7 +332,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.deleteForward(1, (value) => {
console.
log
("inputMethodEngine_test_030 deleteForward:" + value);
console.
info
("inputMethodEngine_test_030 deleteForward:" + value);
expect(value).assertEqual(true);
});
}
...
...
@@ -360,7 +360,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.deleteBackward(1, (value) => {
console.
log
("inputMethodEngine_test_032 deleteBackward:" + value);
console.
info
("inputMethodEngine_test_032 deleteBackward:" + value);
expect(value).assertEqual(true);
});
}
...
...
@@ -388,7 +388,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.InsertText('test', (value) => {
console.
log
("inputMethodEngine_test_034 InsertText:" + value);
console.
info
("inputMethodEngine_test_034 InsertText:" + value);
expect(value).assertEqual(true);
});
}
...
...
@@ -416,7 +416,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.getForward(1, (value) => {
console.
log
("inputMethodEngine_test_036 getForward:" + value);
console.
info
("inputMethodEngine_test_036 getForward:" + value);
expect(value).assertEqual(true);
});
}
...
...
@@ -444,7 +444,7 @@ export default function inputMethodEngineJsunit() {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.getEditorAttribute(1, (editorAttribute) => {
console.
log
("inputMethodEngine_test_038 getEditorAttribute:" + value);
console.
info
("inputMethodEngine_test_038 getEditorAttribute:" + value);
expect(editorAttribute.inputPattern).assertEqual(1);
expect(editorAttribute.enterKeyType).assertEqual(1);
});
...
...
@@ -474,7 +474,7 @@ export default function inputMethodEngineJsunit() {
expect(kbController == null).assertEqual(true);
} else {
kbController.hideKeyboard(() => {
console.
log
("inputMethodEngine_test_040 hideKeyboard:" + value);
console.
info
("inputMethodEngine_test_040 hideKeyboard:" + value);
expect(1 == 1).assertTrue();
});
}
...
...
@@ -525,5 +525,40 @@ export default function inputMethodEngineJsunit() {
done();
});
it('inputMethodEngine_test_044', 0, async function (done) {
let keyType = inputMethodEngine.WINDOW_TYPE_INPUT_METHOD_FLOAT;
console.error("inputMethodEngine_test_044 result:" + keyType);
expect(keyType == null).assertTrue();
done();
});
it('inputMethodEngine_test_045', 0, async function (done) {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
textInputClient.moveCursor(1, (value) => {
console.info("inputMethodEngine_test_045 getBackward:" + value);
expect(value == null).assertEqual(true);
});
}
done();
});
it('inputMethodEngine_test_046', 0, async function (done) {
if (textInputClient == null) {
expect(textInputClient == null).assertEqual(true);
} else {
let promise = textInputClient.moveCursor(1);
promise.then(res => {
console.info("inputMethodEngine_test_046 getBackward promise result-----" + JSON.stringify(res));
expect(res == null).assertEqual(true);
}).catch(err => {
console.info("inputMethodEngine_test_046 getBackward promise error----" + JSON.stringify(err));
expect().assertFail();
});
}
done();
})
})
}
miscservices/InputMethodTest_ets/entry/src/main/ets/test/InputmethohJsunit.test.ets
浏览文件 @
1f2693fa
...
...
@@ -14,14 +14,14 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'hypium/index';
import input
meth
from '@ohos.inputmethod';
import input
Method
from '@ohos.inputmethod';
export default function settingUiJsunit() {
describe('appInfoTest_input_2', function () {
console.
log
("************* settings Test start*************");
console.
info
("************* settings Test start*************");
it('inputmethoh_test_001', 0, async function (done) {
let inputMethodSetting = input
meth
.getInputMethodSetting();
console.
log
("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
let inputMethodSetting = input
Method
.getInputMethodSetting();
console.
info
("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.listInputMethod((arr) => {
console.info("inputmethoh_test_001 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue();
...
...
@@ -30,20 +30,25 @@ export default function settingUiJsunit() {
});
it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = input
meth
.getInputMethodSetting();
console.
log
("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
let inputMethodSetting = input
Method
.getInputMethodSetting();
console.
info
("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting));
let promise = inputMethodSetting.listInputMethod();
console.info("inputmethoh_test_002 listInputMethod result---" + JSON.stringify(promise));
let obj = promise[0];
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName=='com.example.kikakeyboard').assertTrue();
expect(obj.methodId=='ServiceExtAbility').assertTrue();
if (promise.length > 0){
let obj = promise[0]
console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj));
expect(obj.packageName != null).assertTrue();
expect(obj.methodId != null).assertTrue();
}else{
console.info("inputmethoh_test_002 listInputMethod is null");
except().assertFail()
}
done();
});
it('inputmethoh_test_003', 0, async function (done) {
let inputMethodSetting = input
meth
.getInputMethodSetting();
console.
log
("inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
let inputMethodSetting = input
Method
.getInputMethodSetting();
console.
info
("inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod(() => {
console.info("inputmethoh_test_003 displayOptionalInputMethod---");
});
...
...
@@ -51,8 +56,8 @@ export default function settingUiJsunit() {
});
it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = input
meth
.getInputMethodSetting();
console.
log
("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
let inputMethodSetting = input
Method
.getInputMethodSetting();
console.
info
("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
let promise = inputMethodSetting.displayOptionalInputMethod();
console.info("inputmethoh_test_004 displayOptionalInputMethod result---" + JSON.stringify(promise));
expect(promise).assertEqual(undefined)
...
...
@@ -60,8 +65,8 @@ export default function settingUiJsunit() {
});
it('inputmethoh_test_005', 0, async function (done) {
let inputMethodCtrl = input
meth
.getInputMethodController();
console.
log
("inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
let inputMethodCtrl = input
Method
.getInputMethodController();
console.
info
("inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput((res) => {
console.info("inputmethoh_test_005 stopInput result----" + res);
});
...
...
@@ -69,8 +74,8 @@ export default function settingUiJsunit() {
});
it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = input
meth
.getInputMethodController();
console.
log
("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
let inputMethodCtrl = input
Method
.getInputMethodController();
console.
info
("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl));
let promise = inputMethodCtrl.stopInput();
console.info("inputmethoh_test_006 inputMethodCtrl stopInput result---" + JSON.stringify(promise));
expect(promise).assertEqual(true)
...
...
@@ -78,17 +83,63 @@ export default function settingUiJsunit() {
});
/*
* @tc.number
: inputmethod_test_MAX_TYPE_NUM_001
* @tc.name
: inputMethod::MAX_TYPE_NUM
* @tc.desc
: Verify Max_ TYPE_ NUM
* @tc.number: inputmethod_test_MAX_TYPE_NUM_001
* @tc.name: inputMethod::MAX_TYPE_NUM
* @tc.desc: Verify Max_ TYPE_ NUM
*/
it('inputmethod_test_MAX_TYPE_NUM_001', 0, async function (done) {
console.
log
("************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************");
let inputMethodSetting = input
meth
.MAX_TYPE_NUM;
console.
log
("inputmethod_test_001 result:" + inputMethodSetting);
console.
info
("************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************");
let inputMethodSetting = input
Method
.MAX_TYPE_NUM;
console.
info
("inputmethod_test_001 result:" + inputMethodSetting);
expect(inputMethodSetting != null).assertTrue();
console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_switchInputMethod_001
* @tc.name Test Indicates the input method which will replace the current one.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_switchInputMethod_001', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_001 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
}
inputMethod.switchInputMethod(inputMethodProperty).then((data) => {
console.info("inputmethod_test_switchInputMethod_001 data:" + data)
expect(data).assertEqual(true);
}).catch((err) => {
console.error('inputmethod_test_switchInputMethod_001 failed because ' + JSON.stringify(err));
});
console.info("************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
});
/*
* @tc.number inputmethod_test_switchInputMethod_002
* @tc.name Test Indicates the input method which will replace the current one.
* @tc.desc Function test
* @tc.level 2
*/
it('inputmethod_test_switchInputMethod_002', 0, async function (done) {
console.info("************* inputmethod_test_switchInputMethod_002 Test start*************");
let inputMethodProperty = {
packageName:"com.example.kikakeyboard",
methodId:"ServiceExtAbility"
}
inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{
if(err){
console.info("inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail()
}
console.info("inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue();
});
console.info("************* inputmethod_test_switchInputMethod_002 Test end*************");
done();
console.log("************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************");
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录