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

!6225 【Openharmony3.2.8.2】【master分支】【sensor子系统】【ToC】【RK3568】【必现】api覆盖

Merge pull request !6225 from ldy/master
......@@ -15,6 +15,7 @@
import SystemParameterTest from './SensorOnOffTest.test.js'
import SensorJsTest_sensor_2 from './SensorGeomagneticTest.test.js'
import SensorJsTest_sensor_1 from './SensorGeneralalgorithm.test.js'
import SensorJsTest_sensor_60 from './SensorOnOffTest.test_newSensorGeomagnetic.js'
import SensorJsTest_sensor_3 from './SensorOnOffTest.test_oldAccelerometer.js'
import SensorJsTest_sensor_25 from './Subscribe_subscribeAccelerometer.js'
import SensorJsTest_sensor_39 from './SensorOnOffTest.test_newAccelerometer.js'
......@@ -22,6 +23,7 @@ import SensorJsTest_sensor_39 from './SensorOnOffTest.test_newAccelerometer.js'
export default function testsuite() {
SensorJsTest_sensor_1()
SensorJsTest_sensor_2()
SensorJsTest_sensor_60()
SystemParameterTest()
SensorJsTest_sensor_3()
SensorJsTest_sensor_25()
......
......@@ -69,11 +69,11 @@ describe("SensorJsTest_sensor_41", function () {
/*
* @tc.number:SUB_SensorsSystem_AMBIENT_LIGHT_JSTest_0140
* @tc.name: newAmbient_Light_SensorJsTest027
* @tc.name: newAmbient_Light_SensorJsTest014
* @tc.desc: Functional Use Cases
*/
it("newAmbient_Light_SensorJsTest027", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('---------newAmbient_Light_SensorJsTest027--------------');
it("newAmbient_Light_SensorJsTest014", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('---------newAmbient_Light_SensorJsTest014--------------');
sensor.on(sensor.SensorId.AMBIENT_LIGHT, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.AMBIENT_LIGHT);
......@@ -83,19 +83,19 @@ describe("SensorJsTest_sensor_41", function () {
/*
* @tc.number:SUB_SensorsSystem_AMBIENT_LIGHT_JSTest_0150
* @tc.name: newAmbient_Light_SensorJsTest028
* @tc.name: newAmbient_Light_SensorJsTest015
* @tc.desc: Illegal ID passed in
*/
it("newAmbient_Light_SensorJsTest028", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newAmbient_Light_SensorJsTest028--------------');
it("newAmbient_Light_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newAmbient_Light_SensorJsTest015--------------');
function onSensorCallback(data) {
console.info('newAmbient_Light_SensorJsTest028 callback in');
console.info('newAmbient_Light_SensorJsTest015 callback in');
expect(false).assertTrue();
}
try {
sensor.on(invalid, onSensorCallback);
} catch (error) {
console.info("newAmbient_Light_SensorJsTest028 error:" + error);
console.info("newAmbient_Light_SensorJsTest015 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
......@@ -104,29 +104,29 @@ describe("SensorJsTest_sensor_41", function () {
/*
* @tc.number:SUB_SensorsSystem_AMBIENT_LIGHT_JSTest_0160
* @tc.name: newAmbient_Light_SensorJsTest029
* @tc.name: newAmbient_Light_SensorJsTest016
* @tc.desc: For normal scenarios
*/
it("newAmbient_Light_SensorJsTest029", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------SensorJsTest003--------------');
it("newAmbient_Light_SensorJsTest016", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newAmbient_Light_SensorJsTest016--------------');
sensor.on(sensor.SensorId.AMBIENT_LIGHT, callback, {'interval': 100000000});
setTimeout(()=>{
console.info('---------newAmbient_Light_SensorJsTest029 off in--------------');
console.info('---------newAmbient_Light_SensorJsTest016 off in--------------');
sensor.off(sensor.SensorId.AMBIENT_LIGHT);
console.info('---------newAmbient_Light_SensorJsTest029 off end--------------');
console.info('---------newAmbient_Light_SensorJsTest016 off end--------------');
done();
}, 500);
})
/*
* @tc.number:SUB_SensorsSystem_AMBIENT_LIGHT_JSTest_0170
* @tc.name: newAmbient_Light_SensorJsTest030
* @tc.name: newAmbient_Light_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it("newAmbient_Light_SensorJsTest030", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
console.info('---------newAmbient_Light_SensorJsTest030--------------');
it("newAmbient_Light_SensorJsTest017", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
console.info('---------newAmbient_Light_SensorJsTest017--------------');
function onSensorCallback(data) {
console.info('newAmbient_Light_SensorJsTest030 callback in');
console.info('newAmbient_Light_SensorJsTest017 callback in');
expect(typeof (data.intensity)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
done();
......@@ -134,14 +134,14 @@ describe("SensorJsTest_sensor_41", function () {
try {
sensor.on(sensor.SensorId.AMBIENT_LIGHT, onSensorCallback, {'interval': 100000000}, 5);
} catch (error) {
console.info("newAmbient_Light_SensorJsTest030 error:" +error);
console.info("newAmbient_Light_SensorJsTest017 error:" +error);
expect(false).assertTrue();
done();
}
setTimeout(()=>{
console.info('---------newAmbient_Light_SensorJsTest030 off in--------------');
console.info('---------newAmbient_Light_SensorJsTest017 off in--------------');
sensor.off(sensor.SensorId.AMBIENT_LIGHT);
console.info('---------newAmbient_Light_SensorJsTest030 off end--------------');
console.info('---------newAmbient_Light_SensorJsTest017 off end--------------');
done();
}, 500);
})
......
......@@ -22,6 +22,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}
......@@ -30,6 +31,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}
......@@ -73,11 +75,11 @@ describe("SensorJsTest_sensor_49", function () {
/*
* @tc.number:SUB_SensorsSystem_ROTATION_VECTOR_JSTest_0140
* @tc.name:newRotatingVector_SensorJsTest027
* @tc.name:newRotatingVector_SensorJsTest014
* @tc.desc: Functional Use Cases
*/
it("newRotatingVector_SensorJsTest027", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('---------newRotatingVector_SensorJsTest027--------------');
it("newRotatingVector_SensorJsTest014", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('---------newRotatingVector_SensorJsTest014--------------');
sensor.on(sensor.SensorId.ROTATION_VECTOR, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.ROTATION_VECTOR);
......@@ -87,19 +89,19 @@ describe("SensorJsTest_sensor_49", function () {
/*
* @tc.number:SUB_SensorsSystem_ROTATION_VECTOR_JSTest_0150
* @tc.name:newRotatingVector_SensorJsTest028
* @tc.name:newRotatingVector_SensorJsTest015
* @tc.desc: Illegal ID passed in
*/
it("newRotatingVector_SensorJsTest028", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newRotatingVector_SensorJsTest028--------------');
it("newRotatingVector_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newRotatingVector_SensorJsTest015--------------');
function onSensorCallback(data) {
console.info('newRotatingVector_SensorJsTest028 callback in');
console.info('newRotatingVector_SensorJsTest015 callback in');
expect(false).assertTrue();
}
try {
sensor.on(invalid, onSensorCallback);
} catch (error) {
console.info("newRotatingVector_SensorJsTest028 error:" + error);
console.info("newRotatingVector_SensorJsTest015 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
......@@ -108,45 +110,46 @@ describe("SensorJsTest_sensor_49", function () {
/*
* @tc.number:SUB_SensorsSystem_ROTATION_VECTOR_JSTest_0160
* @tc.name:newRotatingVector_SensorJsTest029
* @tc.name:newRotatingVector_SensorJsTest016
* @tc.desc: For normal scenarios
*/
it("newRotatingVector_SensorJsTest029", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newRotatingVector_SensorJsTest029--------------');
it("newRotatingVector_SensorJsTest016", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newRotatingVector_SensorJsTest016--------------');
sensor.on(sensor.SensorId.ROTATION_VECTOR, callback, {'interval': 100000000});
setTimeout(()=>{
console.info('---------newRotatingVector_SensorJsTest029 off in--------------');
console.info('---------newRotatingVector_SensorJsTest016 off in--------------');
sensor.off(sensor.SensorId.ROTATION_VECTOR);
console.info('---------newRotatingVector_SensorJsTest029 off end--------------');
console.info('---------newRotatingVector_SensorJsTest016 off end--------------');
done();
}, 500);
})
/*
* @tc.number:SUB_SensorsSystem_ROTATION_VECTOR_JSTest_0170
* @tc.name:newRotatingVector_SensorJsTest030
* @tc.name:newRotatingVector_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it("newRotatingVector_SensorJsTest030", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
console.info('---------newRotatingVector_SensorJsTest030--------------');
it("newRotatingVector_SensorJsTest017", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
console.info('---------newRotatingVector_SensorJsTest017--------------');
function onSensorCallback(data) {
console.info('newRotatingVector_SensorJsTest030 callback in');
console.info('newRotatingVector_SensorJsTest017 callback in');
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}
try {
sensor.on(sensor.SensorId.ROTATION_VECTOR, onSensorCallback, {'interval': 100000000}, 5);
} catch (error) {
console.info("newRotatingVector_SensorJsTest030 error:" +error);
console.info("newRotatingVector_SensorJsTest017 error:" +error);
expect(false).assertTrue();
done();
}
setTimeout(()=>{
console.info('---------newRotatingVector_SensorJsTest030 off in--------------');
console.info('---------newRotatingVector_SensorJsTest017 off in--------------');
sensor.off(sensor.SensorId.ROTATION_VECTOR);
console.info('---------newRotatingVector_SensorJsTest030 off end--------------');
console.info('---------newRotatingVector_SensorJsTest017 off end--------------');
done();
}, 500);
})
......@@ -196,6 +199,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
done();
}
......@@ -245,18 +249,18 @@ describe("SensorJsTest_sensor_49", function () {
/*
* @tc.number:SUB_SensorsSystem_ROTATION_VECTOR_JSTest_0230
* @tc.name: newnewRotatingVector_SensorJsTest023
* @tc.name: newRotatingVector_SensorJsTest023
* @tc.desc:SensorId1000000 of incoming exception
*/
it("newnewRotatingVector_SensorJsTest023", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
it("newRotatingVector_SensorJsTest023", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('newnewRotatingVector_SensorJsTest023 on error');
console.info('newRotatingVector_SensorJsTest023 on error');
expect(false).assertTrue();
}
try {
sensor.off(1000000, onSensorCallback);
} catch (error) {
console.info("newnewRotatingVector_SensorJsTest023 error:" +error);
console.info("newRotatingVector_SensorJsTest023 error:" +error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE)
expect(error.message).assertEqual(PARAMETER_ERROR_MSG)
done();
......@@ -274,6 +278,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
});
sensor.on(sensor.SensorId.ROTATION_VECTOR, (data)=>{
......@@ -281,6 +286,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
});
setTimeout(()=>{
......@@ -319,6 +325,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}, {'interval': 100000000});
sensor.once(sensor.SensorId.ROTATION_VECTOR, (data)=>{
......@@ -326,6 +333,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
});
setTimeout(()=>{
......@@ -348,6 +356,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}, {'interval': 100000000});
sensor.on(sensor.SensorId.ROTATION_VECTOR, (data)=>{
......@@ -355,6 +364,7 @@ describe("SensorJsTest_sensor_49", function () {
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
expect(typeof (data.w)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}, {'interval': 100000000});
setTimeout(()=>{
......
......@@ -69,11 +69,11 @@ describe("SensorJsTest_sensor_50", function () {
/*
* @tc.number:SUB_SensorsSystem_SIGNIFICANT_MOTION_JSTest_0120
* @tc.name: newSignificant_Motion_SensorJsTest023
* @tc.name: newSignificant_Motion_SensorJsTest012
* @tc.desc: Functional Use Cases
*/
it("newSignificant_Motion_SensorJsTest023", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('---------newSignificant_Motion_SensorJsTest023--------------');
it("newSignificant_Motion_SensorJsTest012", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('---------newSignificant_Motion_SensorJsTest012--------------');
sensor.on(sensor.SensorId.SIGNIFICANT_MOTION, callback);
setTimeout(()=>{
sensor.off(sensor.SensorId.SIGNIFICANT_MOTION);
......@@ -83,19 +83,19 @@ describe("SensorJsTest_sensor_50", function () {
/*
* @tc.number:SUB_SensorsSystem_SIGNIFICANT_MOTION_JSTest_0130
* @tc.name: newSignificant_Motion_SensorJsTest024
* @tc.name: newSignificant_Motion_SensorJsTest013
* @tc.desc: Illegal ID passed in
*/
it("newSignificant_Motion_SensorJsTest024", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newSignificant_Motion_SensorJsTest024--------------');
it("newSignificant_Motion_SensorJsTest013", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newSignificant_Motion_SensorJsTest013--------------');
function onSensorCallback(data) {
console.info('newSignificant_Motion_SensorJsTest024 callback in');
console.info('newSignificant_Motion_SensorJsTest013 callback in');
expect(false).assertTrue();
}
try {
sensor.on(invalid, onSensorCallback);
} catch (error) {
console.info("newSignificant_Motion_SensorJsTest024 error:" + error);
console.info("newSignificant_Motion_SensorJsTest013 error:" + error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done();
......@@ -104,53 +104,53 @@ describe("SensorJsTest_sensor_50", function () {
/*
* @tc.number:SUB_SensorsSystem_SIGNIFICANT_MOTION_JSTest_0140
* @tc.name: newSignificant_Motion_SensorJsTest025
* @tc.name: newSignificant_Motion_SensorJsTest014
* @tc.desc: For normal scenarios
*/
it("newSignificant_Motion_SensorJsTest025", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newSignificant_Motion_SensorJsTest025--------------');
it("newSignificant_Motion_SensorJsTest014", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('---------newSignificant_Motion_SensorJsTest014--------------');
sensor.on(sensor.SensorId.SIGNIFICANT_MOTION, callback, {'interval': 100000000});
setTimeout(()=>{
console.info('---------newSignificant_Motion_SensorJsTest025 off in--------------');
console.info('---------newSignificant_Motion_SensorJsTest014 off in--------------');
sensor.off(sensor.SensorId.SIGNIFICANT_MOTION);
console.info('---------newSignificant_Motion_SensorJsTest025 off end--------------');
console.info('---------newSignificant_Motion_SensorJsTest014 off end--------------');
done();
}, 500);
})
/*
* @tc.number:SUB_SensorsSystem_SIGNIFICANT_MOTION_JSTest_0150
* @tc.name: newSignificant_Motion_SensorJsTest026
* @tc.name: newSignificant_Motion_SensorJsTest015
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it("newSignificant_Motion_SensorJsTest026", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
console.info('---------newSignificant_Motion_SensorJsTest026--------------');
it("newSignificant_Motion_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, function (done) {
console.info('---------newSignificant_Motion_SensorJsTest015--------------');
function onSensorCallback(data) {
console.info('newSignificant_Motion_SensorJsTest026 callback in');
console.info('newSignificant_Motion_SensorJsTest015 callback in');
expect(typeof (data.scalar)).assertEqual("number");
expect(typeof (data.timestamp)).assertEqual("number");
}
try {
sensor.on(sensor.SensorId.SIGNIFICANT_MOTION, onSensorCallback, {'interval': 100000000}, 5);
} catch (error) {
console.info("newSignificant_Motion_SensorJsTest026 error:" +error);
console.info("newSignificant_Motion_SensorJsTest015 error:" +error);
expect(false).assertTrue();
done();
}
setTimeout(()=>{
console.info('---------newSignificant_Motion_SensorJsTest026 off in--------------');
console.info('---------newSignificant_Motion_SensorJsTest015 off in--------------');
sensor.off(sensor.SensorId.SIGNIFICANT_MOTION);
console.info('---------newSignificant_Motion_SensorJsTest026 off end--------------');
console.info('---------newSignificant_Motion_SensorJsTest015 off end--------------');
done();
}, 500);
})
/*
* @tc.number:SUB_SensorsSystem_SIGNIFICANT_MOTION_JSTest_0160
* @tc.name: newSignificant_Motion_SensorJsTest027
* @tc.name: newSignificant_Motion_SensorJsTest016
* @tc.desc: Once Normal Subscription Scenario Use Case
*/
it("newSignificant_Motion_SensorJsTest027", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
it("newSignificant_Motion_SensorJsTest016", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
sensor.once(sensor.SensorId.SIGNIFICANT_MOTION, callback);
setTimeout(()=>{
expect(true).assertTrue();
......@@ -216,18 +216,18 @@ describe("SensorJsTest_sensor_50", function () {
/*
* @tc.number:SUB_SensorsSystem_SIGNIFICANT_MOTION_JSTest_0200
* @tc.name: newnewSignificant_Motion_SensorJsTest020
* @tc.name: newSignificant_Motion_SensorJsTest020
* @tc.desc:SensorId1000000 of incoming exception
*/
it("newnewSignificant_Motion_SensorJsTest020", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
it("newSignificant_Motion_SensorJsTest020", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('newnewSignificant_Motion_SensorJsTest020 on error');
console.info('newSignificant_Motion_SensorJsTest020 on error');
expect(false).assertTrue();
}
try {
sensor.off(1000000, onSensorCallback);
} catch (error) {
console.info("newnewSignificant_Motion_SensorJsTest020 error:" +error);
console.info("newSignificant_Motion_SensorJsTest020 error:" +error);
expect(error.code).assertEqual(PARAMETER_ERROR_CODE)
expect(error.message).assertEqual(PARAMETER_ERROR_MSG)
done();
......
......@@ -16,8 +16,8 @@ import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, TestType, Size, Level } from '@ohos/hypium'
export default function SensorJsTest_sensor_26() {
describe("SensorJsTest_sensor_26", function () {
export default function SensorJsTest_sensor_27() {
describe("SensorJsTest_sensor_27", function () {
beforeAll(function () {
/*
......
......@@ -106,7 +106,6 @@ describe("SensorJsTest_sensor_31", function () {
it("subscribeLight_SensorJsTest003", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info('----------------------subscribeLight_SensorJsTest003---------------------------');
sensor.subscribeLight({
interval: 'normal',
success: function (data) {
console.info("subscribeLight_SensorJsTest003 success" + JSON.stringify(data));
expect(typeof (data.intensity)).assertEqual("number");
......@@ -170,6 +169,7 @@ describe("SensorJsTest_sensor_31", function () {
success: function (data) {
console.info("subscribeLight_SensorJsTest005 success" + JSON.stringify(data));
expect(typeof (data.intensity)).assertEqual("number");
done();
},
fail: function (data, code) {
console.log("subscribeLight_SensorJsTest005 is failed, data: " + data + ", code: " + code);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册