提交 f107d972 编写于 作者: Q qu-xianfei

add new device_attest testcase

Signed-off-by: Nqu-xianfei <quxianfei@huawei.com>
Change-Id: I97be992a8e42b6734b34e09a930d84f7044fabb9
上级 18bfb13a
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -39,7 +39,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
*/
it('SUB_GRAPHIC_ENUMCOLORSPACE_JSAPI_001', 0, async function (done) {
console.info('test the enum value of attestResultInfo begin');
try{
try {
deviceAttest.getAttestStatus().then(attestResultInfo => {
console.info("!!!====>[FormComponent]1:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual("");
......@@ -47,14 +47,14 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
expect(attestResultInfo.softwareResultDetail).assertEqual("");
expect(attestResultInfo.ticket).assertEqual("");
done();
} ,err => {
console.info("!!!====>[FormComponent]1:error_1====>" + JSON.stringify(err));
expect(err.code == 202).assertTrue();
done();
} ,err => {
console.info("!!!====>[FormComponent]1:error_1====>" + JSON.stringify(err));
expect(err.code == 202).assertTrue();
done();
})
} catch(err) {
console.info("!!!====>[FormComponent]1:error_2====>" + JSON.stringify(err));
expect(err.code == 202).assetTrue();
expect(err.code == 202).assertTrue();
done();
}
})
......@@ -65,27 +65,26 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
* @tc.desc 202 - Not System App. Interface caller is not a system app.
*/
it('SUB_GRAPHIC_ENUMCOLORSPACE_JSAPI_002', 0, async function (done) {
console.info('test the enum value of attestResultInfo begin');
try{
deviceAttest.getAttestStatus(async (err, attestResultInfo) => {
if(err){
console.info("!!!====>[FormComponent]2:error_1====>" + JSON.stringify(err));
expect(err.code == 202).assertTrue();
}
else{
console.info("!!!====>[FormComponent]2:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual("");
expect(attestResultInfo.softwareResult).assertEqual("");
expect(attestResultInfo.softwareResultDetail).assertEqual("");
expect(attestResultInfo.ticket).assertEqual("");
}
done();
});
} catch(err) {
console.info("!!!====>[FormComponent]2:error_2====>" + JSON.stringify(err));
expect(err.code == 202).assetTrue();
console.info('test the enum value of attestResultInfo begin');
try{
deviceAttest.getAttestStatus(async (err, attestResultInfo) => {
if (err) {
console.info("!!!====>[FormComponent]2:error_1====>" + JSON.stringify(err));
expect(err.code == 202).assertTrue();
} else {
console.info("!!!====>[FormComponent]2:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual("");
expect(attestResultInfo.softwareResult).assertEqual("");
expect(attestResultInfo.softwareResultDetail).assertEqual("");
expect(attestResultInfo.ticket).assertEqual("");
}
done();
}
});
} catch(err) {
console.info("!!!====>[FormComponent]2:error_2====>" + JSON.stringify(err));
expect(err.code == 202).assertTrue();
done();
}
})
/**
......@@ -94,26 +93,25 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
* @tc.desc 202 - Not System App. Interface caller is not a system app.
*/
it('SUB_GRAPHIC_ENUMCOLORSPACE_JSAPI_003', 0, async function (done) {
console.info('test the enum value of attestResultInfo begin');
try{
let attestResultInfo = deviceAttest.getAttestStatusSync();
if(attestResultInfo != null){
console.info("!!!====>[FormComponent]3:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual("");
expect(attestResultInfo.softwareResult).assertEqual("");
expect(attestResultInfo.softwareResultDetail).assertEqual("");
expect(attestResultInfo.ticket).assertEqual("");
}
else{
console.info("!!!====>[FormComponent]3:error_1====>");
expect().assetTrue();
}
done();
} catch(err) {
console.info("!!!====>[FormComponent]3:error_2====>" + JSON.stringify(err));
expect(err.code).assertEqual(202);
done();
console.info('test the enum value of attestResultInfo begin');
try{
let attestResultInfo = deviceAttest.getAttestStatusSync();
if (attestResultInfo != null) {
console.info("!!!====>[FormComponent]3:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual("");
expect(attestResultInfo.softwareResult).assertEqual("");
expect(attestResultInfo.softwareResultDetail).assertEqual("");
expect(attestResultInfo.ticket).assertEqual("");
} else {
console.info("!!!====>[FormComponent]3:error_1====>");
expect().assertTrue();
}
done();
} catch(err) {
console.info("!!!====>[FormComponent]3:error_2====>" + JSON.stringify(err));
expect(err.code).assertEqual(202);
done();
}
})
})
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册