提交 52946d80 编写于 作者: H hu-jixiang1 提交者: 胡吉翔

fixed 8c7f772b from https://gitee.com/hu-jixiang1/xts_acts/pulls/2596

hujixiang1@huawei.com
Signed-off-by: Nhu-jixiang1 <hujixiang1@huawei.com>
Change-Id: I5780d24938ea2b1def1f4711e17ac1d8e993f677
上级 d5d54be2
...@@ -35,411 +35,46 @@ describe('userAuthTest', function () { ...@@ -35,411 +35,46 @@ describe('userAuthTest', function () {
}) })
/** /**
* @tc.name execute_authentication_callback_failed * @tc.name execute_authentication_callback_ALL_NO_SUPPORT
* @tc.number JSAPI_Function_Execute_0100 * @tc.number JSAPI_Function_Execute_1700
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0100', 0, function (done) {
console.log("JSAPI_Function_Execute_0100 start");
index.default.fileSave('JSAPI_Function_Execute_0100','1','18 0 0 0 0 0 0 0 0 0 0')
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0100 auth.execute:" + data);
// COMPARE_FAILURE(1)
expect(data).assertEqual(1);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0100 end");
})
/**
* @tc.name execute_authentication_callback_timeout
* @tc.number JSAPI_Function_Execute_0200
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0200', 0, function (done) {
console.log("JSAPI_Function_Execute_0200 start");
index.default.fileSave('JSAPI_Function_Execute_0200','1','18 6 0 0 0 0 0 0 0 0 0')
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0200 auth.execute:" + data);
// TIMEOUT (3)
expect(data).assertEqual(3);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0200 end");
})
/**
* @tc.name execute_authentication_callback_camera_fail
* @tc.number JSAPI_Function_Execute_0300
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0300', 0, function (done) {
console.log("JSAPI_Function_Execute_0300 start");
index.default.fileSaveB('JSAPI_Function_Execute_0300','903')
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0300 auth.execute:" + data);
// CAMERA_FAIL(4)
expect(data).assertEqual(4);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0300 end");
})
/**
* @tc.name execute_authentication_callback_busy
* @tc.number JSAPI_Function_Execute_0400
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0400', 0, function (done) {
console.log("JSAPI_Function_Execute_0400 start");
waitFlag = true;
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0400 auth.execute1:" + data);
})
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0400 auth.execute2:" + data);
// BUSY(5)
expect(data).assertEqual(5);
setTimeout(function() {
done();
}, 3000);
})
console.log("JSAPI_Function_Execute_0400 end");
})
/**
* @tc.name execute_authentication_callback_LOCKED
* @tc.number JSAPI_Function_Execute_0500
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0500', 0, function (done) {
console.log("JSAPI_Function_Execute_0500 start");
const auth = userAuth.getAuthenticator();
// exe 1~5
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
new Promise(function(resolve, reject) {
resolve();
}).then(
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0500 auth.execute1:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0500 auth.execute2:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0500 auth.execute3:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0500 auth.execute4:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0500 auth.execute5:" + data);
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0500 auth.execute6:" + data);
// LOCKED(7)
expect(data).assertEqual(7);
setTimeout(function() {
console.log("JSAPI_Function_Execute_0500 end wait 30m");
done();
}, 1);
})
})
})
})
})
})
);
console.log("JSAPI_Function_Execute_0500 end");
})
/**
* @tc.name execute_authentication_callback_NOT_ENROLLED
* @tc.number JSAPI_Function_Execute_0600
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0600', 0, function (done) {
console.log("JSAPI_Function_Execute_0600 start");
waitFlag = false;
index.default.fileSave('JSAPI_Function_Execute_0800','1','18 9 0 0 0 0 0 0 0 0 0');
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0600 auth.execute:" + data);
// NOT_ENROLLED(8)
expect(data).assertEqual(8);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0600 end");
})
/**
* @tc.name execute_authentication_callback_GENERAL_ERROR
* @tc.number JSAPI_Function_Execute_0700
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0700', 0, function (done) {
console.log("JSAPI_Function_Execute_0700 start");
index.default.fileSave('JSAPI_Function_Execute_0700','1','18 4 0 0 0 0 0 0 0 0 0')
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2", function(data) {
console.log("JSAPI_Function_Execute_0700 auth.execute:" + data);
// GENERAL_ERROR(100)
expect(data).assertEqual(100);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0700 end");
})
/**
* @tc.name execute_authentication_promise_COMPARE_FAILURE
* @tc.number JSAPI_Function_Execute_0800
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0800', 0, function (done) {
console.log("JSAPI_Function_Execute_0800 start");
index.default.fileSave('JSAPI_Function_Execute_0800','1','18 0 0 0 0 0 0 0 0 0 0')
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_0800 auth.execute:" + data);
// COMPARE_FAILURE(1)
expect(data).assertEqual(1);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0800 end");
})
/**
* @tc.name execute_authentication_promise_TIMEOUT
* @tc.number JSAPI_Function_Execute_0900
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_0900', 0, function (done) {
console.log("JSAPI_Function_Execute_0900 start");
index.default.fileSave('JSAPI_Function_Execute_0800','1','18 6 0 0 0 0 0 0 0 0 0');
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_0900 auth.execute:" + data);
// TIMEOUT (3)
expect(data).assertEqual(3);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_0900 end");
})
/**
* @tc.name execute_authentication_promise_CAMERA_FAIL
* @tc.number JSAPI_Function_Execute_1000
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_1000', 0, function (done) {
console.log("JSAPI_Function_Execute_1000 start");
index.default.fileSaveB('JSAPI_Function_Execute_1000','903')
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1000 auth.execute:" + data);
// CAMERA_FAIL(4)
expect(data).assertEqual(4);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_1000 end");
})
/**
* @tc.name execute_authentication_promise_BUSY
* @tc.number JSAPI_Function_Execute_1100
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_1100', 0, function (done) {
console.log("JSAPI_Function_Execute_1100 start");
waitFlag = true;
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1100 auth.execute1:" + data);
});
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1100 auth.execute2:" + data);
// BUSY(5)
expect(data).assertEqual(5);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_1100 end");
})
/**
* @tc.name execute_authentication_promise_LOCKED
* @tc.number JSAPI_Function_Execute_1200
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_1200', 0, function (done) {
console.log("JSAPI_Function_Execute_1200 start");
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
const auth = userAuth.getAuthenticator();
// exe 1~5
new Promise(function(resolve, reject) {
resolve();
}).then(
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1200 auth.execute1:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1200 auth.execute2:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1200 auth.execute3:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1200 auth.execute4:" + data);
index.default.fileSave('JSAPI_Function_Execute_0500','1','18 0 0 0 0 0 0 0 0 0 0')
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1200 auth.execute5:" + data);
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1200 auth.execute6:" + data);
// LOCKED(7)
expect(data).assertEqual(7);
setTimeout(function() {
done();
}, 1);
});
})
})
})
})
})
);
console.log("JSAPI_Function_Execute_1200 end");
})
/**
* @tc.name execute_authentication_promise_NOT_ENROLLED
* @tc.number JSAPI_Function_Execute_1300
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_1300', 0, function (done) {
console.log("JSAPI_Function_Execute_1300 start");
waitFlag = false;
index.default.fileSave('JSAPI_Function_Execute_0800','1','18 9 0 0 0 0 0 0 0 0 0');
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1300 auth.execute:" + data);
// NOT_ENROLLED(8)
expect(data).assertEqual(8);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_1300 end");
})
/**
* @tc.name execute_authentication_promise_GENERAL_ERROR
* @tc.number JSAPI_Function_Execute_1400
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type FUNC * @tc.type FUNC
* @tc.level Level2 * @tc.level Level2
*/ */
it('JSAPI_Function_Execute_1400', 0, function (done) { it('JSAPI_Function_Execute_1700', 0, function (done) {
console.log("JSAPI_Function_Execute_1400 start"); console.log("JSAPI_Function_Execute_1700 start");
index.default.fileSave('JSAPI_Function_Execute_1400','1','18 4 0 0 0 0 0 0 0 0 0')
const auth = userAuth.getAuthenticator(); const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) { auth.execute("ALL", "S2", function(data) {
console.log("JSAPI_Function_Execute_1400 auth.execute:" + data); console.log("JSAPI_Function_Execute_1700 auth.execute:" + data);
// GENERAL_ERROR(100) // NO_SUPPORT(-1)
expect(data).assertEqual(100); expect(data).assertEqual(-1);
setTimeout(function() { setTimeout(function() {
done(); done();
}, 1); }, 1);
}); });
console.log("JSAPI_Function_Execute_1400 end"); console.log("JSAPI_Function_Execute_1700 end");
}) })
/**
* @tc.name execute_authentication_callback_FACE_ONLY_SUCCESS
* @tc.number JSAPI_Function_Execute_1600
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_1600', 0, function (done) {
console.log("JSAPI_Function_Execute_1600 start");
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S1", function(data) {
console.log("JSAPI_Function_Execute_1600 auth.execute:" + data);
// SUCCESS(0)
expect(data).assertEqual(0);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_1600 end");
})
/** /**
* @tc.name execute_authentication_callback_ALL_NO_SUPPORT * @tc.name execute_authentication_promise_ALL_NO_SUPPORT
* @tc.number JSAPI_Function_Execute_1700 * @tc.number JSAPI_Function_Execute_2000
* @tc.size MEDIUM * @tc.size MEDIUM
* @tc.type FUNC * @tc.type FUNC
* @tc.level Level2 * @tc.level Level2
*/ */
it('JSAPI_Function_Execute_1700', 0, function (done) { it('JSAPI_Function_Execute_2000', 0, function (done) {
console.log("JSAPI_Function_Execute_1700 start"); console.log("JSAPI_Function_Execute_2000 start");
const auth = userAuth.getAuthenticator(); const auth = userAuth.getAuthenticator();
auth.execute("ALL", "S2", function(data) { auth.execute("ALL", "S2").catch(function(data) {
console.log("JSAPI_Function_Execute_1700 auth.execute:" + data); console.log("JSAPI_Function_Execute_2000 auth.execute:" + data);
// NO_SUPPORT(-1) // NO_SUPPORT(-1)
expect(data).assertEqual(-1); expect(data).assertEqual(-1);
setTimeout(function() { setTimeout(function() {
done(); done();
}, 1); }, 1);
}); });
console.log("JSAPI_Function_Execute_1700 end"); console.log("JSAPI_Function_Execute_2000 end");
}) })
/** /**
...@@ -463,47 +98,6 @@ describe('userAuthTest', function () { ...@@ -463,47 +98,6 @@ describe('userAuthTest', function () {
console.log("JSAPI_Function_Execute_1800 end"); console.log("JSAPI_Function_Execute_1800 end");
}) })
/**
* @tc.name execute_authentication_promise_FACE_ONLY_SUCCESS
* @tc.number JSAPI_Function_Execute_1900
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_1900', 0, function (done) {
console.log("JSAPI_Function_Execute_1900 start");
const auth = userAuth.getAuthenticator();
auth.execute("FACE_ONLY", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_1900 auth.execute:" + data);
// SUCCESS(0)
expect(data).assertEqual(0);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_1900 end");
})
/**
* @tc.name execute_authentication_promise_ALL_NO_SUPPORT
* @tc.number JSAPI_Function_Execute_2000
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it('JSAPI_Function_Execute_2000', 0, function (done) {
console.log("JSAPI_Function_Execute_2000 start");
const auth = userAuth.getAuthenticator();
auth.execute("ALL", "S2").then(function(data) {
console.log("JSAPI_Function_Execute_2000 auth.execute:" + data);
// NO_SUPPORT(-1)
expect(data).assertEqual(-1);
setTimeout(function() {
done();
}, 1);
});
console.log("JSAPI_Function_Execute_2000 end");
})
/** /**
* @tc.name execute_authentication_promise_Type_is_null * @tc.name execute_authentication_promise_Type_is_null
...@@ -515,7 +109,7 @@ describe('userAuthTest', function () { ...@@ -515,7 +109,7 @@ describe('userAuthTest', function () {
it('JSAPI_Function_Execute_2100', 0, function (done) { it('JSAPI_Function_Execute_2100', 0, function (done) {
console.log("JSAPI_Function_Execute_2100 start"); console.log("JSAPI_Function_Execute_2100 start");
const auth = userAuth.getAuthenticator(); const auth = userAuth.getAuthenticator();
auth.execute("", "S2").then(function(data) { auth.execute("", "S2").catch(function(data) {
console.log("JSAPI_Function_Execute_2100 auth.execute:" + data); console.log("JSAPI_Function_Execute_2100 auth.execute:" + data);
// INVALID_PARAMETERS(6) // INVALID_PARAMETERS(6)
expect(data).assertEqual(6); expect(data).assertEqual(6);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册