提交 c17f7935 编写于 作者: L logic42

change miscdevice testcase

Signed-off-by: Nlogic42 <wanglong108@huawei.com>
上级 ded8a667
...@@ -15,7 +15,14 @@ import("//build/ohos_var.gni") ...@@ -15,7 +15,14 @@ import("//build/ohos_var.gni")
group("sensor") { group("sensor") {
testonly = true testonly = true
if (device_name == "rk3568") { if (device_name == "m40") {
if (is_standard_system) {
deps = [ "sensor_standard:sensor_js_test" ]
}
} else if (device_name == "rk3568") {
if (is_standard_system) {
deps = [ "sensor_standard:sensor_js_test" ]
}
} else { } else {
if (is_standard_system) { if (is_standard_system) {
deps = [ "sensor_standard:sensor_js_test" ] deps = [ "sensor_standard:sensor_js_test" ]
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
import("//test/xts/tools/build/suite.gni") import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("sensor_js_test") { ohos_js_hap_suite("miscdevice_js_test") {
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
deps = [ deps = [
":sensor_js_assets", ":miscdevice_js_assets",
":sensor_js_resources", ":miscdevice_js_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsSensorJSApiTest" hap_name = "ActsmiscdeviceJSApiTest"
} }
ohos_js_assets("sensor_js_assets") { ohos_js_assets("miscdevice_js_assets") {
source_dir = "./src/main/js/default" source_dir = "./src/main/js/default"
} }
ohos_resources("sensor_js_resources") { ohos_resources("miscdevice_js_resources") {
sources = [ "./src/main/resources" ] sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json" hap_profile = "./src/main/config.json"
} }
{ {
"description": "Configuration for sensor js api Tests", "description": "Configuration for miscdevice js api Tests",
"driver": { "driver": {
"type": "JSUnitTest", "type": "JSUnitTest",
"test-timeout": "160000", "test-timeout": "160000",
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
"kits": [ "kits": [
{ {
"test-file-name": [ "test-file-name": [
"ActsSensorJSApiTest.hap" "ActsmiscdeviceJSApiTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
} }
] ]
} }
\ No newline at end of file
...@@ -232,7 +232,7 @@ describe("VibratorJsTest", function () { ...@@ -232,7 +232,7 @@ describe("VibratorJsTest", function () {
* @tc.require: Issue Number * @tc.require: Issue Number
*/ */
it("VibratorJsTest009", 0, async function (done) { it("VibratorJsTest009", 0, async function (done) {
console.info('----------------------SensorJsTest001---------------------------'); console.info('----------------------VibratorJsTest001---------------------------');
function stopPromise() { function stopPromise() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
vibrator.stop("time", (error) => { vibrator.stop("time", (error) => {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"string": [ "string": [
{ {
"name": "app_name", "name": "app_name",
"value": "SensorJSApiTest" "value": "miscdeviceJSApiTest"
}, },
{ {
"name": "mainability_description", "name": "mainability_description",
......
...@@ -55,8 +55,12 @@ describe('SystemParameterTest', function () { ...@@ -55,8 +55,12 @@ describe('SystemParameterTest', function () {
console.info('SUB_SENSORS_Sensor_JSTest_0010 start'); console.info('SUB_SENSORS_Sensor_JSTest_0010 start');
await sensor.on(0, function (error, data) { await sensor.on(0, function (error, data) {
if (error) { if (error) {
console.info('testRegisterSensortest001 on error'); if (error.code == -1) {
expect(false).assertTrue(); console.info("testRegisterSensortest001 on error: sensor 0 not exit")
} else {
console.info('testRegisterSensortest001 on error :' + error.code);
expect(false).assertTrue();
}
done(); done();
} else { } else {
console.info('testRegisterSensortest001 on success'); console.info('testRegisterSensortest001 on success');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册