提交 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_JSTest_0010
* @tc.name: SensorAccelerometerJSTest001
* @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_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ACCELEROMETER, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorAccelerometerJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorAccelerometerJSTest001 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_ACCELEROMETER, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorAccelerometerJSTest001 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('SensorAccelerometerJSTest001 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,25 +101,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorAccelerometerJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest002
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0020
* @tc.name: SensorAccelerometerJSTest002
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest002", 0, async function (done) {
console.info('----------------------SensorJsTest002---------------------------');
it("SUB_SensorsSystem_Accelerometer_JSTest_0020", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0020---------------------------');
function onSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest002 on success');
console.info('SensorAccelerometerJSTest002 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest002 on error');
console.info('SensorAccelerometerJSTest002 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -130,25 +129,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest003
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0030
* @tc.name: SensorAccelerometerJSTest003
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest003", 0, async function (done) {
console.info('----------------------SensorJsTest003---------------------------');
it("SUB_SensorsSystem_Accelerometer_JSTest_0030", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0030---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(1, (error) => {
if (error) {
console.info('SensorJsTest003 off error');
console.info('SensorAccelerometerJSTest003 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 off success');
console.info('SensorAccelerometerJSTest003 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -162,13 +160,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(1, function (error, data) {
if (error) {
console.info('SensorJsTest003 on error');
console.info('SensorAccelerometerJSTest003 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 on success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest003 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");
......@@ -182,37 +181,36 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest003 reject");
console.info("SensorAccelerometerJSTest003 reject");
})
done();
})
/*
* @tc.name:SensorJsTest004
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0040
* @tc.name: SensorAccelerometerJSTest004
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest004", 0, function () {
console.info('----------------------SensorJsTest004---------------------------');
it("SUB_SensorsSystem_Accelerometer_JSTest_0040", 0, function () {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0040---------------------------');
sensor.on(1, function () { }, { 'interval': 100000000 }, 5);
expect(true).assertTrue();
console.info('----------------------SensorJsTest004--------------------------- end');
console.info('----------------------SensorAccelerometerJSTest004--------------------------- end');
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0050
* @tc.name: SensorAccelerometerJSTest005
* @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_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorAccelerometerJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest005 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");
......@@ -225,18 +223,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest006
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0060
* @tc.name: SensorAccelerometerJSTest006
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest006", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_JSTest_0060", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest006 on success');
console.info('SensorAccelerometerJSTest006 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest006 on error');
console.info('SensorAccelerometerJSTest006 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -247,29 +244,27 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest007
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0070
* @tc.name: SensorAccelerometerJSTest007
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest007", 0, function () {
it("SUB_SensorsSystem_Accelerometer_JSTest_0070", 0, function () {
sensor.once(1, function () { }, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest008
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0080
* @tc.name: SensorAccelerometerJSTest008
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest008", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_JSTest_0080", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest008 off success');
console.info('SensorAccelerometerJSTest008 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest008 off error');
console.info('SensorAccelerometerJSTest008 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -280,18 +275,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest009
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0090
* @tc.name: SensorAccelerometerJSTest009
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest009", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_JSTest_0090", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest009 off success');
console.info('SensorAccelerometerJSTest009 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest009 off error');
console.info('SensorAccelerometerJSTest009 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -302,18 +296,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest010
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0100
* @tc.name: SensorAccelerometerJSTest010
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest010", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_JSTest_0100", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest010 off success');
console.info('SensorAccelerometerJSTest010 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest010 off error');
console.info('SensorAccelerometerJSTest010 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -324,18 +317,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest011
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0110
* @tc.name: SensorAccelerometerJSTest011
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest011", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_JSTest_0110", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest011 once success');
console.info('SensorAccelerometerJSTest011 once success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest011 once error');
console.info('SensorAccelerometerJSTest011 once error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -346,18 +338,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest012
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0120
* @tc.name: SensorAccelerometerJSTest012
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest012", 0, async function (done) {
it("SUB_SensorsSystem_Accelerometer_JSTest_0120", 0, async function (done) {
function onCallback(error) {
if (error) {
console.info('SensorJsTest012 on success');
console.info('SensorAccelerometerJSTest012 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest012 on error');
console.info('SensorAccelerometerJSTest012 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -368,37 +359,35 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest013
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0130
* @tc.name: SensorAccelerometerJSTest013
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest013", 0, function () {
it("SUB_SensorsSystem_Accelerometer_JSTest_0130", 0, function () {
sensor.off(1, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest014
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0140
* @tc.name: SensorAccelerometerJSTest014
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest014", 0, async function (done) {
console.info('----------------------SensorJsTest014---------------------------');
it("SUB_SensorsSystem_Accelerometer_JSTest_0140", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0140---------------------------');
function offPromise2() {
return new Promise((resolve, reject) => {
sensor.off(1, (error) => {
if (error) {
console.info('SensorJsTest014 off2 success');
console.info('SensorAccelerometerJSTest014 off2 success');
expect(true).assertTrue();
setTimeout(() => {
done(err);
reject(err)
}, 500);
} else {
console.info('SensorJsTest014 off2 error');
console.info('SensorAccelerometerJSTest014 off2 error');
expect(false).assertTrue();
setTimeout(() => {
done();
......@@ -413,13 +402,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.off(1, (error) => {
if (error) {
console.info('SensorJsTest014 off1 error');
console.info('SensorAccelerometerJSTest014 off1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 off1 success');
console.info('SensorAccelerometerJSTest014 off1 success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -432,13 +421,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(1, function (error, data) {
if (error) {
console.info('SensorJsTest014 on error');
console.info('SensorAccelerometerJSTest014 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 on success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest014 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");
......@@ -458,25 +448,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest015
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0150
* @tc.name: SensorAccelerometerJSTest015
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest015", 0, async function (done) {
console.info('----------------------SensorJsTest015---------------------------');
it("SUB_SensorsSystem_Accelerometer_JSTest_0150", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0150---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(1, (error) => {
if (error) {
console.info('SensorJsTest015 off error');
console.info('SensorAccelerometerJSTest015 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 off success');
console.info('SensorAccelerometerJSTest015 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -490,13 +479,14 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.on(1, function (error, data) {
if (error) {
console.info('SensorJsTest015 on2 error');
console.info('SensorAccelerometerJSTest015 on2 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on2 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest015 on2 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");
......@@ -511,13 +501,14 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(1, function (error, data) {
if (error) {
console.info('SensorJsTest015 on1 error');
console.info('SensorAccelerometerJSTest015 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on1 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest015 on1 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");
......@@ -538,25 +529,24 @@ describe("SensorJsTest", function () {
/*
* @tc.name:SensorJsTest016
* @tc.number: SUB_SensorsSystem_Accelerometer_JSTest_0160
* @tc.name: SensorAccelerometerJSTest016
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest016", 0, async function (done) {
console.info('----------------------SensorJsTest016---------------------------');
it("SUB_SensorsSystem_Accelerometer_JSTest_0160", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Accelerometer_JSTest_0160---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(1, (error) => {
if (error) {
console.info('SensorJsTest016 off error');
console.info('SensorAccelerometerJSTest016 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 off success');
console.info('SensorAccelerometerJSTest016 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -570,13 +560,14 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.once(1, function (error, data) {
if (error) {
console.info('SensorJsTest016 once error');
console.info('SensorAccelerometerJSTest016 once error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 once success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest016 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");
......@@ -591,13 +582,14 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(1, function (error, data) {
if (error) {
console.info('SensorJsTest016 on1 error');
console.info('SensorAccelerometerJSTest016 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 on1 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorAccelerometerJSTest016 on1 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_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_Ambient_Light_JSTest_0010
* @tc.name: SensorAmbientLightJSTest001
* @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_Light_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Ambient_Light_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorAmbientLightJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorAmbientLightJSTest001 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_LIGHT, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorAmbientLightJSTest001 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 on success, success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest001 on success, success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -99,25 +98,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorAmbientLightJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest002
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0020
* @tc.name: SensorAmbientLightJSTest002
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest002", 0, async function (done) {
console.info('----------------------SensorJsTest002---------------------------');
it("SUB_SensorsSystem_Ambient_Light_JSTest_0020", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Ambient_Light_JSTest_0020---------------------------');
function onSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest002 on success');
console.info('SensorAmbientLightJSTest002 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest002 on error');
console.info('SensorAmbientLightJSTest002 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -128,25 +126,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest003
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0030
* @tc.name: SensorAmbientLightJSTest003
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest003", 0, async function (done) {
console.info('----------------------SensorJsTest003---------------------------');
it("SUB_SensorsSystem_Ambient_Light_JSTest_0030", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Ambient_Light_JSTest_0030---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(5, (error) => {
if (error) {
console.info('SensorJsTest003 off error');
console.info('SensorAmbientLightJSTest003 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 off success');
console.info('SensorAmbientLightJSTest003 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -160,13 +157,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(5, function (error, data) {
if (error) {
console.info('SensorJsTest003 on error');
console.info('SensorAmbientLightJSTest003 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 on success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest003 on success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -178,37 +175,35 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest003 reject");
console.info("SensorAmbientLightJSTest003 reject");
})
done();
})
/*
* @tc.name:SensorJsTest004
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0040
* @tc.name: SensorAmbientLightJSTest004
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest004", 0, function () {
console.info('----------------------SensorJsTest004---------------------------');
it("SUB_SensorsSystem_Ambient_Light_JSTest_0040", 0, function () {
console.info('----------------------SensorAmbientLightJSTest004---------------------------');
sensor.on(5, function () { }, { 'interval': 100000000 }, 5);
expect(true).assertTrue();
console.info('----------------------SensorJsTest004--------------------------- end');
console.info('----------------------SensorAmbientLightJSTest004--------------------------- end');
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0050
* @tc.name: SensorAmbientLightJSTest005
* @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_Light_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorAmbientLightJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest005 once success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
}
setTimeout(() => {
......@@ -219,18 +214,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest006
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0060
* @tc.name: SensorAmbientLightJSTest006
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest006", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0060", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest006 on success');
console.info('SensorAmbientLightJSTest006 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest006 on error');
console.info('SensorAmbientLightJSTest006 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -241,10 +235,9 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest007
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0070
* @tc.name: SensorAmbientLightJSTest007
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest007", 0, function () {
sensor.once(5, function () { }, 5);
......@@ -252,18 +245,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest008
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0080
* @tc.name: SensorAmbientLightJSTest008
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest008", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0080", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest008 off success');
console.info('SensorAmbientLightJSTest008 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest008 off error');
console.info('SensorAmbientLightJSTest008 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -274,18 +266,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest009
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0090
* @tc.name: SensorAmbientLightJSTest009
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest009", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0090", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest009 off success');
console.info('SensorAmbientLightJSTest009 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest009 off error');
console.info('SensorAmbientLightJSTest009 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -296,18 +287,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest010
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0100
* @tc.name: SensorAmbientLightJSTest010
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest010", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0100", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest010 off success');
console.info('SensorAmbientLightJSTest010 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest010 off error');
console.info('SensorAmbientLightJSTest010 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -318,18 +308,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest011
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0110
* @tc.name: SensorAmbientLightJSTest011
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest011", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0110", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest011 once success');
console.info('SensorAmbientLightJSTest011 once success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest011 once error');
console.info('SensorAmbientLightJSTest011 once error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -340,18 +329,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest012
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0120
* @tc.name: SensorAmbientLightJSTest012
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest012", 0, async function (done) {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0120", 0, async function (done) {
function onCallback(error) {
if (error) {
console.info('SensorJsTest012 on success');
console.info('SensorAmbientLightJSTest012 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest012 on error');
console.info('SensorAmbientLightJSTest012 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -362,37 +350,35 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest013
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0130
* @tc.name: SensorAmbientLightJSTest013
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest013", 0, function () {
it("SUB_SensorsSystem_Ambient_Light_JSTest_0130", 0, function () {
sensor.off(5, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest014
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0140
* @tc.name: SensorAmbientLightJSTest014
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest014", 0, async function (done) {
console.info('----------------------SensorJsTest014---------------------------');
it("SUB_SensorsSystem_Ambient_Light_JSTest_0140", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Ambient_Light_JSTest_0140---------------------------');
function offPromise2() {
return new Promise((resolve, reject) => {
sensor.off(5, (error) => {
if (error) {
console.info('SensorJsTest014 off2 success');
console.info('SensorAmbientLightJSTest014 off2 success');
expect(true).assertTrue();
setTimeout((err) => {
done();
reject(err)
}, 500);
} else {
console.info('SensorJsTest014 off2 error');
console.info('SensorAmbientLightJSTest014 off2 error');
expect(false).assertTrue();
setTimeout(() => {
done();
......@@ -407,13 +393,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.off(5, (error) => {
if (error) {
console.info('SensorJsTest014 off1 error');
console.info('SensorAmbientLightJSTest014 off1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 off1 success');
console.info('SensorAmbientLightJSTest014 off1 success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -426,13 +412,13 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(5, function (error, data) {
if (error) {
console.info('SensorJsTest014 on error');
console.info('SensorAmbientLightJSTest014 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 on success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest014 on success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -450,25 +436,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest015
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0150
* @tc.name: SensorAmbientLightJSTest015
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest015", 0, async function (done) {
console.info('----------------------SensorJsTest015---------------------------');
it("SUB_SensorsSystem_Ambient_Light_JSTest_0150", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Ambient_Light_JSTest_0150---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(5, (error) => {
if (error) {
console.info('SensorJsTest015 off error');
console.info('SensorAmbientLightJSTest015 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 off success');
console.info('SensorAmbientLightJSTest015 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -482,13 +467,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.on(5, function (error, data) {
if (error) {
console.info('SensorJsTest015 on2 error');
console.info('SensorAmbientLightJSTest015 on2 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on2 success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest015 on2 success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -501,13 +486,13 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(5, function (error, data) {
if (error) {
console.info('SensorJsTest015 on1 error');
console.info('SensorAmbientLightJSTest015 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on1 success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest015 on1 success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -526,25 +511,24 @@ describe("SensorJsTest", function () {
/*
* @tc.name:SensorJsTest016
* @tc.number: SUB_SensorsSystem_Ambient_Light_JSTest_0160
* @tc.name: SensorAmbientLightJSTest016
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest016", 0, async function (done) {
console.info('----------------------SensorJsTest016---------------------------');
it("SUB_SensorsSystem_Ambient_Light_JSTest_0160", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Ambient_Light_JSTest_0160---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(5, (error) => {
if (error) {
console.info('SensorJsTest016 off error');
console.info('SensorAmbientLightJSTest016 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 off success');
console.info('SensorAmbientLightJSTest016 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -558,13 +542,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.once(5, function (error, data) {
if (error) {
console.info('SensorJsTest016 once error');
console.info('SensorAmbientLightJSTest016 once error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 once success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest016 once success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......@@ -577,13 +561,13 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(5, function (error, data) {
if (error) {
console.info('SensorJsTest016 on1 error');
console.info('SensorAmbientLightJSTest016 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 on1 success data: ' + data.intensity);
console.info('SensorAmbientLightJSTest016 on1 success data: ' + data.intensity);
expect(typeof (data.intensity)).assertEqual("number");
setTimeout(() => {
resolve();
......
......@@ -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_JSTest_0010
* @tc.name: SensorGyroscopeJSTest001
* @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_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gyroscope_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorGyroscopeJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorGyroscopeJSTest001 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, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorGyroscopeJSTest001 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('SensorGyroscopeJSTest001 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,25 +101,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorGyroscopeJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest002
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0020
* @tc.name: SensorGyroscopeJSTest002
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest002", 0, async function (done) {
console.info('----------------------SensorJsTest002---------------------------');
it("SUB_SensorsSystem_Gyroscope_JSTest_0020", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gyroscope_JSTest_0020---------------------------');
function onSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest002 on success');
console.info('SensorGyroscopeJSTest002 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest002 on error');
console.info('SensorGyroscopeJSTest002 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -130,25 +129,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest003
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0030
* @tc.name: SensorGyroscopeJSTest003
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest003", 0, async function (done) {
console.info('----------------------SensorJsTest003---------------------------');
it("SUB_SensorsSystem_Gyroscope_JSTest_0030", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gyroscope_JSTest_0030---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(2, (error) => {
if (error) {
console.info('SensorJsTest003 off error');
console.info('SensorGyroscopeJSTest003 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 off success');
console.info('SensorGyroscopeJSTest003 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -162,13 +160,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(2, function (error, data) {
if (error) {
console.info('SensorJsTest003 on error');
console.info('SensorGyroscopeJSTest003 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 on success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest003 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");
......@@ -182,37 +181,35 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest003 reject");
console.info("SensorGyroscopeJSTest003 reject");
})
done();
})
/*
* @tc.name:SensorJsTest004
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0040
* @tc.name: SensorGyroscopeJSTest004
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest004", 0, function () {
console.info('----------------------SensorJsTest004---------------------------');
it("SUB_SensorsSystem_Gyroscope_JSTest_0040", 0, function () {
console.info('----------------------SensorGyroscopeJSTest004---------------------------');
sensor.on(2, function () { }, { 'interval': 100000000 }, 5);
expect(true).assertTrue();
console.info('----------------------SensorJsTest004--------------------------- end');
console.info('----------------------SensorGyroscopeJSTest004--------------------------- end');
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0050
* @tc.name: SensorGyroscopeJSTest005
* @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_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorGyroscopeJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest005 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");
......@@ -225,18 +222,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest006
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0060
* @tc.name: SensorGyroscopeJSTest006
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest006", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_JSTest_0060", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest006 on success');
console.info('SensorGyroscopeJSTest006 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest006 on error');
console.info('SensorGyroscopeJSTest006 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -247,29 +243,27 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest007
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0070
* @tc.name: SensorGyroscopeJSTest007
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest007", 0, function () {
it("SUB_SensorsSystem_Gyroscope_JSTest_0070", 0, function () {
sensor.once(2, function () { }, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest008
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0080
* @tc.name: SensorGyroscopeJSTest008
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest008", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_JSTest_0080", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest008 off success');
console.info('SensorGyroscopeJSTest008 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest008 off error');
console.info('SensorGyroscopeJSTest008 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -280,18 +274,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest009
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0090
* @tc.name: SensorGyroscopeJSTest009
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest009", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_JSTest_0090", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest009 off success');
console.info('SensorGyroscopeJSTest009 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest009 off error');
console.info('SensorGyroscopeJSTest009 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -302,18 +295,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest010
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0100
* @tc.name: SensorGyroscopeJSTest010
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest010", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_JSTest_0100", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest010 off success');
console.info('SensorGyroscopeJSTest010 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest010 off error');
console.info('SensorGyroscopeJSTest010 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -324,18 +316,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest011
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0110
* @tc.name: SensorGyroscopeJSTest011
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest011", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_JSTest_0110", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest011 once success');
console.info('SensorGyroscopeJSTest011 once success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest011 once error');
console.info('SensorGyroscopeJSTest011 once error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -346,18 +337,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest012
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0120
* @tc.name: SensorGyroscopeJSTest012
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest012", 0, async function (done) {
it("SUB_SensorsSystem_Gyroscope_JSTest_0120", 0, async function (done) {
function onCallback(error) {
if (error) {
console.info('SensorJsTest012 on success');
console.info('SensorGyroscopeJSTest012 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest012 on error');
console.info('SensorGyroscopeJSTest012 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -368,37 +358,35 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest013
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0130
* @tc.name: SensorGyroscopeJSTest013
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest013", 0, function () {
it("SUB_SensorsSystem_Gyroscope_JSTest_0130", 0, function () {
sensor.off(2, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest014
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0140
* @tc.name: SensorGyroscopeJSTest014
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest014", 0, async function (done) {
console.info('----------------------SensorJsTest014---------------------------');
it("SUB_SensorsSystem_Gyroscope_JSTest_0140", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gyroscope_JSTest_0140---------------------------');
function offPromise2() {
return new Promise((resolve, reject) => {
sensor.off(2, (error) => {
if (error) {
console.info('SensorJsTest014 off2 success');
console.info('SensorGyroscopeJSTest014 off2 success');
expect(true).assertTrue();
setTimeout((err) => {
done();
reject(err)
}, 500);
} else {
console.info('SensorJsTest014 off2 error');
console.info('SensorGyroscopeJSTest014 off2 error');
expect(false).assertTrue();
setTimeout(() => {
done();
......@@ -413,13 +401,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.off(2, (error) => {
if (error) {
console.info('SensorJsTest014 off1 error');
console.info('SensorGyroscopeJSTest014 off1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 off1 success');
console.info('SensorGyroscopeJSTest014 off1 success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -432,13 +420,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(2, function (error, data) {
if (error) {
console.info('SensorJsTest014 on error');
console.info('SensorGyroscopeJSTest014 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 on success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest014 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");
......@@ -458,25 +447,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest015
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0150
* @tc.name: SensorGyroscopeJSTest015
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest015", 0, async function (done) {
console.info('----------------------SensorJsTest015---------------------------');
it("SUB_SensorsSystem_Gyroscope_JSTest_0150", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gyroscope_JSTest_0150---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(2, (error) => {
if (error) {
console.info('SensorJsTest015 off error');
console.info('SensorGyroscopeJSTest015 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 off success');
console.info('SensorGyroscopeJSTest015 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -490,13 +478,14 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.on(2, function (error, data) {
if (error) {
console.info('SensorJsTest015 on2 error');
console.info('SensorGyroscopeJSTest015 on2 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on2 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest015 on2 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");
......@@ -511,13 +500,14 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(2, function (error, data) {
if (error) {
console.info('SensorJsTest015 on1 error');
console.info('SensorGyroscopeJSTest015 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on1 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest015 on1 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");
......@@ -538,25 +528,24 @@ describe("SensorJsTest", function () {
/*
* @tc.name:SensorJsTest016
* @tc.number: SUB_SensorsSystem_Gyroscope_JSTest_0160
* @tc.name: SensorGyroscopeJSTest016
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest016", 0, async function (done) {
console.info('----------------------SensorJsTest016---------------------------');
it("SUB_SensorsSystem_Gyroscope_JSTest_0160", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Gyroscope_JSTest_0160---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(2, (error) => {
if (error) {
console.info('SensorJsTest016 off error');
console.info('SensorGyroscopeJSTest016 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 off success');
console.info('SensorGyroscopeJSTest016 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -570,13 +559,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.once(2, function (error, data) {
if (error) {
console.info('SensorJsTest016 once error');
console.info('SensorGyroscopeJSTest016 once error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 once success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest016 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");
......@@ -591,13 +580,13 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(2, function (error, data) {
if (error) {
console.info('SensorJsTest016 on1 error');
console.info('SensorGyroscopeJSTest016 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 on1 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorGyroscopeJSTest016 on1 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_JSTest_0010
* @tc.name: SensorMagneticFieldJSTest001
* @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_JSTest_0010", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Magnetic_Field_JSTest_0010---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, (error) => {
if (error) {
console.info('SensorJsTest001 off error');
console.info('SensorMagneticFieldJSTest001 off error');
expect(false).assertTrue();
console.info('setTimeout ..start')
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest001 off success');
console.info('SensorMagneticFieldJSTest001 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, function (error, data) {
if (error) {
console.info('SensorJsTest001 on error');
console.info('SensorMagneticFieldJSTest001 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('SensorMagneticFieldJSTest001 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,25 +101,24 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest001 reject");
console.info("SensorMagneticFieldJSTest001 reject");
})
done();
})
/*
* @tc.name:SensorJsTest002
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0020
* @tc.name: SensorMagneticFieldJSTest002
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest002", 0, async function (done) {
console.info('----------------------SensorJsTest002---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0020", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Magnetic_Field_JSTest_0020---------------------------');
function onSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest002 on success');
console.info('SensorMagneticFieldJSTest002 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest002 on error');
console.info('SensorMagneticFieldJSTest002 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -130,25 +129,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest003
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0030
* @tc.name: SensorMagneticFieldJSTest003
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest003", 0, async function (done) {
console.info('----------------------SensorJsTest003---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0030", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Magnetic_Field_JSTest_0030---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(6, (error) => {
if (error) {
console.info('SensorJsTest003 off error');
console.info('SensorMagneticFieldJSTest003 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 off success');
console.info('SensorMagneticFieldJSTest003 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -162,13 +160,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(6, function (error, data) {
if (error) {
console.info('SensorJsTest003 on error');
console.info('SensorMagneticFieldJSTest003 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest003 on success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest003 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");
......@@ -182,37 +181,36 @@ describe("SensorJsTest", function () {
await promise.then(() => {
return offPromise();
}, () => {
console.info("SensorJsTest003 reject");
console.info("SensorMagneticFieldJSTest003 reject");
})
done();
})
/*
* @tc.name:SensorJsTest004
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0040
* @tc.name: SensorMagneticFieldJSTest004
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest004", 0, function () {
console.info('----------------------SensorJsTest004---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0040", 0, function () {
console.info('----------------------SensorMagneticFieldJSTest004---------------------------');
sensor.on(6, function () { }, { 'interval': 100000000 }, 5);
expect(true).assertTrue();
console.info('----------------------SensorJsTest004--------------------------- end');
console.info('----------------------SensorMagneticFieldJSTest004--------------------------- end');
})
/*
* @tc.name:SensorJsTest005
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0050
* @tc.name: SensorMagneticFieldJSTest005
* @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_JSTest_0050", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest005 once error');
console.info('SensorMagneticFieldJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorJsTest005 once success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest005 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");
......@@ -225,18 +223,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest006
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0060
* @tc.name: SensorMagneticFieldJSTest006
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest006", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0060", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest006 on success');
console.info('SensorMagneticFieldJSTest006 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest006 on error');
console.info('SensorMagneticFieldJSTest006 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -247,29 +244,27 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest007
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0070
* @tc.name: SensorMagneticFieldJSTest007
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest007", 0, function () {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0070", 0, function () {
sensor.once(6, function () { }, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest008
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0080
* @tc.name: SensorMagneticFieldJSTest008
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest008", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0080", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest008 off success');
console.info('SensorMagneticFieldJSTest008 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest008 off error');
console.info('SensorMagneticFieldJSTest008 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -280,18 +275,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest009
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0090
* @tc.name: SensorMagneticFieldJSTest009
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest009", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0090", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest009 off success');
console.info('SensorMagneticFieldJSTest009 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest009 off error');
console.info('SensorMagneticFieldJSTest009 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -302,18 +296,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest010
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0100
* @tc.name: SensorMagneticFieldJSTest010
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest010", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0100", 0, async function (done) {
function offCallback(error) {
if (error) {
console.info('SensorJsTest010 off success');
console.info('SensorMagneticFieldJSTest010 off success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest010 off error');
console.info('SensorMagneticFieldJSTest010 off error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -324,18 +317,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest011
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0110
* @tc.name: SensorMagneticFieldJSTest011
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest011", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0110", 0, async function (done) {
function onceSensorCallback(error, data) {
if (error) {
console.info('SensorJsTest011 once success');
console.info('SensorMagneticFieldJSTest011 once success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest011 once error');
console.info('SensorMagneticFieldJSTest011 once error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -346,18 +338,17 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest012
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0120
* @tc.name: SensorMagneticFieldJSTest012
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest012", 0, async function (done) {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0120", 0, async function (done) {
function onCallback(error) {
if (error) {
console.info('SensorJsTest012 on success');
console.info('SensorMagneticFieldJSTest012 on success');
expect(true).assertTrue();
} else {
console.info('SensorJsTest012 on error');
console.info('SensorMagneticFieldJSTest012 on error');
expect(false).assertTrue();
}
setTimeout(() => {
......@@ -368,37 +359,35 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest013
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0130
* @tc.name: SensorMagneticFieldJSTest013
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest013", 0, function () {
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0130", 0, function () {
sensor.off(6, 5);
expect(true).assertTrue();
})
/*
* @tc.name:SensorJsTest014
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0140
* @tc.name: SensorMagneticFieldJSTest014
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest014", 0, async function (done) {
console.info('----------------------SensorJsTest014---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0140", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Magnetic_Field_JSTest_0140---------------------------');
function offPromise2() {
return new Promise((resolve, reject) => {
sensor.off(6, (error) => {
if (error) {
console.info('SensorJsTest014 off2 success');
console.info('SensorMagneticFieldJSTest014 off2 success');
expect(true).assertTrue();
setTimeout((err) => {
done();
reject(err)
}, 500);
} else {
console.info('SensorJsTest014 off2 error');
console.info('SensorMagneticFieldJSTest014 off2 error');
expect(false).assertTrue();
setTimeout(() => {
done();
......@@ -413,13 +402,13 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.off(6, (error) => {
if (error) {
console.info('SensorJsTest014 off1 error');
console.info('SensorMagneticFieldJSTest014 off1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 off1 success');
console.info('SensorMagneticFieldJSTest014 off1 success');
expect(true).assertTrue();
setTimeout(() => {
resolve();
......@@ -432,13 +421,14 @@ describe("SensorJsTest", function () {
let promise = new Promise((resolve, reject) => {
sensor.on(6, function (error, data) {
if (error) {
console.info('SensorJsTest014 on error');
console.info('SensorMagneticFieldJSTest014 on error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest014 on success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest014 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");
......@@ -458,25 +448,24 @@ describe("SensorJsTest", function () {
})
/*
* @tc.name:SensorJsTest015
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0150
* @tc.name: SensorMagneticFieldJSTest015
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest015", 0, async function (done) {
console.info('----------------------SensorJsTest015---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0150", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Magnetic_Field_JSTest_0150---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(6, (error) => {
if (error) {
console.info('SensorJsTest015 off error');
console.info('SensorMagneticFieldJSTest015 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 off success');
console.info('SensorMagneticFieldJSTest015 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -490,13 +479,14 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.on(6, function (error, data) {
if (error) {
console.info('SensorJsTest015 on2 error');
console.info('SensorMagneticFieldJSTest015 on2 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on2 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest015 on2 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");
......@@ -511,13 +501,14 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(6, function (error, data) {
if (error) {
console.info('SensorJsTest015 on1 error');
console.info('SensorMagneticFieldJSTest015 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest015 on1 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest015 on1 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");
......@@ -538,25 +529,24 @@ describe("SensorJsTest", function () {
/*
* @tc.name:SensorJsTest016
* @tc.number: SUB_SensorsSystem_Magnetic_Field_JSTest_0160
* @tc.name: SensorMagneticFieldJSTest016
* @tc.desc:verify app info is not null
* @tc.type: FUNC
* @tc.require: Issue Number
*/
it("SensorJsTest016", 0, async function (done) {
console.info('----------------------SensorJsTest016---------------------------');
it("SUB_SensorsSystem_Magnetic_Field_JSTest_0160", 0, async function (done) {
console.info('----------------------SUB_SensorsSystem_Magnetic_Field_JSTest_0160---------------------------');
function offPromise() {
return new Promise((resolve, reject) => {
sensor.off(6, (error) => {
if (error) {
console.info('SensorJsTest016 off error');
console.info('SensorMagneticFieldJSTest016 off error');
expect(false).assertTrue();
setTimeout((err) => {
done();
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 off success');
console.info('SensorMagneticFieldJSTest016 off success');
expect(true).assertTrue();
setTimeout(() => {
done();
......@@ -570,13 +560,14 @@ describe("SensorJsTest", function () {
return new Promise((resolve, reject) => {
sensor.once(6, function (error, data) {
if (error) {
console.info('SensorJsTest016 once error');
console.info('SensorMagneticFieldJSTest016 once error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 once success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest016 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");
......@@ -591,13 +582,14 @@ describe("SensorJsTest", function () {
let onPromise1 = new Promise((resolve, reject) => {
sensor.on(6, function (error, data) {
if (error) {
console.info('SensorJsTest016 on1 error');
console.info('SensorMagneticFieldJSTest016 on1 error');
expect(false).assertTrue();
setTimeout((err) => {
reject(err);
}, 500);
} else {
console.info('SensorJsTest016 on1 success x: ' + data.x + "y: " + data.y + "z: " + data.z);
console.info('SensorMagneticFieldJSTest016 on1 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.
先完成此消息的编辑!
想要评论请 注册