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 866afd9402cf3865c9b2d9ff743d78a84e8eb89e..d7f62944514cc4033874402efa1203474df281f8 100644 --- a/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets +++ b/inputmethod/InputMethodTest_Stage/entry/src/main/ets/test/inputMethodStageJSUnit.ets @@ -349,7 +349,7 @@ export default function inputMethodStageJSUnit() { try { if (err) { console.error('inputMethod_test_switchCurrentInputMethodAndSubtype_001 err: ' + JSON.stringify(err)); - expect( err.code == 12800008 ).assertTrue(); + expect( err.code === 12800008 ).assertTrue(); done(); } console.info("====>inputMethod_test_switchCurrentInputMethodAndSubtype_001 data: " + JSON.stringify(data)); @@ -565,12 +565,12 @@ export default function inputMethodStageJSUnit() { try{ let inputMethodCtrl = inputMethod.getController(); console.info("====>inputMethod_test_stopInputSession_002 result:" + typeof inputMethodCtrl); - inputMethodCtrl.stopInputSession().then((data) => { + await inputMethodCtrl.stopInputSession().then((data) => { + console.info("====>inputMethod_test_stopInputSession_002 data:" + data); expect().assertFail(); done(); }).catch((err) => { - console.debug("inputMethod_test_stopInputSession_002 faild: " + JSON.stringify(err)); - expect(err.code).assertEqual('12800003') + expect(err.code).assertEqual(12800003) done(); }) }catch(error){ @@ -595,7 +595,9 @@ export default function inputMethodStageJSUnit() { try { if(err){ console.info("====>inputMethod_test_stopInputSession_001 faild: " + JSON.stringify(err)); - expect(err.code).assertEqual('12800003'); + console.info("====>inputMethod_test_stopInputSession_001 faild: " + err.code); + console.info("====>inputMethod_test_stopInputSession_001 faild: " + typeof(err.code)); + expect(err.code).assertEqual(12800003); done(); }else{ expect().assertFail(); 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 38c0d923350a45df31663cf3b77618cc21ccce96..1f1643c7129e182fbe069eb1b4177afb78a57435 100644 --- a/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets +++ b/inputmethod/InputMethodTest_ets/entry/src/main/ets/test/inputMethodJSUnit.ets @@ -196,7 +196,7 @@ export default function inputMethodJSUnit() { let inputMethodCtrl = inputMethod.getInputMethodController() inputMethodCtrl.showSoftKeyboard((err) => { try { - expect(err.code).assertEqual('12800003') + expect(err.code).assertEqual(12800003) console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************"); done(); } catch (err) { @@ -219,7 +219,9 @@ export default function inputMethodJSUnit() { done(); }).catch((err) => { console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err)) - expect(err.code).assertEqual('12800003') + console.info('====>showSoftKeyboard typeof(err.code): ' + typeof(err.code)) + console.info('====>showSoftKeyboard typeof(err.code): ' + err.code) + expect(err.code).assertEqual(12800003) console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************"); done(); }) @@ -236,7 +238,7 @@ export default function inputMethodJSUnit() { inputMethodCtrl.hideSoftKeyboard((err) => { try { console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err)) - expect(err.code).assertEqual('12800003') + expect(err.code).assertEqual(12800003) console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************"); done(); } catch (err) { @@ -259,7 +261,7 @@ export default function inputMethodJSUnit() { done(); }).catch((err) => { console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err)) - expect(err.code).assertEqual('12800003'); + expect(err.code).assertEqual(12800003); console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************"); done(); }) diff --git a/request/RequestTest_ets/entry/src/main/ets/test/requestDownload.test.ets b/request/RequestTest_ets/entry/src/main/ets/test/requestDownload.test.ets index 36d1455f38f324fe85554961f54689c6eb141b72..eb1a01e8a1a44d06da30e9eeb2ba24c7c18489b4 100644 --- a/request/RequestTest_ets/entry/src/main/ets/test/requestDownload.test.ets +++ b/request/RequestTest_ets/entry/src/main/ets/test/requestDownload.test.ets @@ -265,7 +265,7 @@ export default function requestDownloadJSUnit() { }) }catch(err){ console.error("====>SUB_REQUEST_DOWNLOAD_API_DOWNLOADTASK_ON_0006 second throw_error: " + err); - expect(err.code).assertEqual('13400002') + expect(err.code).assertEqual(13400002) await downloadTask.remove() done(); }