提交 6967b2e5 编写于 作者: L lidanyang16

<lidanyang16@huawei.com>

Signed-off-by: Nlidanyang16 <lidanyang16@huawei.com>
上级 b7f12c2c
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
import VibratorJsTest_misc_1 from './Vibrator_old.test.js' import VibratorJsTest_misc_1 from './Vibrator_old.test.js'
import VibratorJsTest_misc_2 from './Vibrator_new_common.test.js' import VibratorJsTest_misc_2 from './Vibrator_new_common.test.js'
import VibratorJsTest_misc_3 from './Vibrator_newSupplement_common.test.js' import VibratorJsTest_misc_3 from './Vibrator_newSupplement_common.test.js'
import VibratorJsTest_misc_6 from './Vibrator_newSupportTest.js' import VibratorJsTest_misc_6 from './Vibrator_newSupportTest.test.js'
import VibratorJsTest_misc_7 from './Vibrator_options.test.js'
export default function testsuite() { export default function testsuite() {
VibratorJsTest_misc_1() VibratorJsTest_misc_1()
VibratorJsTest_misc_2() VibratorJsTest_misc_2()
VibratorJsTest_misc_3() VibratorJsTest_misc_3()
VibratorJsTest_misc_6() VibratorJsTest_misc_6()
VibratorJsTest_misc_7()
} }
...@@ -44,7 +44,7 @@ describe("SensorJsTest_sensor_40", function () { ...@@ -44,7 +44,7 @@ describe("SensorJsTest_sensor_40", function () {
/* /*
* @tc.setup: setup invoked before all testcases * @tc.setup: setup invoked before all testcases
*/ */
console.info('beforeAll caled') console.info('beforeAll called')
}) })
afterAll(function () { afterAll(function () {
...@@ -52,7 +52,7 @@ describe("SensorJsTest_sensor_40", function () { ...@@ -52,7 +52,7 @@ describe("SensorJsTest_sensor_40", function () {
/* /*
* @tc.teardown: teardown invoked after all testcases * @tc.teardown: teardown invoked after all testcases
*/ */
console.info('afterAll caled') console.info('afterAll called')
}) })
beforeEach(function () { beforeEach(function () {
...@@ -60,7 +60,7 @@ describe("SensorJsTest_sensor_40", function () { ...@@ -60,7 +60,7 @@ describe("SensorJsTest_sensor_40", function () {
/* /*
* @tc.setup: setup invoked before each testcases * @tc.setup: setup invoked before each testcases
*/ */
console.info('beforeEach caled') console.info('beforeEach called')
}) })
afterEach(function () { afterEach(function () {
...@@ -68,7 +68,7 @@ describe("SensorJsTest_sensor_40", function () { ...@@ -68,7 +68,7 @@ describe("SensorJsTest_sensor_40", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled') console.info('afterEach called')
}) })
const PARAMETER_ERROR_CODE = 401 const PARAMETER_ERROR_CODE = 401
......
...@@ -23,7 +23,7 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -23,7 +23,7 @@ describe("SensorJsTest_sensor_35", function () {
/* /*
* @tc.setup: setup invoked before all testcases * @tc.setup: setup invoked before all testcases
*/ */
console.info('beforeAll caled') console.info('beforeAll called')
}) })
afterAll(function () { afterAll(function () {
...@@ -31,7 +31,7 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -31,7 +31,7 @@ describe("SensorJsTest_sensor_35", function () {
/* /*
* @tc.teardown: teardown invoked after all testcases * @tc.teardown: teardown invoked after all testcases
*/ */
console.info('afterAll caled') console.info('afterAll called')
}) })
beforeEach(function () { beforeEach(function () {
...@@ -39,7 +39,7 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -39,7 +39,7 @@ describe("SensorJsTest_sensor_35", function () {
/* /*
* @tc.setup: setup invoked before each testcases * @tc.setup: setup invoked before each testcases
*/ */
console.info('beforeEach caled') console.info('beforeEach called')
}) })
afterEach(function () { afterEach(function () {
...@@ -47,7 +47,7 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -47,7 +47,7 @@ describe("SensorJsTest_sensor_35", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled') console.info('afterEach called')
}) })
let errMessage; let errMessage;
...@@ -63,7 +63,6 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -63,7 +63,6 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest001",TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) { it("getSensorLists_SensorJsTest001",TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest001----------------------------------");
sensor.getSensorList().then((data) => { sensor.getSensorList().then((data) => {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest001 " + JSON.stringify(data[i])); console.info("getSensorLists_SensorJsTest001 " + JSON.stringify(data[i]));
...@@ -81,7 +80,6 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -81,7 +80,6 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest002", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("getSensorLists_SensorJsTest002", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest002----------------------------------");
sensor.getSensorList((error, data) => { sensor.getSensorList((error, data) => {
if (error) { if (error) {
console.info('getSensorLists_SensorJsTest002 error'); console.info('getSensorLists_SensorJsTest002 error');
...@@ -101,9 +99,8 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -101,9 +99,8 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest003", 0, async function (done) { it("getSensorLists_SensorJsTest003", 0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest003----------------------------------");
sensor.getSensorList(null).then(data => { sensor.getSensorList(null).then(data => {
console.info("---------------------------getSensorLists_SensorJsTest003 callback in-----------" + data.length); console.info("--getSensorLists_SensorJsTest003 callback in--" + data.length);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest003 " + JSON.stringify(data[i])); console.info("getSensorLists_SensorJsTest003 " + JSON.stringify(data[i]));
} }
...@@ -122,9 +119,8 @@ describe("SensorJsTest_sensor_35", function () { ...@@ -122,9 +119,8 @@ describe("SensorJsTest_sensor_35", function () {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest004", 0, async function (done) { it("getSensorLists_SensorJsTest004", 0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest004----------------------------------");
sensor.getSensorList(errMessage).then(data => { sensor.getSensorList(errMessage).then(data => {
console.info("---------------------------getSensorLists_SensorJsTest004 callback in-----------" + data.length); console.info("--getSensorLists_SensorJsTest004 callback in--" + data.length);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest004 " + JSON.stringify(data[i])); console.info("getSensorLists_SensorJsTest004 " + JSON.stringify(data[i]));
} }
...@@ -143,9 +139,8 @@ it("getSensorLists_SensorJsTest004", 0, async function (done) { ...@@ -143,9 +139,8 @@ it("getSensorLists_SensorJsTest004", 0, async function (done) {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest005", 0, async function (done) { it("getSensorLists_SensorJsTest005", 0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest005----------------------------------");
sensor.getSensorList('xxx').then(data => { sensor.getSensorList('xxx').then(data => {
console.info("---------------------------getSensorLists_SensorJsTest005 callback in-----------" + data.length); console.info("--getSensorLists_SensorJsTest005 callback in--" + data.length);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest005 " + JSON.stringify(data[i])); console.info("getSensorLists_SensorJsTest005 " + JSON.stringify(data[i]));
} }
...@@ -164,16 +159,15 @@ it("getSensorLists_SensorJsTest005", 0, async function (done) { ...@@ -164,16 +159,15 @@ it("getSensorLists_SensorJsTest005", 0, async function (done) {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest006", 0, async function (done) { it("getSensorLists_SensorJsTest006", 0, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest006----------------------------------");
sensor.getSensorList(invild).then(data => { sensor.getSensorList(invild).then(data => {
console.info("---------------------------getSensorLists_SensorJsTest006 callback in-----------" + data.length); console.info("--getSensorLists_SensorJsTest006 callback in--" + data.length);
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest006 " + JSON.stringify(data[i])); console.info("getSensorLists_SensorJsTest006 " + JSON.stringify(data[i]));
} }
expect(true).assertTrue(); expect(true).assertTrue();
done(); done();
}, (error) => { }, (error) => {
console.info('getSensorLists_SensorJsTest006 failed'); console.info('getSensorLists_SensorJsTest006 failed'+error);
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}); });
...@@ -185,7 +179,6 @@ it("getSensorLists_SensorJsTest005", 0, async function (done) { ...@@ -185,7 +179,6 @@ it("getSensorLists_SensorJsTest005", 0, async function (done) {
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("getSensorLists_SensorJsTest007", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("getSensorLists_SensorJsTest007", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("---------------------------getSensorLists_SensorJsTest007----------------------------------");
try { try {
sensor.getSensorList(invild).then(data => { sensor.getSensorList(invild).then(data => {
console.info("getSensorLists_SensorJsTest007 " + JSON.stringify(data)); console.info("getSensorLists_SensorJsTest007 " + JSON.stringify(data));
...@@ -203,4 +196,44 @@ it("getSensorLists_SensorJsTest005", 0, async function (done) { ...@@ -203,4 +196,44 @@ it("getSensorLists_SensorJsTest005", 0, async function (done) {
done(); done();
} }
}) })
/**
* @tc.number:SUB_SensorsSystem_GetSensorLists_JSTest_0080
* @tc.name: getSensorLists_SensorJsTest008
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it("getSensorLists_SensorJsTest008", 0, async function (done) {
sensor.getSensorList(undefined).then((data) => {
console.info("--getSensorLists_SensorJsTest008 callback in--" + data.length);
for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest008 " + JSON.stringify(data[i]));
}
expect(true).assertTrue();
done();
}, (error) => {
console.info('getSensorLists_SensorJsTest008 failed');
expect(false).assertTrue();
done();
});
})
/**
* @tc.number:SUB_SensorsSystem_GetSensorLists_JSTest_0090
* @tc.name: getSensorLists_SensorJsTest009
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it("getSensorLists_SensorJsTest009", 0, async function (done) {
sensor.getSensorList(null).then((data) => {
console.info("----------getSensorLists_SensorJsTest009 callback in-----" + data.length);
for (let i = 0; i < data.length; i++) {
console.info("getSensorLists_SensorJsTest009 " + JSON.stringify(data[i]));
}
expect(true).assertTrue();
done();
}, (error) => {
console.info('getSensorLists_SensorJsTest009 failed');
expect(false).assertTrue();
done();
});
})
})} })}
...@@ -23,7 +23,7 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -23,7 +23,7 @@ describe("SensorJsTest_sensor_36", function () {
/* /*
* @tc.setup: setup invoked before all testcases * @tc.setup: setup invoked before all testcases
*/ */
console.info('beforeAll caled') console.info('beforeAll called')
}) })
afterAll(function () { afterAll(function () {
...@@ -31,7 +31,7 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -31,7 +31,7 @@ describe("SensorJsTest_sensor_36", function () {
/* /*
* @tc.teardown: teardown invoked after all testcases * @tc.teardown: teardown invoked after all testcases
*/ */
console.info('afterAll caled') console.info('afterAll called')
}) })
beforeEach(function () { beforeEach(function () {
...@@ -39,7 +39,7 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -39,7 +39,7 @@ describe("SensorJsTest_sensor_36", function () {
/* /*
* @tc.setup: setup invoked before each testcases * @tc.setup: setup invoked before each testcases
*/ */
console.info('beforeEach caled') console.info('beforeEach called')
}) })
afterEach(function () { afterEach(function () {
...@@ -47,7 +47,7 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -47,7 +47,7 @@ describe("SensorJsTest_sensor_36", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled') console.info('afterEach called')
}) })
let invild; let invild;
...@@ -90,10 +90,10 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -90,10 +90,10 @@ describe("SensorJsTest_sensor_36", function () {
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0020 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0020
* @tc.name: GetSingleSensor_JSTest_002 * @tc.name: GetSingleSensor_JSTest_002
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('GetSingleSensor_JSTest_002', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it('GetSingleSensor_JSTest_002', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------GetSingleSensor_JSTest_002-------------------------"); console.info("------------------GetSingleSensor_JSTest_002-------------------------");
try { try {
...@@ -107,10 +107,10 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -107,10 +107,10 @@ describe("SensorJsTest_sensor_36", function () {
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0030 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0030
* @tc.name: GetSingleSensor_JSTest_003 * @tc.name: GetSingleSensor_JSTest_003
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('GetSingleSensor_JSTest_003', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it('GetSingleSensor_JSTest_003', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------GetSingleSensor_JSTest_003-------------------------"); console.info("------------------GetSingleSensor_JSTest_003-------------------------");
try { try {
...@@ -143,11 +143,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -143,11 +143,11 @@ describe("SensorJsTest_sensor_36", function () {
} }
}) })
/** /**
* @tc.number: SUB_SensorsSystem_GetSingleSensor_JSTest_0040 * @tc.number: SUB_SensorsSystem_GetSingleSensor_JSTest_0040
* @tc.name: GetSingleSensor_JSTest_004 * @tc.name: GetSingleSensor_JSTest_004
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('GetSingleSensor_JSTest_004', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it('GetSingleSensor_JSTest_004', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------GetSingleSensor_JSTest_004-------------------------"); console.info("------------------GetSingleSensor_JSTest_004-------------------------");
try { try {
...@@ -180,11 +180,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -180,11 +180,11 @@ describe("SensorJsTest_sensor_36", function () {
} }
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0050 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0050
* @tc.name: GetSingleSensor_JSTest_005 * @tc.name: GetSingleSensor_JSTest_005
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('GetSingleSensor_JSTest_005', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it('GetSingleSensor_JSTest_005', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------GetSingleSensor_JSTest_005-------------------------"); console.info("------------------GetSingleSensor_JSTest_005-------------------------");
try { try {
...@@ -207,11 +207,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -207,11 +207,11 @@ describe("SensorJsTest_sensor_36", function () {
} }
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0060 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0060
* @tc.name: GetSingleSensor_JSTest_006 * @tc.name: GetSingleSensor_JSTest_006
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('GetSingleSensor_JSTest_006', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it('GetSingleSensor_JSTest_006', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------GetSingleSensor_JSTest_006-------------------------"); console.info("------------------GetSingleSensor_JSTest_006-------------------------");
try { try {
...@@ -225,10 +225,10 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -225,10 +225,10 @@ describe("SensorJsTest_sensor_36", function () {
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0070 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0070
* @tc.name: GetSingleSensor_JSTest_007 * @tc.name: GetSingleSensor_JSTest_007
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it('GetSingleSensor_JSTest_007', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it('GetSingleSensor_JSTest_007', TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------GetSingleSensor_JSTest_007-------------------------"); console.info("------------------GetSingleSensor_JSTest_007-------------------------");
try { try {
...@@ -260,11 +260,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -260,11 +260,11 @@ describe("SensorJsTest_sensor_36", function () {
} }
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0080 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0080
* @tc.name: GetSingleSensor_JSTest_008 * @tc.name: GetSingleSensor_JSTest_008
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("GetSingleSensor_JSTest_008", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("GetSingleSensor_JSTest_008", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("------------------------GetSingleSensor_JSTest_008------------------"); console.info("------------------------GetSingleSensor_JSTest_008------------------");
try { try {
...@@ -284,11 +284,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -284,11 +284,11 @@ describe("SensorJsTest_sensor_36", function () {
} }
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0090 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0090
* @tc.name: GetSingleSensor_JSTest_009 * @tc.name: GetSingleSensor_JSTest_009
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("GetSingleSensor_JSTest_009", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("GetSingleSensor_JSTest_009", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("-------------------GetSingleSensor_JSTest_009----------------------"); console.info("-------------------GetSingleSensor_JSTest_009----------------------");
sensor.getSingleSensor(sensor.SensorId.ACCELEROMETER).then((data) => { sensor.getSingleSensor(sensor.SensorId.ACCELEROMETER).then((data) => {
...@@ -310,11 +310,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -310,11 +310,11 @@ describe("SensorJsTest_sensor_36", function () {
}); });
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0100 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0100
* @tc.name: GetSingleSensor_JSTest_010 * @tc.name: GetSingleSensor_JSTest_010
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("GetSingleSensor_JSTest_010", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("GetSingleSensor_JSTest_010", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("----------------GetSingleSensor_JSTest_010-----------------------"); console.info("----------------GetSingleSensor_JSTest_010-----------------------");
try { try {
...@@ -332,11 +332,11 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -332,11 +332,11 @@ describe("SensorJsTest_sensor_36", function () {
} }
}) })
/** /**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0110 * @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0110
* @tc.name: GetSingleSensor_JSTest_011 * @tc.name: GetSingleSensor_JSTest_011
* @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.desc: Verification results of the incorrect parameters of the test interface.
*/ */
it("GetSingleSensor_JSTest_011", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("GetSingleSensor_JSTest_011", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) {
console.info("-------------------GetSingleSensor_JSTest_011----------------------"); console.info("-------------------GetSingleSensor_JSTest_011----------------------");
try { try {
...@@ -348,4 +348,55 @@ describe("SensorJsTest_sensor_36", function () { ...@@ -348,4 +348,55 @@ describe("SensorJsTest_sensor_36", function () {
done(); done();
} }
}) })
/**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0120
* @tc.name: GetSingleSensor_JSTest_012
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it("GetSingleSensor_JSTest_012", 0, async function (done) {
sensor.getSingleSensor(sensor.SensorId.ACCELEROMETER, undefined).then((data) => {
console.info("GetSingleSensor_JSTest_012 " + JSON.stringify(data));
expect(true).assertTrue();
done();
}, (error) => {
console.info('GetSingleSensor_JSTest_012 failed');
expect(false).assertTrue();
done();
});
})
/**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0130
* @tc.name: GetSingleSensor_JSTest_013
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it("GetSingleSensor_JSTest_013", 0, async function (done) {
sensor.getSingleSensor(sensor.SensorId.ACCELEROMETER, null).then((data) => {
console.info("GetSingleSensor_JSTest_013 " + JSON.stringify(data));
expect(true).assertTrue();
done();
}, (error) => {
console.info('GetSingleSensor_JSTest_013 failed');
expect(false).assertTrue();
done();
});
})
/**
* @tc.number:SUB_SensorsSystem_GetSingleSensor_JSTest_0140
* @tc.name: GetSingleSensor_JSTest_014
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it("GetSingleSensor_JSTest_014", 0, async function (done) {
sensor.getSingleSensor(sensor.SensorId.ACCELEROMETER, "abc").then((data) => {
console.info("GetSingleSensor_JSTest_014 " + JSON.stringify(data));
expect(true).assertTrue();
done();
}, (error) => {
console.info('GetSingleSensor_JSTest_014 failed');
expect(false).assertTrue();
done();
});
})
})} })}
...@@ -44,7 +44,7 @@ describe("SensorJsTest_sensor_44", function () { ...@@ -44,7 +44,7 @@ describe("SensorJsTest_sensor_44", function () {
/* /*
* @tc.setup: setup invoked before all testcases * @tc.setup: setup invoked before all testcases
*/ */
console.info('beforeAll caled') console.info('beforeAll called')
}) })
afterAll(function () { afterAll(function () {
...@@ -52,7 +52,7 @@ describe("SensorJsTest_sensor_44", function () { ...@@ -52,7 +52,7 @@ describe("SensorJsTest_sensor_44", function () {
/* /*
* @tc.teardown: teardown invoked after all testcases * @tc.teardown: teardown invoked after all testcases
*/ */
console.info('afterAll caled') console.info('afterAll called')
}) })
beforeEach(function () { beforeEach(function () {
...@@ -60,7 +60,7 @@ describe("SensorJsTest_sensor_44", function () { ...@@ -60,7 +60,7 @@ describe("SensorJsTest_sensor_44", function () {
/* /*
* @tc.setup: setup invoked before each testcases * @tc.setup: setup invoked before each testcases
*/ */
console.info('beforeEach caled') console.info('beforeEach called')
}) })
afterEach(function () { afterEach(function () {
...@@ -68,7 +68,7 @@ describe("SensorJsTest_sensor_44", function () { ...@@ -68,7 +68,7 @@ describe("SensorJsTest_sensor_44", function () {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
console.info('afterEach caled') console.info('afterEach called')
}) })
const PARAMETER_ERROR_CODE = 401 const PARAMETER_ERROR_CODE = 401
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册