diff --git a/inputmethod/InputMethodTest_Stage/Test.json b/inputmethod/InputMethodTest_Stage/Test.json index e8d752ab0812ca9d28ef0f4b8a07a50384955e46..5d2e5fb56b32cae8e4525e610f4bbe7b8980861a 100644 --- a/inputmethod/InputMethodTest_Stage/Test.json +++ b/inputmethod/InputMethodTest_Stage/Test.json @@ -6,7 +6,7 @@ "bundle-name": "com.acts.imeability.test", "module-name": "phone", "shell-timeout": "600000", - "testcase-timeout": 70000 + "testcase-timeout": 10000 }, "kits": [{ "test-file-name": [ diff --git a/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets b/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets index 99afcb79523be7ad14669082e10f0dfcb25f9834..e3ed8ac0d7766703f2c4582984385584d6416d20 100644 --- a/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets +++ b/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/imeAbilityTest.test.ets @@ -29,7 +29,7 @@ export default function imeAbilityTest(abilityContext) { * beforeEach: Prerequisites at the test case level, which are executed before each test case is executed. */ beforeEach(function () { - console.info('beforeEach: switchInputMethod to kikakeyboard.'); + console.info('====>beforeEach: switchInputMethod to kikakeyboard.'); let serviceAbilityProperty = { packageName: "com.example.kikakeyboard", methodId: "ServiceExtAbility", @@ -39,7 +39,7 @@ export default function imeAbilityTest(abilityContext) { } inputMethod.switchInputMethod(serviceAbilityProperty).then((data)=>{ - console.info('SUB_InputMethod_IMEAbility_0001 switchInputMethod to Kika :' + data); + console.info('====>SUB_InputMethod_IMEAbility_0001 switchInputMethod to Kika :' + data); expect(data == true).assertTrue(); }) @@ -49,7 +49,7 @@ export default function imeAbilityTest(abilityContext) { * afterEach: Test case-level clearance conditions, which are executed after each test case is executed. */ afterEach(function () { - console.info('afterEach: Test case-level clearance conditions is executed.'); + console.info('====>afterEach: Test case-level clearance conditions is executed.'); }); /** @@ -60,7 +60,7 @@ export default function imeAbilityTest(abilityContext) { * @tc.level : Level 1 */ it('SUB_InputMethod_IMEAbility_0001', 0, async function (done) { - console.info('----------SUB_InputMethod_IMEAbility_0001 start-------------'); + console.info('====>----------SUB_InputMethod_IMEAbility_0001 start-------------'); let imExtAbilityProperty = { packageName : "com.acts.imeability.test", methodId : "com.acts.imeability.test.ImExtAbility", @@ -70,11 +70,11 @@ export default function imeAbilityTest(abilityContext) { } inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{ - console.info('SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data); + console.info('====>SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data); expect(data == true).assertTrue(); }); sleep(Date.now(), 3000); - console.info('----------SUB_InputMethod_IMEAbility_0001 end-------------'); + console.info('====>----------SUB_InputMethod_IMEAbility_0001 end-------------'); done(); }) @@ -87,7 +87,7 @@ export default function imeAbilityTest(abilityContext) { * @tc.level : Level 1 */ it('SUB_InputMethod_IMEAbility_0002', 0, async function (done) { - console.info('-----------SUB_InputMethod_IMEAbility_0002 start-------------'); + console.info('====>-----------SUB_InputMethod_IMEAbility_0002 start-------------'); let imExtAbilityProperty = { packageName : "com.acts.imeability.test", @@ -98,11 +98,11 @@ export default function imeAbilityTest(abilityContext) { } inputMethod.switchInputMethod(imExtAbilityProperty).then((data)=>{ - console.info('SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data); + console.info('====>SUB_InputMethod_IMEAbility_0004 switchInputMethod to IME :' + data); expect(data == true).assertTrue(); }); sleep(Date.now(), 2500); - console.info('-----------SUB_InputMethod_IMEAbility_0002 end-------------'); + console.info('====>-----------SUB_InputMethod_IMEAbility_0002 end-------------'); done(); }) }) diff --git a/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets b/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets index 98a7b39924e66025df7429082a3a844ed9599075..d0f5a7b96292864ff648aeb028f3df29e9f31aef 100644 --- a/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets +++ b/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets @@ -18,7 +18,7 @@ import subtype from '@ohos.inputMethodSubtype'; export default function inputMethodStageJSUnit() { describe('inputMethodTest', function () { - console.info("************* settings Test start*************"); + console.info("====>************* settings Test start*************"); /* * @tc.number inputMethod_test_getController_001 * @tc.name get inputMethod controller @@ -26,23 +26,23 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_getController_001', 0, async function (done) { - console.info("-----------------inputMethod_test_getController_001 start---------------------"); + console.info("====>-----------------inputMethod_test_getController_001 start---------------------"); try{ let inputMethodControl = inputMethod.getController(); - console.info("inputMethod_test_getController_001 result:" + typeof inputMethodControl); + console.info("====>inputMethod_test_getController_001 result:" + typeof inputMethodControl); if(typeof inputMethodControl == "object" ){ - console.info("inputMethod_test_getController_001 getController success"); + console.info("====>inputMethod_test_getController_001 getController success"); expect(true).assertTrue(); }else{ - console.info("inputMethod_test_getController_001 getController failed"); + console.info("====>inputMethod_test_getController_001 getController failed"); expect().assertFail(); }; }catch(error){ - console.info("inputMethod_test_getController_001 getController error" + JSON.stringify(error)); + console.info("====>inputMethod_test_getController_001 getController error" + JSON.stringify(error)); expect().assertFail(); }; - console.info("-----------------inputMethod_test_getController_001 end---------------------"); + console.info("====>-----------------inputMethod_test_getController_001 end---------------------"); done(); }); @@ -53,7 +53,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_listInputMethodSubtype_001', 0, async function (done) { - console.info("-----------------inputMethod_test_listInputMethodSubtype_001 start---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_001 start---------------------"); let inputMethodProperty = { packageName:"com.example.kikakeyboard", methodId:"ServiceExtAbility", @@ -67,23 +67,23 @@ export default function inputMethodStageJSUnit() { try{ let inputMethodSetting = inputMethod.getSetting(); - console.info("inputMethod_test_listInputMethodSubtype_001 getSetting result:" + inputMethodSetting); + console.info("====>inputMethod_test_listInputMethodSubtype_001 getSetting result:" + inputMethodSetting); inputMethodSetting.listInputMethodSubtype(inputMethodProperty, (err, data) => { if(err){ - console.info("inputMethod_test_listInputMethodSubtype_001 failed" + JSON.stringify(err)); + console.info("====>inputMethod_test_listInputMethodSubtype_001 failed" + JSON.stringify(err)); expect().assertFail(); done(); } - console.info("inputMethod_test_listInputMethodSubtype_001 listInputMethodSubtype: " + JSON.stringify(data)); + console.info("====>inputMethod_test_listInputMethodSubtype_001 listInputMethodSubtype: " + JSON.stringify(data)); expect(true).assertTrue(); done(); }); }catch(error){ - console.info("inputMethod_test_listInputMethodSubtype_001 listInputMethodSubtype catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_listInputMethodSubtype_001 listInputMethodSubtype catch error" + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_listInputMethodSubtype_001 end---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_001 end---------------------"); }); /* @@ -93,7 +93,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_listInputMethodSubtype_002', 0, async function (done) { - console.info("-----------------inputMethod_test_listInputMethodSubtype_002 start---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_002 start---------------------"); let inputMethodProperty = { packageName:"com.example.kikakeyboard", methodId:"ServiceExtAbility", @@ -107,32 +107,32 @@ export default function inputMethodStageJSUnit() { try{ let inputMethodSetting = inputMethod.getSetting(); - console.info("inputMethod_test_listInputMethodSubtype_002 getSetting result:" + inputMethodSetting); + console.info("====>inputMethod_test_listInputMethodSubtype_002 getSetting result:" + inputMethodSetting); inputMethodSetting.listInputMethodSubtype(inputMethodProperty, (err, data) => { if(err){ - console.info("inputMethod_test_listInputMethodSubtype_002 failed" + JSON.stringify(err)); + console.info("====>inputMethod_test_listInputMethodSubtype_002 failed" + JSON.stringify(err)); expect().assertFail(); done() }; - console.info("inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype:" + JSON.stringify(data)); + console.info("====>inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype:" + JSON.stringify(data)); if(data.length >= 1){ let inputMethodSubtype = data[0] - console.info("inputMethod_test_listInputMethodSubtype_002 inputMethodSubtype" + JSON.stringify(inputMethodSubtype)); + console.info("====>inputMethod_test_listInputMethodSubtype_002 inputMethodSubtype" + JSON.stringify(inputMethodSubtype)); expect(inputMethodSubtype.id != null).assertTrue(); expect(inputMethodSubtype.label != null).assertTrue(); done(); }else{ - console.info("inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype length less 1"); + console.info("====>inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype length less 1"); expect().assertFail(); done(); }; }); }catch(error){ - console.info("inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_listInputMethodSubtype_002 listInputMethodSubtype catch error" + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_listInputMethodSubtype_002 end---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_002 end---------------------"); }); /* @@ -141,8 +141,9 @@ export default function inputMethodStageJSUnit() { * @tc.desc Function test * @tc.level 2 */ + it('inputMethod_test_listInputMethodSubtype_003', 0, async function (done) { - console.info("-----------------inputMethod_test_listInputMethodSubtype_003 start---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_003 start---------------------"); let inputMethodProperty = { packageName:"com.example.kikakeyboard", methodId:"ServiceExtAbility", @@ -156,22 +157,22 @@ export default function inputMethodStageJSUnit() { try{ let inputMethodSetting = inputMethod.getSetting(); - console.info("inputMethod_test_listInputMethodSubtype_003 getSetting result:" + inputMethodSetting); + console.info("====>inputMethod_test_listInputMethodSubtype_003 getSetting result:" + inputMethodSetting); inputMethodSetting.listInputMethodSubtype(inputMethodProperty).then((data) => { - console.info("inputMethod_test_listInputMethodSubtype_003 listInputMethodSubtype: " + JSON.stringify(data)); + console.info("====>inputMethod_test_listInputMethodSubtype_003 listInputMethodSubtype: " + JSON.stringify(data)); expect(true).assertTrue(); done(); }).catch(err => { - console.info("inputMethod_test_listInputMethodSubtype_003 failed" + JSON.stringify(err)); + console.info("====>inputMethod_test_listInputMethodSubtype_003 failed" + JSON.stringify(err)); expect().assertFail(); done(); }); }catch(error){ - console.info("inputMethod_test_listInputMethodSubtype_003 listInputMethodSubtype catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_listInputMethodSubtype_003 listInputMethodSubtype catch error" + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_listInputMethodSubtype_003 end---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_003 end---------------------"); }); /* @@ -181,7 +182,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_listInputMethodSubtype_004', 0, async function (done) { - console.info("-----------------inputMethod_test_listInputMethodSubtype_004 start---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_004 start---------------------"); let inputMethodProperty = { packageName:"com.example.kikakeyboard", methodId:"ServiceExtAbility", @@ -195,31 +196,31 @@ export default function inputMethodStageJSUnit() { try{ let inputMethodSetting = inputMethod.getSetting(); - console.info("inputMethod_test_listInputMethodSubtype_004 getSetting result:" + inputMethodSetting); + console.info("====>inputMethod_test_listInputMethodSubtype_004 getSetting result:" + inputMethodSetting); inputMethodSetting.listInputMethodSubtype(inputMethodProperty).then((data) => { - console.info("inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype:" + JSON.stringify(data)); + console.info("====>inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype:" + JSON.stringify(data)); if(data.length >= 1){ let inputMethodSubtype = data[0] - console.info("inputMethod_test_listInputMethodSubtype_004 inputMethodSubtype" + JSON.stringify(inputMethodSubtype)); + console.info("====>inputMethod_test_listInputMethodSubtype_004 inputMethodSubtype" + JSON.stringify(inputMethodSubtype)); expect(inputMethodSubtype.id != null).assertTrue(); expect(inputMethodSubtype.label != null).assertTrue(); done(); }else{ - console.info("inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype length less 1"); + console.info("====>inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype length less 1"); expect().assertFail(); done(); } }).catch(err => { - console.info("inputMethod_test_listInputMethodSubtype_004 failed" + JSON.stringify(err)); + console.info("====>inputMethod_test_listInputMethodSubtype_004 failed" + JSON.stringify(err)); expect().assertFail(); done(); }); }catch(error){ - console.info("inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_listInputMethodSubtype_004 listInputMethodSubtype catch error" + JSON.stringify(error)); expect().assertFail(); done(); } - console.info("-----------------inputMethod_test_listInputMethodSubtype_004 end---------------------"); + console.info("====>-----------------inputMethod_test_listInputMethodSubtype_004 end---------------------"); }); /* @@ -229,26 +230,26 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_listCurrentInputMethodSubtype_001', 0, async function (done) { - console.info("-----------------inputMethod_test_listCurrentInputMethodSubtype_001 start---------------------"); + console.info("====>-----------------inputMethod_test_listCurrentInputMethodSubtype_001 start---------------------"); try{ let inputMethodSetting = inputMethod.getSetting(); - console.info("inputMethod_test_listCurrentInputMethodSubtype_001 getSetting result:" + inputMethodSetting); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_001 getSetting result:" + inputMethodSetting); inputMethodSetting.listCurrentInputMethodSubtype((err, data) => { if(err){ - console.info("inputMethod_test_listCurrentInputMethodSubtype_001 failed" + JSON.stringify(err)); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_001 failed" + JSON.stringify(err)); expect().assertFail(); done(); }; - console.info("inputMethod_test_listCurrentInputMethodSubtype_001 listCurrentInputMethodSubtype: " + JSON.stringify(data)); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_001 listCurrentInputMethodSubtype: " + JSON.stringify(data)); expect(true).assertTrue(); done(); }); }catch(error){ - console.info("inputMethod_test_listCurrentInputMethodSubtype_001 listCurrentInputMethodSubtype catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_001 listCurrentInputMethodSubtype catch error" + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_listCurrentInputMethodSubtype_001 end---------------------"); + console.info("====>-----------------inputMethod_test_listCurrentInputMethodSubtype_001 end---------------------"); }); /* @@ -258,25 +259,25 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_listCurrentInputMethodSubtype_002', 0, async function (done) { - console.info("-----------------inputMethod_test_listCurrentInputMethodSubtype_002 start---------------------"); + console.info("====>-----------------inputMethod_test_listCurrentInputMethodSubtype_002 start---------------------"); try{ let inputMethodSetting = inputMethod.getSetting(); - console.info("inputMethod_test_listCurrentInputMethodSubtype_002 getSetting result:" + inputMethodSetting); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_002 getSetting result:" + inputMethodSetting); inputMethodSetting.listCurrentInputMethodSubtype().then((data) => { - console.info("inputMethod_test_listCurrentInputMethodSubtype_002 listCurrentInputMethodSubtype: " + JSON.stringify(data)); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_002 listCurrentInputMethodSubtype: " + JSON.stringify(data)); expect(true).assertTrue(); done(); }).catch(err => { - console.info("inputMethod_test_listCurrentInputMethodSubtype_002 failed" + JSON.stringify(err)); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_002 failed" + JSON.stringify(err)); expect().assertFail(); done(); }); }catch(error){ - console.info("inputMethod_test_listCurrentInputMethodSubtype_002 listCurrentInputMethodSubtype catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_listCurrentInputMethodSubtype_002 listCurrentInputMethodSubtype catch error" + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_listCurrentInputMethodSubtype_002 end---------------------"); + console.info("====>-----------------inputMethod_test_listCurrentInputMethodSubtype_002 end---------------------"); }); /* @@ -286,22 +287,22 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_getCurrentInputMethodSubtype_001', 0, async function (done) { - console.info("-----------------inputMethod_test_getCurrentInputMethodSubtype_001 start---------------------"); + console.info("====>-----------------inputMethod_test_getCurrentInputMethodSubtype_001 start---------------------"); try{ let inputMethodSubtype = inputMethod.getCurrentInputMethodSubtype(); - console.info("inputMethod_test_getCurrentInputMethodSubtype_001 result:" + typeof inputMethodSubtype); + console.info("====>inputMethod_test_getCurrentInputMethodSubtype_001 result:" + typeof inputMethodSubtype); if(typeof inputMethodSubtype == "object" ){ - console.info("inputMethod_test_getCurrentInputMethodSubtype_001 getCurrentInputMethodSubtype success"); + console.info("====>inputMethod_test_getCurrentInputMethodSubtype_001 getCurrentInputMethodSubtype success"); expect(true).assertTrue(); }else{ - console.info("inputMethod_test_getCurrentInputMethodSubtype_001 getCurrentInputMethodSubtype failed"); + console.info("====>inputMethod_test_getCurrentInputMethodSubtype_001 getCurrentInputMethodSubtype failed"); expect().assertFail(); }; }catch(error){ - console.info("inputMethod_test_getCurrentInputMethodSubtype_001 getCurrentInputMethodSubtype error" + JSON.stringify(error)); + console.info("====>inputMethod_test_getCurrentInputMethodSubtype_001 getCurrentInputMethodSubtype error" + JSON.stringify(error)); expect().assertFail(); } - console.info("-----------------inputMethod_test_getCurrentInputMethodSubtype_001 end---------------------"); + console.info("====>-----------------inputMethod_test_getCurrentInputMethodSubtype_001 end---------------------"); done(); }); @@ -312,7 +313,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_switchCurrentInputMethodAndSubtype_001', 0, async function (done) { - console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_001 Test start*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodAndSubtype_001 Test start*************"); let inputMethodProperty = { packageName: "com.example.kikakeyboard", methodId: "ServiceExtAbility", @@ -338,7 +339,7 @@ export default function inputMethodStageJSUnit() { expect( err.code == 12800008 ).assertTrue(); done(); } - console.info("inputMethod_test_switchCurrentInputMethodAndSubtype_001 data: " + JSON.stringify(data)); + console.info("====>inputMethod_test_switchCurrentInputMethodAndSubtype_001 data: " + JSON.stringify(data)); expect(data != null).assertTrue(); done(); }); @@ -347,7 +348,7 @@ export default function inputMethodStageJSUnit() { expect().assertFail(); done(); }; - console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_001 Test end*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodAndSubtype_001 Test end*************"); }); /* @@ -357,7 +358,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_switchCurrentInputMethodAndSubtype_002', 0, async function (done) { - console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_002 Test start*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodAndSubtype_002 Test start*************"); let inputMethodProperty = { packageName: "com.example.kikakeyboard", methodId: "ServiceExtAbility", @@ -378,7 +379,7 @@ export default function inputMethodStageJSUnit() { }; try { inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, inputMethodSubProperty).then((data) => { - console.info("inputMethod_test_switchCurrentInputMethodAndSubtype_002 data: " + JSON.stringify(data)); + console.info("====>inputMethod_test_switchCurrentInputMethodAndSubtype_002 data: " + JSON.stringify(data)); expect(data != null).assertTrue(); done(); }).catch(err => { @@ -391,7 +392,7 @@ export default function inputMethodStageJSUnit() { expect().assertFail(); done(); }; - console.info("************* inputMethod_test_switchCurrentInputMethodAndSubtype_002 Test end*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodAndSubtype_002 Test end*************"); }); /* @@ -401,7 +402,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_switchCurrentInputMethodSubtype_001', 0, async function (done) { - console.info("************* inputMethod_test_switchCurrentInputMethodSubtype_001 Test start*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodSubtype_001 Test start*************"); let inputMethodSubProperty : subtype = { id: "com.example.kikakeyboard", label: "ServiceExtAbility", @@ -420,7 +421,7 @@ export default function inputMethodStageJSUnit() { expect().assertFail(); done(); }; - console.info("inputMethod_test_switchCurrentInputMethodSubtype_001 data: " + JSON.stringify(data)); + console.info("====>inputMethod_test_switchCurrentInputMethodSubtype_001 data: " + JSON.stringify(data)); expect(data != null).assertTrue(); done(); }); @@ -429,7 +430,7 @@ export default function inputMethodStageJSUnit() { expect().assertFail(); done(); }; - console.info("************* inputMethod_test_switchCurrentInputMethodSubtype_001 Test end*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodSubtype_001 Test end*************"); }); /* @@ -439,7 +440,7 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_switchCurrentInputMethodSubtype_002', 0, async function (done) { - console.info("************* inputMethod_test_switchCurrentInputMethodSubtype_002 Test start*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodSubtype_002 Test start*************"); let inputMethodSubProperty : subtype = { id: "com.example.kikakeyboard", label: "ServiceExtAbility", @@ -453,7 +454,7 @@ export default function inputMethodStageJSUnit() { }; try { inputMethod.switchCurrentInputMethodSubtype(inputMethodSubProperty).then((data) => { - console.info("inputMethod_test_switchCurrentInputMethodSubtype_002 data: " + JSON.stringify(data)); + console.info("====>inputMethod_test_switchCurrentInputMethodSubtype_002 data: " + JSON.stringify(data)); expect(data != null).assertTrue(); done(); }).catch(err => { @@ -466,7 +467,7 @@ export default function inputMethodStageJSUnit() { expect().assertFail(); done(); }; - console.info("************* inputMethod_test_switchCurrentInputMethodSubtype_002 Test end*************"); + console.info("====>************* inputMethod_test_switchCurrentInputMethodSubtype_002 Test end*************"); done(); }); @@ -477,28 +478,28 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_showOptionalInputMethods_001', 0, async function (done) { - console.info("-----------------inputMethod_test_showOptionalInputMethods_001 start---------------------"); + console.info("====>-----------------inputMethod_test_showOptionalInputMethods_001 start---------------------"); let inputMethodSetting = inputMethod.getSetting(); try{ - console.info("inputMethod_test_showOptionalInputMethods_001 result:" + inputMethodSetting); + console.info("====>inputMethod_test_showOptionalInputMethods_001 result:" + inputMethodSetting); inputMethodSetting.showOptionalInputMethods((err, data) => { if(err){ - console.info("inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods faild: " + JSON.stringify(err)); + console.info("====>inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods faild: " + JSON.stringify(err)); expect().assertFail(); done(); }; - console.info("inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods success data is : " + data); + console.info("====>inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods success data is : " + data); expect(true).assertTrue(); setTimeout(() => { done(); }, 1000); }); }catch(error){ - console.info("inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods catch error: " + JSON.stringify(error)); + console.info("====>inputMethod_test_showOptionalInputMethods_001 showOptionalInputMethods catch error: " + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_showOptionalInputMethods_001 end---------------------"); + console.info("====>-----------------inputMethod_test_showOptionalInputMethods_001 end---------------------"); }); /* @@ -508,25 +509,25 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_showOptionalInputMethods_002', 0, async function (done) { - console.info("-----------------inputMethod_test_showOptionalInputMethods_002 start---------------------"); + console.info("====>-----------------inputMethod_test_showOptionalInputMethods_002 start---------------------"); let inputMethodSetting = inputMethod.getSetting(); try { - console.info("inputMethod_test_showOptionalInputMethods_002 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputMethod_test_showOptionalInputMethods_002 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.showOptionalInputMethods().then((data) => { - console.info("inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods success data is: " + JSON.stringify(data)); + console.info("====>inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods success data is: " + JSON.stringify(data)); expect(true).assertTrue(); done(); }).catch(err => { - console.info("inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods faild: " + JSON.stringify(err)); + console.info("====>inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods faild: " + JSON.stringify(err)); expect().assertFail(); done(); }); } catch (error) { - console.info("inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods catch error: " + JSON.stringify(error)); + console.info("====>inputMethod_test_showOptionalInputMethods_002 showOptionalInputMethods catch error: " + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_showOptionalInputMethods_002 end---------------------"); + console.info("====>-----------------inputMethod_test_showOptionalInputMethods_002 end---------------------"); }); /* @@ -536,25 +537,24 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_stopInputSession_002', 0, async function (done) { - console.info("-----------------inputMethod_test_stopInputSession_002 start---------------------"); + console.info("====>-----------------inputMethod_test_stopInputSession_002 start---------------------"); try{ let inputMethodCtrl = inputMethod.getController(); - console.info("inputMethod_test_stopInputSession_002 result:" + typeof inputMethodCtrl); + console.info("====>inputMethod_test_stopInputSession_002 result:" + typeof inputMethodCtrl); inputMethodCtrl.stopInputSession().then((data) => { - console.info("inputMethod_test_stopInputSession_002 stopInputSession data: " + data); - expect(data == true).assertTrue(); - done(); - }).catch(err => { - console.info("inputMethod_test_stopInputSession_002 faild: " + JSON.stringify(err)); expect().assertFail(); done(); - }); + }).catch((err) => { + console.debug("inputMethod_test_stopInputSession_002 faild: " + JSON.stringify(err)); + expect(err.code).assertEqual('12800003') + done(); + }) }catch(error){ - console.info("inputMethod_test_stopInputSession_002 catch error" + JSON.stringify(error)); + console.info("====>inputMethod_test_stopInputSession_002 catch error" + JSON.stringify(error)); expect().assertFail(); done(); }; - console.info("-----------------inputMethod_test_stopInputSession_002 end---------------------"); + console.info("====>-----------------inputMethod_test_stopInputSession_002 end---------------------"); }); /* @@ -564,26 +564,24 @@ export default function inputMethodStageJSUnit() { * @tc.level 2 */ it('inputMethod_test_stopInputSession_001', 0, async function (done) { - console.info("-----------------inputMethod_test_stopInputSession_001 start---------------------"); + console.info("====>-----------------inputMethod_test_stopInputSession_001 start---------------------"); + let inputMethodCtrl = inputMethod.getController(); + console.debug("inputMethod_test_stopInputSession_001 result: " + typeof inputMethodCtrl); try{ - let inputMethodCtrl = inputMethod.getController(); - console.info("inputMethod_test_stopInputSession_001 result: " + typeof inputMethodCtrl); - inputMethodCtrl.stopInputSession((err, data) => { - if(err){ - console.info("inputMethod_test_stopInputSession_001 faild: " + JSON.stringify(err)); - expect().assertFail(); - done(); - }; - console.info("inputMethod_test_stopInputSession_001 stopInputSession data: " + data); - expect(data == true).assertTrue(); + inputMethodCtrl.stopInputSession((err)=>{ + if(err){ + console.info("====>inputMethod_test_stopInputSession_001 faild: " + JSON.stringify(err)); + expect(err.code).assertEqual('12800003'); + done(); + }else{ + expect().assertFail(); + done(); + } + }) + }catch(err){ + expect().assertFail(); done(); - }); - }catch(error){ - console.info("inputMethod_test_stopInputSession_001 catch error" + JSON.stringify(error)); - expect().assertFail(); - done(); - }; - console.info("-----------------inputMethod_test_stopInputSession_001 end---------------------"); + } }); /* @@ -594,7 +592,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_PERMISSION_001', 0, async function (done) { let keyType = inputMethod.EXCEPTION_PERMISSION; - console.info("inputMethod_test_EXCEPTION_PERMISSION_001 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_PERMISSION_001 result:" + keyType); expect(keyType).assertEqual(201); done(); }); @@ -607,7 +605,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_PARAMCHECK_002', 0, async function (done) { let keyType = inputMethod.EXCEPTION_PARAMCHECK; - console.info("inputMethod_test_EXCEPTION_PARAMCHECK_002 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_PARAMCHECK_002 result:" + keyType); expect(keyType).assertEqual(401); done(); }); @@ -620,7 +618,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_UNSUPPORTED_003', 0, async function (done) { let keyType = inputMethod.EXCEPTION_UNSUPPORTED; - console.info("inputMethod_test_EXCEPTION_UNSUPPORTED_003 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_UNSUPPORTED_003 result:" + keyType); expect(keyType).assertEqual(801); done(); }); @@ -633,7 +631,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_PACKAGEMANAGER_004', 0, async function (done) { let keyType = inputMethod.EXCEPTION_PACKAGEMANAGER; - console.info("inputMethod_test_EXCEPTION_PACKAGEMANAGER_004 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_PACKAGEMANAGER_004 result:" + keyType); expect(keyType).assertEqual(12800001); done(); }); @@ -646,7 +644,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_IMENGINE_005', 0, async function (done) { let keyType = inputMethod.EXCEPTION_IMENGINE; - console.info("inputMethod_test_EXCEPTION_IMENGINE_005 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_IMENGINE_005 result:" + keyType); expect(keyType).assertEqual(12800002); done(); }); @@ -659,7 +657,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_IMCLIENT_006', 0, async function (done) { let keyType = inputMethod.EXCEPTION_IMCLIENT; - console.info("inputMethod_test_EXCEPTION_IMCLIENT_006 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_IMCLIENT_006 result:" + keyType); expect(keyType).assertEqual(12800003); done(); }); @@ -672,7 +670,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_KEYEVENT_007', 0, async function (done) { let keyType = inputMethod.EXCEPTION_KEYEVENT; - console.info("inputMethod_test_EXCEPTION_KEYEVENT_007 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_KEYEVENT_007 result:" + keyType); expect(keyType).assertEqual(12800004); done(); }); @@ -685,7 +683,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_CONFPERSIST_008', 0, async function (done) { let keyType = inputMethod.EXCEPTION_CONFPERSIST; - console.info("inputMethod_test_EXCEPTION_CONFPERSIST_008 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_CONFPERSIST_008 result:" + keyType); expect(keyType).assertEqual(12800005); done(); }); @@ -698,7 +696,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_CONTROLLER_009', 0, async function (done) { let keyType = inputMethod.EXCEPTION_CONTROLLER; - console.info("inputMethod_test_EXCEPTION_CONTROLLER_009 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_CONTROLLER_009 result:" + keyType); expect(keyType).assertEqual(12800006); done(); }); @@ -711,7 +709,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_SETTINGS_010', 0, async function (done) { let keyType = inputMethod.EXCEPTION_SETTINGS; - console.info("inputMethod_test_EXCEPTION_SETTINGS_010 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_SETTINGS_010 result:" + keyType); expect(keyType).assertEqual(12800007); done(); }); @@ -724,7 +722,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_IMMS_011', 0, async function (done) { let keyType = inputMethod.EXCEPTION_IMMS; - console.info("inputMethod_test_EXCEPTION_IMMS_011 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_IMMS_011 result:" + keyType); expect(keyType).assertEqual(12800008); done(); }); @@ -737,7 +735,7 @@ export default function inputMethodStageJSUnit() { */ it('inputMethod_test_EXCEPTION_OTHERS_012', 0, async function (done) { let keyType = inputMethod.EXCEPTION_OTHERS; - console.info("inputMethod_test_EXCEPTION_OTHERS_012 result:" + keyType); + console.info("====>inputMethod_test_EXCEPTION_OTHERS_012 result:" + keyType); expect(keyType).assertEqual(12899999); done(); }); diff --git a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/Utils.ets b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/Utils.ets index b778f82cd5e117995895687c82220083942c6728..4d27274069336154724453066b05559e3bbb3ea1 100644 --- a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/Utils.ets +++ b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/Utils.ets @@ -34,9 +34,9 @@ export default class Utils { static getComponentRect(key) { let strJson = getInspectorByKey(key); let obj = JSON.parse(strJson); - console.info("[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); + console.info("====>[getInspectorByKey] current component obj is: " + JSON.stringify(obj)); let rectInfo = JSON.parse('[' + obj.$rect + ']') - console.info("[getInspectorByKey] rectInfo is: " + rectInfo); + console.info("====>[getInspectorByKey] rectInfo is: " + rectInfo); this.rect_left = JSON.parse('[' + rectInfo[0] + ']')[0] this.rect_top = JSON.parse('[' + rectInfo[0] + ']')[1] this.rect_right = JSON.parse('[' + rectInfo[1] + ']')[0] @@ -47,12 +47,12 @@ export default class Utils { } static async swipe(downX, downY, upX, upY, steps) { - console.info('start to swipe') + console.info('====>start to swipe') this.drags(downX, downY, upX, upY, steps, false) } static async drag(downX, downY, upX, upY, steps) { - console.info('start to drag') + console.info('====>start to drag') this.drags(downX, downY, upX, upY, steps, true) } @@ -70,16 +70,16 @@ export default class Utils { } xStep = (upX - downX) / swipeSteps; yStep = (upY - downY) / swipeSteps; - console.info('move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) + console.info('====>move step is: ' + 'xStep: ' + xStep + ' yStep: ' + yStep) let downPonit: TouchObject = { id: 1, x: downX, y: downY, type: TouchType.Down, } - console.info('down touch started: ' + JSON.stringify(downPonit)) + console.info('====>down touch started: ' + JSON.stringify(downPonit)) sendTouchEvent(downPonit); - console.info('start to move') + console.info('====>start to move') if (drag) { await this.sleep(500) } @@ -90,14 +90,14 @@ export default class Utils { y: downY + (yStep * i), type: TouchType.Move } - console.info('move touch started: ' + JSON.stringify(movePoint)) + console.info('====>move touch started: ' + JSON.stringify(movePoint)) ret = sendTouchEvent(movePoint) if (ret == false) { break; } await this.sleep(5) } - console.info('start to up') + console.info('====>start to up') if (drag) { await this.sleep(100) } @@ -107,7 +107,7 @@ export default class Utils { y: upY, type: TouchType.Up, } - console.info('up touch started: ' + JSON.stringify(upPoint)) + console.info('====>up touch started: ' + JSON.stringify(upPoint)) sendTouchEvent(upPoint) await this.sleep(500) } diff --git a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets index bc05859a4fb8c5ef31619597220558eea2e127cd..2847cf0bca46d7b1c2f6f4ad3cebb0f9eb794c41 100644 --- a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets +++ b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodEngineJSUnit.ets @@ -26,7 +26,7 @@ export default function inputMethodEngineJSUnit() { let kbController = null; let KeyboardDelegate = null; - console.info("************* inputMethodEngine Test start*************"); + console.info("====>************* inputMethodEngine Test start*************"); beforeEach(async function (done) { let options = { uri: 'pages/input', @@ -45,279 +45,279 @@ export default function inputMethodEngineJSUnit() { }); afterEach(async function () { - console.info("inputMethodEngine afterEach start:" + inputMethodEngineObject); + console.info("====>inputMethodEngine afterEach start:" + inputMethodEngineObject); await Utils.sleep(1000); }); it('inputMethodEngine_testOff_000', 0 , async function (done) { inputMethodEngineObject.off('inputStart', (kbController, textInputClient) => { - console.info("inputMethodEngine beforeEach inputStart:" + JSON.stringify(kbController)); - console.info("inputMethodEngine beforeEach inputStart:" + JSON.stringify(textInputClient)); + console.info("====>inputMethodEngine beforeEach inputStart:" + JSON.stringify(kbController)); + console.info("====>inputMethodEngine beforeEach inputStart:" + JSON.stringify(textInputClient)); }); inputMethodEngineObject.off('keyboardShow', () => { - console.info("inputMethodEngine beforeEach keyboardShow:"); + console.info("====>inputMethodEngine beforeEach keyboardShow:"); }); inputMethodEngineObject.off('keyboardHide', () => { - console.info("inputMethodEngine beforeEach keyboardHide:"); + console.info("====>inputMethodEngine beforeEach keyboardHide:"); }); KeyboardDelegate = inputMethodEngine.createKeyboardDelegate(); KeyboardDelegate.off('keyDown', (keyEvent) => { - console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyCode); + console.info("====>inputMethodEngine beforeEach keyDown:" + keyEvent.keyCode); expect(keyEvent.keyCode).assertEqual('1'); - console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); + console.info("====>inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); expect(keyEvent.keyAction).assertEqual('1'); }); KeyboardDelegate.off('keyUp', (keyEvent) => { - console.info("inputMethodEngine beforeEach keyUp:" + keyEvent.keyCode); + console.info("====>inputMethodEngine beforeEach keyUp:" + keyEvent.keyCode); expect(keyEvent.keyCode).assertEqual('1'); - console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); + console.info("====>inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); expect(keyEvent.keyAction).assertEqual('0'); }); KeyboardDelegate.off('cursorContextChange', (x, y, height) => { - console.info("inputMethodEngine beforeEach cursorContextChange x:" + x); - console.info("inputMethodEngine beforeEach cursorContextChange y:" + y); - console.info("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); }); KeyboardDelegate.off('selectionChange', (oldBegin, oldEnd, newBegin, 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); + 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); }); KeyboardDelegate.off('textChange', (text) => { - console.info("inputMethodEngine beforeEach textChange:" + text); + console.info("====>inputMethodEngine beforeEach textChange:" + text); }); done(); }); it('inputMethodEngine_test_000', 0, async function (done) { inputMethodEngineObject.on('inputStart', (kbController, textInputClient) => { - console.info("inputMethodEngine beforeEach inputStart:" + JSON.stringify(kbController)); - console.info("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', () => { - console.info("inputMethodEngine beforeEach keyboardShow:"); + console.info("====>inputMethodEngine beforeEach keyboardShow:"); }); inputMethodEngineObject.on('keyboardHide', () => { - console.info("inputMethodEngine beforeEach keyboardHide:"); + console.info("====>inputMethodEngine beforeEach keyboardHide:"); }); mKeyboardDelegate = inputMethodEngine.createKeyboardDelegate(); mKeyboardDelegate.on('keyDown', (keyEvent) => { - console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyCode); + console.info("====>inputMethodEngine beforeEach keyDown:" + keyEvent.keyCode); expect(keyEvent.keyCode).assertEqual('1'); - console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); + console.info("====>inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); expect(keyEvent.keyAction).assertEqual('1'); }); mKeyboardDelegate.on('keyUp', (keyEvent) => { - console.info("inputMethodEngine beforeEach keyUp:" + keyEvent.keyCode); + console.info("====>inputMethodEngine beforeEach keyUp:" + keyEvent.keyCode); expect(keyEvent.keyCode).assertEqual('1'); - console.info("inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); + console.info("====>inputMethodEngine beforeEach keyDown:" + keyEvent.keyAction); expect(keyEvent.keyAction).assertEqual('0'); }); mKeyboardDelegate.on('cursorContextChange', (x, y, height) => { - console.info("inputMethodEngine beforeEach cursorContextChange x:" + x); - console.info("inputMethodEngine beforeEach cursorContextChange y:" + y); - console.info("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.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); + 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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("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.info("inputMethodEngine_test_026 result:" + keyType); + console.info("====>inputMethodEngine_test_026 result:" + keyType); expect(keyType).assertEqual(10); done(); }); @@ -325,12 +325,12 @@ export default function inputMethodEngineJSUnit() { it('inputMethodEngine_test_027', 0, async function (done) { let rect = await Utils.getComponentRect('TextInput') - console.info("[inputMethodEngine_test_027] rectInfo is " + rect); - console.info("[inputMethodEngine_test_027] rectInfo is " + JSON.stringify(rect)); + console.info("====>[inputMethodEngine_test_027] rectInfo is " + rect); + console.info("====>[inputMethodEngine_test_027] rectInfo is " + JSON.stringify(rect)); let x_value = rect.left + (rect.right - rect.left) / 10 let y_value = rect.top + (rect.bottom - rect.top) / 10 - console.info("[inputMethodEngine_test_027] onTouch location is: " + "[x]=== " + x_value + " [y]===" + y_value); + console.info("====>[inputMethodEngine_test_027] onTouch location is: " + "[x]=== " + x_value + " [y]===" + y_value); let point: TouchObject = { id: 1, x: x_value, @@ -339,9 +339,9 @@ export default function inputMethodEngineJSUnit() { screenX: rect.left + (rect.right - rect.left) / 10, screenY: rect.left + (rect.right - rect.left) / 10, } - console.info('[inputMethodEngine_test_027] testSendTouchEvent ' + sendTouchEvent(point)); + console.info('====>[inputMethodEngine_test_027] testSendTouchEvent ' + sendTouchEvent(point)); await Utils.sleep(1000) - console.info('[inputMethodEngine_test_027] END'); + console.info('====>[inputMethodEngine_test_027] END'); done(); }); @@ -350,7 +350,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.sendKeyFunction(0, (value) => { - console.info("inputMethodEngine_test_028 textInputClient sendKeyFunction:" + value); + console.info("====>inputMethodEngine_test_028 textInputClient sendKeyFunction:" + value); expect(value).assertEqual(true); }); } @@ -363,10 +363,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.sendKeyFunction(0); promise.then(res => { - console.info("inputMethodEngine_test_029 listInputMethod promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_029 listInputMethod promise result-----" + JSON.stringify(res)); expect(res).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_029 listInputMethod promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_029 listInputMethod promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -378,7 +378,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.deleteForward(1, (value) => { - console.info("inputMethodEngine_test_030 deleteForward:" + value); + console.info("====>inputMethodEngine_test_030 deleteForward:" + value); expect(value).assertEqual(true); }); } @@ -391,10 +391,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.deleteForward(1); promise.then(res => { - console.info("inputMethodEngine_test_031 deleteForward promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_031 deleteForward promise result-----" + JSON.stringify(res)); expect(res).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_031 deleteForward promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_031 deleteForward promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -406,7 +406,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.deleteBackward(1, (value) => { - console.info("inputMethodEngine_test_032 deleteBackward:" + value); + console.info("====>inputMethodEngine_test_032 deleteBackward:" + value); expect(value).assertEqual(true); }); } @@ -419,10 +419,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.deleteBackward(1); promise.then(res => { - console.info("inputMethodEngine_test_033 deleteBackward promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_033 deleteBackward promise result-----" + JSON.stringify(res)); expect(res).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_033 deleteBackward promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_033 deleteBackward promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -434,7 +434,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.InsertText('test', (value) => { - console.info("inputMethodEngine_test_034 InsertText:" + value); + console.info("====>inputMethodEngine_test_034 InsertText:" + value); expect(value).assertEqual(true); }); } @@ -447,10 +447,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.InsertText('test'); promise.then(res => { - console.info("inputMethodEngine_test_035 InsertText promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_035 InsertText promise result-----" + JSON.stringify(res)); expect(res).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_035 InsertText promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_035 InsertText promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -462,7 +462,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.getForward(1, (value) => { - console.info("inputMethodEngine_test_036 getForward:" + value); + console.info("====>inputMethodEngine_test_036 getForward:" + value); expect(value).assertEqual(true); }); } @@ -475,10 +475,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.getForward(1); promise.then(res => { - console.info("inputMethodEngine_test_037 getForward promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_037 getForward promise result-----" + JSON.stringify(res)); expect(res).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_037 getForward promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_037 getForward promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -490,7 +490,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.getEditorAttribute(1, (editorAttribute) => { - console.info("inputMethodEngine_test_038 getEditorAttribute:" + editorAttribute); + console.info("====>inputMethodEngine_test_038 getEditorAttribute:" + editorAttribute); expect(editorAttribute.inputPattern).assertEqual(1); expect(editorAttribute.enterKeyType).assertEqual(1); }); @@ -504,11 +504,11 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.getEditorAttribute(); promise.then(res => { - console.info("inputMethodEngine_test_039 getEditorAttribute promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_039 getEditorAttribute promise result-----" + JSON.stringify(res)); expect(res.inputPattern).assertEqual(1); expect(res.enterKeyType).assertEqual(1); }).catch(err => { - console.info("inputMethodEngine_test_039 getEditorAttribute promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_039 getEditorAttribute promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -520,7 +520,7 @@ export default function inputMethodEngineJSUnit() { expect(kbController == null).assertEqual(true); } else { kbController.hideKeyboard(() => { - console.info("inputMethodEngine_test_040 hideKeyboard"); + console.info("====>inputMethodEngine_test_040 hideKeyboard"); expect(1 == 1).assertTrue(); }); } @@ -533,10 +533,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = kbController.hideKeyboard(); promise.then(res => { - console.info("inputMethodEngine_test_041 hideKeyboard promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_041 hideKeyboard promise result-----" + JSON.stringify(res)); expect(1 == 1).assertTrue(); }).catch(err => { - console.info("inputMethodEngine_test_041 hideKeyboard promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_041 hideKeyboard promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -548,7 +548,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.getBackward(1, (value) => { - console.info("inputMethodEngine_test_042 getBackward:" + value); + console.info("====>inputMethodEngine_test_042 getBackward:" + value); expect(value).assertEqual(true); }); } @@ -561,10 +561,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = textInputClient.getBackward(1); promise.then(res => { - console.info("inputMethodEngine_test_043 getBackward promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_043 getBackward promise result-----" + JSON.stringify(res)); expect(res).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_043 getBackward promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_043 getBackward promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -583,7 +583,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.moveCursor(inputMethodEngine.CURSOR_UP, (value) => { - console.info("inputMethodEngine_test_045 moveCursor:" + value); + console.info("====>inputMethodEngine_test_045 moveCursor:" + value); expect(value == null).assertEqual(true); }); } @@ -595,7 +595,7 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.moveCursor(inputMethodEngine.CURSOR_DOWN, (value) => { - console.info("inputMethodEngine_test_046 moveCursor:" + value); + console.info("====>inputMethodEngine_test_046 moveCursor:" + value); expect(value == null).assertEqual(true); }); } @@ -607,10 +607,10 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.moveCursor(inputMethodEngine.CURSOR_LEFT).then(res => { - console.info("inputMethodEngine_test_047 moveCursor promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_047 moveCursor promise result-----" + JSON.stringify(res)); expect(res == null).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_047 moveCursor promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_047 moveCursor promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -622,10 +622,10 @@ export default function inputMethodEngineJSUnit() { expect(textInputClient == null).assertEqual(true); } else { textInputClient.moveCursor(inputMethodEngine.CURSOR_RIGHT).then(res => { - console.info("inputMethodEngine_test_048 moveCursor promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_048 moveCursor promise result-----" + JSON.stringify(res)); expect(res == null).assertEqual(true); }).catch(err => { - console.info("inputMethodEngine_test_048 moveCursor promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_048 moveCursor promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -637,7 +637,7 @@ export default function inputMethodEngineJSUnit() { expect(kbController == null).assertEqual(true); } else { kbController.hide(() => { - console.info("inputMethodEngine_test_049 hideKeyboard:"); + console.info("====>inputMethodEngine_test_049 hideKeyboard:"); expect(1 == 1).assertTrue(); }); } @@ -650,10 +650,10 @@ export default function inputMethodEngineJSUnit() { } else { let promise = kbController.hide(); promise.then(res => { - console.info("inputMethodEngine_test_050 hideKeyboard promise result-----" + JSON.stringify(res)); + console.info("====>inputMethodEngine_test_050 hideKeyboard promise result-----" + JSON.stringify(res)); expect(1 == 1).assertTrue(); }).catch(err => { - console.info("inputMethodEngine_test_050 hideKeyboard promise error----" + JSON.stringify(err)); + console.info("====>inputMethodEngine_test_050 hideKeyboard promise error----" + JSON.stringify(err)); expect().assertFail(); }); } @@ -667,22 +667,22 @@ export default function inputMethodEngineJSUnit() { * @tc.level 2 */ it('inputMethodEngine_test_getInputMethodAbility_001', 0, async function (done) { - console.info("-----------------inputMethodEngine_test_getInputMethodAbility_001 start---------------------"); + console.info("====>-----------------inputMethodEngine_test_getInputMethodAbility_001 start---------------------"); try{ let inputMethodAbility = inputMethodEngine.getInputMethodAbility(); - console.info("inputMethodEngine_test_getInputMethodAbility_001 result:" + typeof inputMethodAbility); + console.info("====>inputMethodEngine_test_getInputMethodAbility_001 result:" + typeof inputMethodAbility); if(typeof inputMethodAbility == "object" ){ - console.info("inputMethodEngine_test_getInputMethodAbility_001 getCurrentInputMethodSubtype success"); + console.info("====>inputMethodEngine_test_getInputMethodAbility_001 getCurrentInputMethodSubtype success"); expect(true).assertTrue(); }else{ - console.info("inputMethodEngine_test_getInputMethodAbility_001 getCurrentInputMethodSubtype failed"); + console.info("====>inputMethodEngine_test_getInputMethodAbility_001 getCurrentInputMethodSubtype failed"); expect().assertFail(); }; }catch(error){ - console.info("inputMethodEngine_test_getInputMethodAbility_001 getCurrentInputMethodSubtype error" + JSON.stringify(error)); + console.info("====>inputMethodEngine_test_getInputMethodAbility_001 getCurrentInputMethodSubtype error" + JSON.stringify(error)); expect().assertFail(); } - console.info("-----------------inputMethodEngine_test_getInputMethodAbility_001 end---------------------"); + console.info("====>-----------------inputMethodEngine_test_getInputMethodAbility_001 end---------------------"); done(); }); @@ -693,22 +693,22 @@ export default function inputMethodEngineJSUnit() { * @tc.level 2 */ it('inputMethodEngine_test_getKeyboardDelegate_001', 0, async function (done) { - console.info("-----------------inputMethodEngine_test_getKeyboardDelegate_001 start---------------------"); + console.info("====>-----------------inputMethodEngine_test_getKeyboardDelegate_001 start---------------------"); try{ let inputMethodAbility = inputMethodEngine.getKeyboardDelegate(); - console.info("inputMethodEngine_test_getKeyboardDelegate_001 result:" + typeof inputMethodAbility); + console.info("====>inputMethodEngine_test_getKeyboardDelegate_001 result:" + typeof inputMethodAbility); if(typeof inputMethodAbility == "object" ){ - console.info("inputMethodEngine_test_getKeyboardDelegate_001 getCurrentInputMethodSubtype success"); + console.info("====>inputMethodEngine_test_getKeyboardDelegate_001 getCurrentInputMethodSubtype success"); expect(true).assertTrue(); }else{ - console.info("inputMethodEngine_test_getKeyboardDelegate_001 getCurrentInputMethodSubtype failed"); + console.info("====>inputMethodEngine_test_getKeyboardDelegate_001 getCurrentInputMethodSubtype failed"); expect().assertFail(); }; }catch(error){ - console.info("inputMethodEngine_test_getKeyboardDelegate_001 getCurrentInputMethodSubtype error" + JSON.stringify(error)); + console.info("====>inputMethodEngine_test_getKeyboardDelegate_001 getCurrentInputMethodSubtype error" + JSON.stringify(error)); expect().assertFail(); } - console.info("-----------------inputMethodEngine_test_getKeyboardDelegate_001 end---------------------"); + console.info("====>-----------------inputMethodEngine_test_getKeyboardDelegate_001 end---------------------"); done(); }); diff --git a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets index 8660b7290ab01da6ecf6a2b4e69aa030518135af..9322d71418117f9e30e8b25abf38937d4df455fe 100644 --- a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets +++ b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets @@ -17,12 +17,12 @@ import inputMethod from '@ohos.inputmethod'; export default function inputMethodJSUnit() { describe('appInfoTest_input_2', function () { - console.info("************* settings Test start*************"); + console.info("====>************* settings Test start*************"); it('inputmethoh_test_001', 0, async function (done) { let inputMethodSetting = inputMethod.getInputMethodSetting(); - console.info("inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputmethoh_test_001 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.listInputMethod((arr) => { - console.info("appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr)); + console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr)); expect(1==1).assertTrue(); }); done(); @@ -30,40 +30,40 @@ export default function inputMethodJSUnit() { it('inputmethoh_test_002', 0, async function (done) { let inputMethodSetting = inputMethod.getInputMethodSetting(); - console.info("inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputmethoh_test_002 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.listInputMethod().then(inputMethodProperty => { if (inputMethodProperty.length > 0){ let obj = inputMethodProperty[0] - console.info("inputmethoh_test_002 listInputMethod obj---" + JSON.stringify(obj)); + 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"); + console.info("====>inputmethoh_test_002 listInputMethod is null"); expect().assertFail() } }).catch(err => { - console.info("inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err)); + console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err)); }); done(); }); it('inputmethoh_test_003', 0, async function (done) { let inputMethodSetting = inputMethod.getInputMethodSetting(); - console.info("inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.displayOptionalInputMethod(() => { - console.info("inputmethoh_test_003 displayOptionalInputMethod---"); + console.info("====>inputmethoh_test_003 displayOptionalInputMethod---"); }); done(); }); it('inputmethoh_test_004', 0, async function (done) { let inputMethodSetting = inputMethod.getInputMethodSetting(); - console.info("inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.displayOptionalInputMethod().then(() => { - console.info("inputmethoh_test_004 displayOptionalInputMethod is called"); + console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called"); expect(true).assertTrue() }).catch(err => { - console.info("inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err)); + console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err)); expect().assertFail() }); done(); @@ -71,24 +71,24 @@ export default function inputMethodJSUnit() { it('inputmethoh_test_005', 0, async function (done) { let inputMethodCtrl = inputMethod.getInputMethodController(); - console.info("inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl)); + console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl)); inputMethodCtrl.stopInput((res) => { - console.info("inputmethoh_test_005 stopInput result----" + res); + console.info("====>inputmethoh_test_005 stopInput result----" + res); }); done(); }); it('inputmethoh_test_006', 0, async function (done) { let inputMethodCtrl = inputMethod.getInputMethodController(); - console.info("inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl)); - inputMethodCtrl.stopInput().then(data => { - console.info("inputmethoh_test_006 stopInput result----" + data); - expect(data == true).assertTrue(); - }).catch(err => { - console.info("inputmethoh_test_006 stopInput is err: " + JSON.stringify(err)); + console.info("====>inputmethoh_test_006 result:" + JSON.stringify(inputMethodCtrl)); + inputMethodCtrl.stopInput().then(() => { expect().assertFail(); + done(); + }).catch((err) => { + console.info("====>inputmethoh_test_006 stopInput is err: " + JSON.stringify(err)); + expect().assertEqual(); + done(); }); - done(); }); /* @@ -97,11 +97,11 @@ export default function inputMethodJSUnit() { * @tc.desc: Verify Max_ TYPE_ NUM */ it('inputmethod_test_MAX_TYPE_NUM_001', 0, async function (done) { - console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************"); + console.info("====>************* inputmethod_test_MAX_TYPE_NUM_001 Test start*************"); let inputMethodSetting = inputMethod.MAX_TYPE_NUM; - console.info("inputmethod_test_001 result:" + inputMethodSetting); - expect(inputMethodSetting != null).assertTrue(); - console.info("************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************"); + console.info("====>inputmethod_test_001 result:" + inputMethodSetting); + expect(inputMethodSetting !== null).assertTrue(); + console.info("====>************* inputmethod_test_MAX_TYPE_NUM_001 Test end*************"); done(); }); @@ -112,7 +112,7 @@ export default function inputMethodJSUnit() { * @tc.level 2 */ it('inputmethod_test_switchInputMethod_001', 0, async function (done) { - console.info("************* inputmethod_test_switchInputMethod_001 Test start*************"); + console.info("====>************* inputmethod_test_switchInputMethod_001 Test start*************"); let inputMethodProperty = { packageName: "com.example.kikakeyboard", methodId: "ServiceExtAbility", @@ -121,13 +121,13 @@ export default function inputMethodJSUnit() { extra:{} } inputMethod.switchInputMethod(inputMethodProperty).then(data => { - console.info("inputmethod_test_switchInputMethod_001 data:" + data) + console.info("====>inputmethod_test_switchInputMethod_001 data:" + data) expect(data == true).assertTrue(); }).catch( err=> { - console.info("inputmethod_test_switchInputMethod_001 err:" + err) + console.info("====>inputmethod_test_switchInputMethod_001 err:" + err) expect().assertFail(); }) - console.info("************* inputmethod_test_switchInputMethod_001 Test end*************"); + console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************"); done(); }); @@ -138,7 +138,7 @@ export default function inputMethodJSUnit() { * @tc.level 2 */ it('inputmethod_test_switchInputMethod_002', 0, async function (done) { - console.info("************* inputmethod_test_switchInputMethod_002 Test start*************"); + console.info("====>************* inputmethod_test_switchInputMethod_002 Test start*************"); let inputMethodProperty = { packageName: "com.example.kikakeyboard", methodId: "ServiceExtAbility", @@ -148,13 +148,13 @@ export default function inputMethodJSUnit() { } inputMethod.switchInputMethod(inputMethodProperty, (err, data)=>{ if(err){ - console.info("inputmethod_test_switchInputMethod_002 error:" + err); + console.info("====>inputmethod_test_switchInputMethod_002 error:" + err); expect().assertFail(); } - console.info("inputmethod_test_switchInputMethod_002 data:" + data) + console.info("====>inputmethod_test_switchInputMethod_002 data:" + data) expect(data == true).assertTrue(); }); - console.info("************* inputmethod_test_switchInputMethod_002 Test end*************"); + console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************"); done(); }); @@ -166,17 +166,16 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_showSoftKeyboard_001', 0, async function (done) { let inputMethodCtrl = inputMethod.getInputMethodController() - inputMethodCtrl.showSoftKeyboard((err, data)=>{ - if(data == undefined){ - console.info("showSoftKeyboard callbace success" ); - expect(true).assertTrue(); - }else{ - console.info('showSoftKeyboard callbace failed : ' + JSON.stringify(err)) - expect().assertFail(); - } - }); - console.info("************* inputmethod_test_showSoftKeyboard_001 Test end*************"); - done(); + try{ + inputMethodCtrl.showSoftKeyboard((err)=>{ + expect(err.code).assertEqual('12800003') + console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************"); + done(); + }); + }catch(err){ + expect().assertFail() + done(); + } }); /* @@ -187,15 +186,15 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) { let inputMethodCtrl = inputMethod.getInputMethodController() - inputMethodCtrl.showSoftKeyboard().then((data) =>{ - console.info("showSoftKeyboard promise success" ); - expect(true).assertTrue(); + inputMethodCtrl.showSoftKeyboard().then(() =>{ + expect().assertFail() + done(); }).catch((err) => { - console.info('showSoftKeyboard promise failed : ' + JSON.stringify(err)) - expect().assertFail(); + console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err)) + expect(err.code).assertEqual('12800003') + console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************"); + done(); }) - console.info("************* inputmethod_test_showSoftKeyboard_002 Test end*************"); - done(); }); /* @@ -206,17 +205,17 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_hideSoftKeyboard_001', 0, async function (done) { let inputMethodCtrl = inputMethod.getInputMethodController() - inputMethodCtrl.hideSoftKeyboard((err, data)=>{ - if(data == undefined){ - console.info("hideSoftKeyboard callbace success" ); - expect(true).assertTrue(); - }else{ - console.info('hideSoftKeyboard callbace failed : ' + JSON.stringify(err)) - expect().assertFail(); - } - }); - console.info("************* inputmethod_test_hideSoftKeyboard_001 Test end*************"); - done(); + try{ + inputMethodCtrl.hideSoftKeyboard((err)=>{ + console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err)) + expect(err.code).assertEqual('12800003') + console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************"); + done(); + }) + }catch(err){ + expect().assertFail(); + done(); + } }); /* @@ -227,15 +226,15 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) { let inputMethodCtrl = inputMethod.getInputMethodController() - inputMethodCtrl.hideSoftKeyboard().then((data) =>{ - console.info("hideSoftKeyboard promise success" ); - expect(true).assertTrue(); - }).catch((err) => { - console.info('hideSoftKeyboard promise failed : ' + JSON.stringify(err)) + inputMethodCtrl.hideSoftKeyboard().then(() =>{ expect().assertFail(); + done(); + }).catch((err) => { + console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err)) + expect(err.code).assertEqual('12800003'); + console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************"); + done(); }) - console.info("************* inputmethod_test_hideSoftKeyboard_002 Test end*************"); - done(); }); /* @@ -246,12 +245,12 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_getCurrentInputMethod_001', 0, async function (done) { let currentIme = inputMethod.getCurrentInputMethod(); - console.info("inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme)); + console.info("====>inputmethod_test_getCurrentInputMethod_001 currentIme---" + JSON.stringify(currentIme)); console.info(currentIme.packageName); console.info(currentIme.methodId); - expect(currentIme.packageName != null).assertTrue(); - expect(currentIme.methodId != null).assertTrue(); - console.info("************* inputmethod_test_getCurrentInputMethod_001 Test end*************"); + expect(currentIme.packageName !== null).assertTrue(); + expect(currentIme.methodId !== null).assertTrue(); + console.info("====>************* inputmethod_test_getCurrentInputMethod_001 Test end*************"); done(); }); @@ -264,13 +263,13 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_getInputMethods_001', 0, async function (done) { let inputMethodSetting = inputMethod.getInputMethodSetting(); - console.info("inputmethod_test_getInputMethods_001 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputmethod_test_getInputMethods_001 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.getInputMethods(true, (err, arr) => { if (err) { console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err)); expect().assertFail(); }; - console.info("inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr)); + console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr)); expect(arr != null).assertTrue(); }); done(); @@ -285,13 +284,13 @@ export default function inputMethodJSUnit() { */ it('inputmethod_test_getInputMethods_002', 0, async function (done) { let inputMethodSetting = inputMethod.getInputMethodSetting(); - console.info("inputmethod_test_getInputMethods_002 result:" + JSON.stringify(inputMethodSetting)); + console.info("====>inputmethod_test_getInputMethods_002 result:" + JSON.stringify(inputMethodSetting)); inputMethodSetting.getInputMethods(false, (err, arr) => { if (err) { console.error("inputmethod_test_getInputMethods_002 failed because: " + JSON.stringify(err)); expect().assertFail(); }; - console.info("inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr)); + console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr)); expect(arr != null).assertTrue(); }); done();