提交 c7004497 编写于 作者: L lichenchen

【挑单】账号错误码更新,xts用例预期结果同步修改

Signed-off-by: Nlichenchen <lichenchen15@huawei.com>
上级 37337840
......@@ -17,6 +17,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
const TIMEOUT = 5000;
const EACHTIMEOUT = 500;
const ERR_JS_CREDENTIAL_NOT_EXIST = 12300102;
export default function ActsAppAccountCredential() {
describe('ActsAppAccountCredential', function () {
function sleep(delay) {
......@@ -458,7 +459,7 @@ export default function ActsAppAccountCredential() {
expect(err).assertEqual(null);
appAccountManager.getCredential("account_name_1500", "credentialType15", (err)=>{
console.debug("====>getCredential ActsAppAccountCredential_1500 err:" + JSON.stringify(err));
expect(err.code == 12300019).assertEqual(true);
expect(err.code == ERR_JS_CREDENTIAL_NOT_EXIST).assertEqual(true);
appAccountManager.removeAccount("account_name_1500", (err)=>{
console.debug("====>delete Account ActsAppAccountCredential_1500 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
......@@ -485,7 +486,7 @@ export default function ActsAppAccountCredential() {
}
catch(err){
console.debug("====>getCredential ActsAppAccountCredential_1600 err:" + JSON.stringify(err));
expect(err.code == 12300019).assertEqual(true);
expect(err.code == ERR_JS_CREDENTIAL_NOT_EXIST).assertEqual(true);
console.debug("====>delete account ActsAppAccountCredential_1600 start====");
await appAccountManager.removeAccount("account_name_1600");
console.debug("====>ActsAppAccountCredential_1600 end====");
......
......@@ -25,7 +25,7 @@ const LENGTHLIMIT = 512;
const TOKENLENGTHLIMIT = 1024;
const AUTHTYPELENGTHLIMIT = 1024;
const OWNERLENGTHLIMIT = 1024;
const ERR_JS_AUTH_TYPE_NOT_FOUND = 12300107;
const OWNERSELF = "com.example.actsaccountoperatetest";
export default function ActsAccountAuthToken() {
describe('ActsAccountAuthToken', function () {
......@@ -1335,7 +1335,7 @@ export default function ActsAccountAuthToken() {
await appAccountManager.deleteAuthToken("account_promise_repeatDelete",OWNERSELF,"aythType","promise_repeatDelete_token");
}catch(err){
console.debug("====>deleteAuthToken second ActsAccountAuthToken_2200 err:" + JSON.stringify(err));
expect(err.code == 12400004).assertEqual(true);
expect(err.code == ERR_JS_AUTH_TYPE_NOT_FOUND).assertEqual(true);
}
try{
console.debug("====>getAuthToken ActsAccountAuthToken_2200 start====");
......
......@@ -33,8 +33,9 @@ export default function ActsAccountAppAccess() {
console.info(`sleep #{time} over ...`)
})
}
beforeAll(async function (done) {
await featureAbility.startAbility(
beforeAll(async function (done) {
console.debug("====>ActsAccountAuthenticator beforeAll start====");
await featureAbility.startAbilityForResult(
{
want:
{
......@@ -47,7 +48,8 @@ export default function ActsAccountAppAccess() {
},
},
)
await sleep(1500)
await sleep(1500);
console.debug("====>ActsAccountAuthenticator beforeAll end====");
done();
});
beforeEach(async (done)=>{
......@@ -619,7 +621,9 @@ export default function ActsAccountAppAccess() {
expect(data.length).assertEqual(1)
} catch(err) {
console.debug("====>ActsAccountSelectAccountByOptions_0100 err:" + JSON.stringify(err));
await appAccountManager.removeAccount(name);
expect(err).assertEqual(null)
done();
}
try{
await appAccountManager.removeAccount(name)
......@@ -654,7 +658,9 @@ export default function ActsAccountAppAccess() {
expect(data.length).assertEqual(3)
} catch(err) {
console.debug("====>ActsAccountSelectAccountByOptions_0200 err:" + JSON.stringify(err));
await appAccountManager.removeAccount(name);
expect(err).assertEqual(null)
done();
}
try{
await appAccountManager.removeAccount(name)
......@@ -690,7 +696,9 @@ export default function ActsAccountAppAccess() {
expect(data.length).assertEqual(1)
} catch(err) {
console.debug("====>ActsAccountSelectAccountByOptions_0300 err:" + JSON.stringify(err));
await appAccountManager.removeAccount(name);
expect(err).assertEqual(null)
done();
}
try{
await appAccountManager.removeAccount(name)
......
......@@ -19,7 +19,7 @@ const NAMELIMIT = 512;
const LENGTHLIMIT = 1024;
const ERR_PARAMETER_CHECK_FAILD =401
const ERR_INVALID_PARAMETER = 12300002
const ERR_ACCOUNT_EXIST = 12300008
const ERR_ACCOUNT_EXIST = 12300004
const createAccountOptions = {customData:{age:'12'}} //k and v length 1024 ,k and v size 1024
const createAccountOptionsDiff = {customData:{sex:'male'}}
export default function ActsAccountCreateAccount() {
......@@ -521,7 +521,7 @@ export default function ActsAccountCreateAccount() {
expect(err).assertEqual(null);
appAccountManager.createAccount("account_name_callback_same", createAccountOptionsDiff, (err)=>{
console.debug("====>add account second time ActsAccountCreateAccount_2300 err:" + JSON.stringify(err));
expect(err.code).assertEqual(12300008);
expect(err.code).assertEqual(ERR_ACCOUNT_EXIST);
appAccountManager.removeAccount("account_name_callback_same", (err)=>{
console.debug("====>delete Account ActsAccountCreateAccount_2300 err:" + JSON.stringify(err));
expect(err).assertEqual(null);
......@@ -548,7 +548,7 @@ export default function ActsAccountCreateAccount() {
}
catch(err){
console.debug("====>add account for the second time err:" + JSON.stringify(err));
expect(err.code).assertEqual(12300008);
expect(err.code).assertEqual(ERR_ACCOUNT_EXIST);
appAccountManager.removeAccount("account_name_promise_same");
console.debug("====>ActsAccountCreateAccount_2400 end====");
done();
......
......@@ -17,9 +17,8 @@
"package": "com.example.actsaccounttest",
"name": ".MyApplication",
"deviceType": [
"tablet",
"default",
"phone"
"tablet",
"default"
],
"distro": {
"deliveryWithInstall": true,
......
......@@ -31,15 +31,15 @@ export default {
await accountMgr.setAppAccess("zhangsan", "com.example.actsaccounttest", true);
console.info('====>ServiceAbility setAppAccess actsaccountoperatetest zhangsan');
await accountMgr.setAppAccess("zhangsan", "com.example.actsaccountoperatetest", true);
console.info('====>ServiceAbility lcc addAccount 02 onStart');
console.info('====>ServiceAbility addAccount 02 onStart');
accountMgr.createAccount("lisi", async (err)=>{
console.info('====>ServiceAbility setAppAccess actsaccounttest lisi');
await accountMgr.setAppAccess("lisi", "com.example.actsaccounttest", true);
console.info('====>ServiceAbility setAppAccess actsaccountoperatetest lisi');
await accountMgr.setAppAccess("lisi", "com.example.actsaccountoperatetest", true);
console.info('====>ServiceAbility lcc addAccount 03 onStart');
console.info('====>ServiceAbility addAccount 03 onStart');
accountMgr.createAccount("wangwu", async (err)=>{
console.info('====>ServiceAbility lcc enableAppAccess 03 onStart');
console.info('====>ServiceAbility enableAppAccess 03 onStart');
console.info('====>ServiceAbility setAppAccess actsaccounttest wangwu');
await accountMgr.setAppAccess("wangwu", "com.example.actsaccounttest", true)
console.info('====>ServiceAbility setAppAccess actsaccountoperatetest wangwu');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册