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

!8723 【Openharmony4.0.7.2】【master分支】【sensor子系统】【ToC】【RK3568】【必现】新增可选参数用例

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