From f6cfdcd1f8972561549fd63e447ae2c97259667a Mon Sep 17 00:00:00 2001 From: quanli Date: Sun, 30 Oct 2022 14:19:33 +0800 Subject: [PATCH] fixed fe909cb from https://gitee.com/quanli125/xts_acts/pulls/6340 quanli1@huawei.com Signed-off-by: quanli --- .../src/main/js/test/BleGattManager.test.js | 2 +- .../main/js/test/nfc.MifareUltralightTag.js | 51 ++++++++++++++++++- .../src/main/js/test/nfc.TagABFV.js | 1 + .../main/js/test/WifiStationFunctions.test.js | 4 +- 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js b/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js index e80254495..c18c9c4aa 100644 --- a/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js +++ b/communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js @@ -388,7 +388,7 @@ describe('bluetoothBLETest', function() { let characteristic = {serviceUuid: '00001810-0000-1000-8000-00805F9B34FB', characteristicUuid: '00001820-0000-1000-8000-00805F9B34FB', characteristicValue: arrayBufferCCC, descriptors:descriptors}; - gattClient.readCharacteristicValue(characteristic).then((object) => { + await gattClient.readCharacteristicValue(characteristic).then((data) => { if (object != null) { expect(true).assertEqual(true); } else { diff --git a/communication/nfc_Controller/src/main/js/test/nfc.MifareUltralightTag.js b/communication/nfc_Controller/src/main/js/test/nfc.MifareUltralightTag.js index 645f3f460..7e8f9e5eb 100644 --- a/communication/nfc_Controller/src/main/js/test/nfc.MifareUltralightTag.js +++ b/communication/nfc_Controller/src/main/js/test/nfc.MifareUltralightTag.js @@ -115,9 +115,58 @@ export default function nfcMifareUltralightTag() { sleep(3000); done(); }) - + /** * @tc.number SUB_Communication_NFC_mifareUltralight_0300 + * @tc.name testwriteSinglePage + * @tc.desc Test writeSinglePage api by promise. + * @tc.size MEDIUM + * @ since 7 + * @tc.type Function + * @tc.level Level 2 + */ + it('SUB_Communication_NFC_mifareUltralight_0300', 0, async function (done) { + let pageIndex = 1; + let rawData = [0x01, 0x02]; + await MifareUltralightTag.writeSinglePage(pageIndex, rawData).then((data) => { + console.log("mifareUltralight writeSinglePages1 data: " + data + "json1:" + JSON.stringify(data)); + expect(true).assertTrue(data >= 0); + done(); + }).catch((err)=> { + console.log("mifareUltralight writeSinglePages1 err: " + err); + expect(true).assertEqual(true); + done(); + }); + sleep(3000); + }) + + /** + * @tc.number SUB_Communication_NFC_mifareUltralight_0400 + * @tc.name testwriteSinglePage + * @tc.desc Test writeSinglePage api by callback. + * @tc.size MEDIUM + * @ since 7 + * @tc.type Function + * @tc.level Level 2 + */ + it('SUB_Communication_NFC_mifareUltralight_0400', 0, async function (done) { + let pageIndex = 1; + let rawData = [0x01, 0x02]; + MifareUltralightTag.writeSinglePage(pageIndex, rawData, (err, data)=> { + if (err) { + console.log("mifareUltralight writeSinglePages2 err: " + err); + expect(true).assertEqual(true); + } else { + console.log("mifareUltralight writeSinglePages2 data: " + data + "json2:" + JSON.stringify(data)); + expect(true).assertTrue(data >= 0); + } + }); + sleep(3000); + done(); + }) + + /** + * @tc.number SUB_Communication_NFC_mifareUltralight_0500 * @tc.name testgetType * @tc.desc Gets the type of Mifare Ultralight label * @tc.size MEDIUM diff --git a/communication/nfc_Controller/src/main/js/test/nfc.TagABFV.js b/communication/nfc_Controller/src/main/js/test/nfc.TagABFV.js index 1f4d07805..a20618ade 100644 --- a/communication/nfc_Controller/src/main/js/test/nfc.TagABFV.js +++ b/communication/nfc_Controller/src/main/js/test/nfc.TagABFV.js @@ -53,6 +53,7 @@ let aTag = { }, ], "tagRfDiscId": 1, + "supportedProfiles": 1, }; let bTag = { diff --git a/communication/wifi_standard/src/main/js/test/WifiStationFunctions.test.js b/communication/wifi_standard/src/main/js/test/WifiStationFunctions.test.js index 56ad8f26d..286925257 100644 --- a/communication/wifi_standard/src/main/js/test/WifiStationFunctions.test.js +++ b/communication/wifi_standard/src/main/js/test/WifiStationFunctions.test.js @@ -109,7 +109,7 @@ export default function actsWifiFunctionsTest() { "timestamp" + result[j].timestamp + "capabilities" + result[j].capabilities + "centerFrequency0: " + result[j].centerFrequency0 + "centerFrequency1: " + result[j].centerFrequency1 - + "infoElems: " + result[j].infoElems); + + "eid: " + result[j].infoElems.eid + "content: " + result[j].infoElems.content); } } resolve(); @@ -325,5 +325,3 @@ export default function actsWifiFunctionsTest() { }) } - - -- GitLab