提交 914f5906 编写于 作者: L liuzixuan10

Modify the use case number and modify the use case name

Signed-off-by: Nliuzixuan10 <liuzixuan10@huawei.com>
上级 f71d7c17
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Accelerometer_Uncalibrated_JSTest_0010
* @tc.name: SensorAccelerometerUncalibratedJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Accelerometer_Uncalibrated_JSTest_0010", 0, async function (done) {
console.info('------------SUB_SensorsSystem_Accelerometer_Uncalibrated_JSTest_0010-----------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorAccelerometerUncalibratedJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorAccelerometerUncalibratedJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,14 +80,15 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorAccelerometerUncalibratedJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
console.info('SensorAccelerometerUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z + "biasX:" + data.biasX + "biasY: "
+ data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......@@ -105,25 +105,25 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorAccelerometerUncalibratedJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Accelerometer_Uncalibrated_JSTest_0020
* @tc.name: SensorAccelerometerUncalibratedJSTest002
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_Uncalibrated_JSTest_0020", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorAccelerometerUncalibratedJSTest002 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
console.info('SensorAccelerometerUncalibratedJSTest002 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z + "biasX:" + data.biasX + "biasY: "
+ data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Barometer_JSTest_0010
* @tc.name: SensorBarometerJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Barometer_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Barometer_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorBarometerJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorBarometerJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_BAROMETER, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorBarometerJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success pressure: ' + data.pressure);
console.info('SensorBarometerJSTest001 on success pressure: ' + data.pressure);
expect(typeof (data.pressure)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorBarometerJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Barometer_JSTest_0050
* @tc.name: SensorBarometerJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Barometer_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorBarometerJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success pressure: ' + data.pressure);
console.info('SensorBarometerJSTest005 once success pressure: ' + data.pressure);
expect(typeof (data.pressure)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Gravity_JSTest_0010
* @tc.name: SensorGravityJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Gravity_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gravity_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorGravityJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorGravityJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorGravityJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGravityJSTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......@@ -101,24 +100,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorGravityJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Gravity_JSTest_0050
* @tc.name: SensorGravityJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Gravity_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorGravityJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGravityJSTest005 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Gyroscope_Uncalibrated_JSTest_0010
* @tc.name: SensorGyroscopeUncalibratedJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Gyroscope_Uncalibrated_JSTest_0010", 0, async function (done) {
console.info('-----------------SUB_SensorsSystem_Gyroscope_Uncalibrated_JSTest_0010----------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorGyroscopeUncalibratedJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorGyroscopeUncalibratedJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorGyroscopeUncalibratedJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: "
console.info('SensorGyroscopeUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......@@ -105,24 +105,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorGyroscopeUncalibratedJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Gyroscope_Uncalibrated_JSTest_0050
* @tc.name: SensorGyroscopeUncalibratedJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_Uncalibrated_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorGyroscopeUncalibratedJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: "
console.info('SensorGyroscopeUncalibratedJSTest005 on success, x: ' + data.x + "y: " + data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Hall_JSTest_0010
* @tc.name: SensorHallJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Hall_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Hall_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HALL, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorHallJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorHallJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HALL, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorHallJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success status: ' + data.status);
console.info('SensorHallJSTest001 on success status: ' + data.status);
expect(typeof (data.status)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorHallJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Hall_JSTest_0050
* @tc.name: SensorHallJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Hall_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorHallJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success status: ' + data.status);
console.info('SensorHallJSTest005 once success status: ' + data.status);
expect(typeof (data.status)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Heart_Rate_JSTest_0010
* @tc.name: SensorHeartRateJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Heart_Rate_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Heart_Rate_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorHeartRateJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorHeartRateJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HEART_RATE, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorHeartRateJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 once success heartRate: ' + data.heartRate);
console.info('SensorHeartRateJSTest001 once success heartRate: ' + data.heartRate);
expect(typeof (data.heartRate)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorHeartRateJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Heart_Rate_JSTest_0050
* @tc.name: SensorHeartRateJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Heart_Rate_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorHeartRateJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success heartRate: ' + data.heartRate);
console.info('SensorHeartRateJSTest005 once success heartRate: ' + data.heartRate);
expect(typeof (data.heartRate)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Humidity_JSTest_0010
* @tc.name: SensorHumidityJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Humidity_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Humidity_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorHumidityJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorHumidityJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_HUMIDITY, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorHumidityJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success humidity: ' + data.humidity);
console.info('SensorHumidityJSTest001 on success humidity: ' + data.humidity);
expect(typeof (data.humidity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorHumidityJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Humidity_JSTest_0050
* @tc.name: SensorHumidityJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Humidity_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorHumidityJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success humidity: ' + data.humidity);
console.info('SensorHumidityJSTest005 once success humidity: ' + data.humidity);
expect(typeof (data.humidity)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Linear_Acceleration_JSTest_0010
* @tc.name: SensorLinearAccelerationJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Linear_Acceleration_JSTest_0010", 0, async function (done) {
console.info('---------------SUB_SensorsSystem_Linear_Acceleration_JSTest_0010-----------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorLinearAccelerationJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorLinearAccelerationJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorLinearAccelerationJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorLinearAccelerationJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......@@ -101,24 +101,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorLinearAccelerationJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Linear_Acceleration_JSTest_0050
* @tc.name: SensorLinearAccelerationJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Linear_Acceleration_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorLinearAccelerationJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorLinearAccelerationJSTest005 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Magnetic_Field_Uncalibrated_JSTest_0010
* @tc.name: SensorMagneticFieldUncalibratedJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_Uncalibrated_JSTest_0010", 0, async function (done) {
console.info('----------SUB_SensorsSystem_Magnetic_Field_Uncalibrated_JSTest_0010-------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorMagneticFieldUncalibratedJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorMagneticFieldUncalibratedJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorMagneticFieldUncalibratedJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: "
console.info('SensorMagneticFieldUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......@@ -105,24 +105,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorMagneticFieldUncalibratedJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Magnetic_Field_Uncalibrated_JSTest_0050
* @tc.name: SensorMagneticFieldUncalibratedJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_Uncalibrated_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorMagneticFieldUncalibratedJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: "
console.info('SensorMagneticFieldUncalibratedJSTest005 on success, x: ' + data.x + "y: " + data.y
+ "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Orientation_JSTest_0010
* @tc.name: SensorOrientationJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Orientation_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Orientation_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorOrientationJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorOrientationJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorOrientationJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorOrientationJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......@@ -101,24 +101,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorOrientationJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Orientation_JSTest_0050
* @tc.name: SensorOrientationJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Orientation_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorOrientationJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 once success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorOrientationJSTest005 once success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Pedometer_JSTest_0010
* @tc.name: SensorPedometerJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Pedometer_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Pedometer_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorPedometerJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorPedometerJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorPedometerJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 once success steps: ' + data.steps);
console.info('SensorPedometerJSTest001 once success steps: ' + data.steps);
expect(typeof (data.steps)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorPedometerJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Pedometer_JSTest_0050
* @tc.name: SensorPedometerJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Pedometer_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorPedometerJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success steps: ' + data.steps);
console.info('SensorPedometerJSTest005 once success steps: ' + data.steps);
expect(typeof (data.steps)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Pedometer_Detection_JSTest_0010
* @tc.name: SensorPedometerDetectionJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Pedometer_Detection_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Pedometer_Detection_JSTest_0010-----------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorPedometerDetectionJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorPedometerDetectionJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorPedometerDetectionJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 once success scalar: ' + data.scalar);
console.info('SensorPedometerDetectionJSTest001 once success scalar: ' + data.scalar);
expect(typeof (data.scalar)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorPedometerDetectionJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Pedometer_Detection_JSTest_0050
* @tc.name: SensorPedometerDetectionJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Pedometer_Detection_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorPedometerDetectionJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success scalar: ' + data.scalar);
console.info('SensorPedometerDetectionJSTest005 once success scalar: ' + data.scalar);
expect(typeof (data.scalar)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Proxinity_JSTest_0010
* @tc.name: SensorProxinityJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Proxinity_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Proxinity_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorProxinityJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorProxinityJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PROXIMITY, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorProxinityJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success distance: ' + data.distance);
console.info('SensorProxinityJSTest001 on success distance: ' + data.distance);
expect(typeof (data.distance)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorProxinityJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Proxinity_JSTest_0050
* @tc.name: SensorProxinityJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Proxinity_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorProxinityJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success distance: ' + data.distance);
console.info('SensorProxinityJSTest005 once success distance: ' + data.distance);
expect(typeof (data.distance)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Rotation_Vector_JSTest_0010
* @tc.name: SensorRotationVectorJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Rotation_Vector_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Rotation_Vector_JSTest_0010--------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorRotationVectorJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorRotationVectorJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorRotationVectorJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorRotationVectorJSTest001 on success, x: '
+ data.x + "y: " + data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......@@ -101,24 +101,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorRotationVectorJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Rotation_Vector_JSTest_0050
* @tc.name: SensorRotationVectorJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Rotation_Vector_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorRotationVectorJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest001 on success, x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorRotationVectorJSTest005 on success, x: '
+ data.x + "y: " + data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Significant_Motion_JSTest_0010
* @tc.name: SensorSignificantMotionJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Significant_Motion_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Significant_Motion_JSTest_0010------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorSignificantMotionJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorSignificantMotionJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorSignificantMotionJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 once success scalar: ' + data.scalar);
console.info('SensorSignificantMotionJSTest001 once success scalar: ' + data.scalar);
expect(typeof (data.scalar)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorSignificantMotionJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Significant_Motion_JSTest_0050
* @tc.name: SensorSignificantMotionJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Significant_Motion_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorSignificantMotionJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success scalar: ' + data.scalar);
console.info('SensorSignificantMotionJSTest005 once success scalar: ' + data.scalar);
expect(typeof (data.scalar)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Ambient_Temperature_JSTest_0010
* @tc.name: SensorAmbientTemperatureJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Ambient_Temperature_JSTest_0010", 0, async function (done) {
console.info('--------------------SUB_SensorsSystem_Ambient_Temperature_JSTest_0010-------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorAmbientTemperatureJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorAmbientTemperatureJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorAmbientTemperatureJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 once success temperature: ' + data.temperature);
console.info('SensorAmbientTemperatureJSTest001 once success temperature: ' + data.temperature);
expect(typeof (data.temperature)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorAmbientTemperatureJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Ambient_Temperature_JSTest_0050
* @tc.name: SensorAmbientTemperatureJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Temperature_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorAmbientTemperatureJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success temperature: ' + data.temperature);
console.info('SensorAmbientTemperatureJSTest005 once success temperature: ' + data.temperature);
expect(typeof (data.temperature)).assertEqual("number");
}
setTimeout(() => {
......
......@@ -50,25 +50,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest001
* @tc.number: SUB_SensorsSystem_Wear_Detection_JSTest_0010
* @tc.name: SensorWearDetectionJSTest001
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest001", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------');
it("SUB_SensorsSystem_Wear_Detection_JSTest_0010", 0, async function (done) {
console.info('----------------------SensorWearDetectionJSTest001---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorWearDetectionJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorWearDetectionJSTest001 off success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -81,13 +80,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorWearDetectionJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 once success value: ' + data.value);
console.info('SensorWearDetectionJSTest001 once success value: ' + data.value);
expect(typeof (data.value)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,24 +98,23 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorWearDetectionJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Wear_Detection_JSTest_0050
* @tc.name: SensorWearDetectionJSTest005
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest005", 0, async function (done) {
it("SUB_SensorsSystem_Wear_Detection_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorWearDetectionJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success value: ' + data.value);
console.info('SensorWearDetectionJSTest005 once success value: ' + data.value);
expect(typeof (data.value)).assertEqual("number");
}
setTimeout(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册