Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9c02dfe3
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9c02dfe3
编写于
1月 14, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1559 Update osaccount test code
Merge pull request !1559 from 高曦/master_account_0113
上级
7a1f070a
f51ba516
变更
4
展开全部
显示空白变更内容
内联
并排
Showing
4 changed file
with
489 addition
and
244 deletion
+489
-244
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Activate.test.js
...accountsystemtest/entry/src/main/js/test/Activate.test.js
+78
-54
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
...sosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
+3
-3
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
...sosaccountsystemtest/entry/src/main/js/test/Query.test.js
+202
-66
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
...thirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
+206
-121
未找到文件。
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Activate.test.js
浏览文件 @
9c02dfe3
...
...
@@ -15,6 +15,8 @@
import
osaccount
from
'
@ohos.account.osAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
=
4587571
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
...
...
@@ -26,17 +28,29 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>ActsOsAccountActivate_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
isOsAccountActived
(
100
,
(
err
,
data
)
=>
{
osAccountManager
.
isOsAccountActived
(
100
,
(
err
,
isActived
)
=>
{
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>isOsAccountActived data:
"
+
data
);
console
.
debug
(
"
====>isOsAccountActived data:
"
+
isActived
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
).
assertTrue
();
if
(
isActived
){
osAccountManager
.
activateOsAccount
(
100
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0100 end====
"
);
done
();
})
}
else
{
osAccountManager
.
activateOsAccount
(
100
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount first err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
osAccountManager
.
activateOsAccount
(
100
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount second err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0100 end====
"
);
done
();
})
})
}
})
});
...
...
@@ -49,23 +63,29 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>ActsOsAccountActivate_0200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
try
{
var
isActived
=
await
osAccountManager
.
isOsAccountActived
(
100
);
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
isActived
));
if
(
isActived
){
try
{
await
osAccountManager
.
activateOsAccount
(
100
);
}
catch
(
err
){
console
.
error
(
"
====>catch isOsAccountActived 0200 err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
console
.
debug
(
"
====>catch activateOsAccount 0200 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0200 end====
"
);
done
();
}
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
isActived
));
expect
(
isActived
).
assertTrue
();
}
else
{
console
.
debug
(
"
====>switch to 100 user====
"
);
await
osAccountManager
.
activateOsAccount
(
100
);
try
{
await
osAccountManager
.
activateOsAccount
(
100
);
}
catch
(
err
){
console
.
debug
(
"
====>catch activateOsAccount 0200 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0200 end====
"
);
done
();
}
}
});
/*
...
...
@@ -158,7 +178,7 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
activateOsAccount
(
0
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount to 0 user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0500 end====
"
);
done
();
})
...
...
@@ -177,7 +197,7 @@ describe('ActsOsAccountSystemTest', function () {
await
osAccountManager
.
activateOsAccount
(
0
);
}
catch
(
err
){
console
.
debug
(
"
====>activateOsAccount to 0 user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0600 end====
"
);
done
();
}
...
...
@@ -194,7 +214,7 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
activateOsAccount
(
-
1
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount to -1 user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0700 end====
"
);
done
();
})
...
...
@@ -213,7 +233,7 @@ describe('ActsOsAccountSystemTest', function () {
await
osAccountManager
.
activateOsAccount
(
-
1
);
}
catch
(
err
){
console
.
debug
(
"
====>activateOsAccount to -1 user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_0800 end====
"
);
done
();
}
...
...
@@ -228,12 +248,18 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>ActsOsAccountActivate_0900 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
activateOsAccount
(
"
Abc
"
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount to 'Abc' user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
var
localIdStr
=
"
100
"
;
function
funcActivateCallback
(
err
){
console
.
debug
(
"
====>error received callback====
"
);
console
.
debug
(
"
====>receive activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
osAccountManager
.
activateOsAccount
(
localIdStr
,
funcActivateCallback
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountActivate_0900 end====
"
);
done
();
}
)
}
,
TIMEOUT
);
});
/*
...
...
@@ -245,14 +271,11 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>ActsOsAccountActivate_1000 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
try
{
await
osAccountManager
.
activateOsAccount
(
"
Abc
"
);
}
catch
(
err
){
console
.
debug
(
"
====>activateOsAccount to 'Abc' user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
var
localIdStr
=
"
100
"
;
var
activateResult
=
await
osAccountManager
.
activateOsAccount
(
localIdStr
);
expect
(
activateResult
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountActivate_1000 end====
"
);
done
();
}
});
/*
...
...
@@ -264,12 +287,17 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>ActsOsAccountActivate_1100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
activateOsAccount
(
undefined
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount to undefined user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
function
funcActivateCallback
(
err
){
console
.
debug
(
"
====>error received callback====
"
);
console
.
debug
(
"
====>receive activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
osAccountManager
.
activateOsAccount
(
undefined
,
funcActivateCallback
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountActivate_1100 end====
"
);
done
();
}
)
}
,
TIMEOUT
);
});
/*
...
...
@@ -281,14 +309,10 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>ActsOsAccountActivate_1200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
try
{
await
osAccountManager
.
activateOsAccount
(
undefined
);
}
catch
(
err
){
console
.
debug
(
"
====>activateOsAccount to undefined user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
var
activateResult
=
await
osAccountManager
.
activateOsAccount
(
undefined
);
expect
(
activateResult
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountActivate_1200 end====
"
);
done
();
}
});
/*
...
...
@@ -303,7 +327,7 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
activateOsAccount
(
nonExistentLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount to nonexist user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_1300 end====
"
);
done
();
})
...
...
@@ -323,7 +347,7 @@ describe('ActsOsAccountSystemTest', function () {
await
osAccountManager
.
activateOsAccount
(
nonExistentLocalId
);
}
catch
(
err
){
console
.
debug
(
"
====>activateOsAccount to nonexist user err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
);
console
.
debug
(
"
====>ActsOsAccountActivate_1400 end====
"
);
done
();
}
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
浏览文件 @
9c02dfe3
...
...
@@ -245,7 +245,7 @@ describe('ActsOsAccountSystemTest', function () {
/*
* @tc.number : ActsOsAccountOnOff_0700
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : V
erification cannot cancel activating type not subscribed
* @tc.desc : V
alidate subscription callback with parameter name as empty string
*/
it
(
'
ActsOsAccountOnOff_0700
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountOnOff_0700 start====
"
);
...
...
@@ -269,7 +269,7 @@ describe('ActsOsAccountSystemTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
osAccountNameE
"
);
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>activateOsAccount err
code
:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
setTimeout
(()
=>
{
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
...
...
@@ -286,7 +286,7 @@ describe('ActsOsAccountSystemTest', function () {
/*
* @tc.number : ActsOsAccountOnOff_0800
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : V
erification cannot cancel activating type not subscribed
* @tc.desc : V
alidate subscription promise with parameter name as empty string
*/
it
(
'
ActsOsAccountOnOff_0800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountOnOff_0800 start====
"
);
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
浏览文件 @
9c02dfe3
此差异已折叠。
点击以展开。
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
浏览文件 @
9c02dfe3
...
...
@@ -15,7 +15,9 @@
import
osAccount
from
'
@ohos.account.osAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
=
4587543
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
=
4587546
;
describe
(
'
ActsOsAccountThirdPartyTest
'
,
function
()
{
/*
...
...
@@ -63,13 +65,13 @@ describe('ActsOsAccountThirdPartyTest', function () {
/*
* @tc.number : ActsOsAccountIsActived_0100
* @tc.name : isOsAccountActived callback
* @tc.desc
: Verify that users are not switched and query 100 users as activ
e
* @tc.desc
: Verify query 0 user status is tru
e
*/
it
(
'
ActsOsAccountIsActived_0100
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0100 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountActived
(
10
0
,
(
err
,
isActived
)
=>
{
AccountManager
.
isOsAccountActived
(
0
,
(
err
,
isActived
)
=>
{
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>isOsAccountActived isActived:
"
+
isActived
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
@@ -82,14 +84,14 @@ describe('ActsOsAccountThirdPartyTest', function () {
/*
* @tc.number : ActsOsAccountIsActived_0200
* @tc.name : isOsAccountActived promise
* @tc.desc
: Verify that users are not switched and query 100 users as activ
e
* @tc.desc
: Verify query 0 user status is tru
e
*/
it
(
'
ActsOsAccountIsActived_0200
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0200 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
try
{
var
isActived
=
await
AccountManager
.
isOsAccountActived
(
10
0
);
var
isActived
=
await
AccountManager
.
isOsAccountActived
(
0
);
}
catch
(
err
){
console
.
debug
(
"
====>catch isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
...
...
@@ -105,15 +107,16 @@ describe('ActsOsAccountThirdPartyTest', function () {
/*
* @tc.number : ActsOsAccountIsActived_0300
* @tc.name : isOsAccountActived callback
* @tc.desc
: Authentication query 0 user active status failed
* @tc.desc
: Authentication failed to query the active status of the user that does not exist
*/
it
(
'
ActsOsAccountIsActived_0300
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0300 start
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountActived
(
0
,
(
err
)
=>
{
var
nonExistLocalId
=
1000
;
AccountManager
.
isOsAccountActived
(
nonExistLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0300 end
"
);
done
();
})
...
...
@@ -122,18 +125,20 @@ describe('ActsOsAccountThirdPartyTest', function () {
/*
* @tc.number : ActsOsAccountIsActived_0400
* @tc.name : isOsAccountActived promise
* @tc.desc
: Authentication query 0 user active status failed
* @tc.desc
: Authentication failed to query the active status of the user that does not exist
*/
it
(
'
ActsOsAccountIsActived_0400
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>
isOsAccount
Actived_0400 start====
"
);
console
.
debug
(
"
====>
ActsOsAccountIs
Actived_0400 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
nonExistLocalId
=
1000
;
try
{
await
AccountManager
.
isOsAccountActived
(
0
);
await
AccountManager
.
isOsAccountActived
(
nonExistLocalId
);
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0400 end
"
);
done
();
}
})
...
...
@@ -141,40 +146,81 @@ describe('ActsOsAccountThirdPartyTest', function () {
/*
* @tc.number : ActsOsAccountIsActived_0500
* @tc.name : isOsAccountActived callback
* @tc.desc
: Authentication failed to query the active status of the user that does not exist
* @tc.desc
: Verify that the query active state is not received with parameter type mismatch
*/
it
(
'
ActsOsAccountIsActived_0500
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0500 start
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
nonExistLocalId
=
1000
;
AccountManager
.
isOsAccountActived
(
nonExistLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0500 end
"
);
var
localIdStr
=
"
100
"
;
function
funcIsActived
(
err
,
data
){
console
.
debug
(
"
====>error received callback====
"
);
console
.
debug
(
"
====>receive isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>receive isOsAccountActived data:
"
+
JSON
.
stringify
(
data
));
expect
().
assertFail
();
done
();
})
}
AccountManager
.
isOsAccountActived
(
localIdStr
,
funcIsActived
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountIsActived_0500 end====
"
);
done
();
},
TIMEOUT
);
})
/*
* @tc.number : ActsOsAccountIsActived_0600
* @tc.name : isOsAccountActived promise
* @tc.desc
: Authentication failed to query the active status of the user that does not exist
* @tc.desc
: Verify that the query active state is not received with parameter type mismatch
*/
it
(
'
ActsOsAccountIsActived_0600
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0600 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
nonExistLocalId
=
1000
;
try
{
await
AccountManager
.
isOsAccountActived
(
nonExistLocalId
);
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountIsActived_0600 end
"
);
var
localIdStr
=
"
100
"
;
var
isActived
=
await
AccountManager
.
isOsAccountActived
(
localIdStr
);
console
.
debug
(
"
====>get active status is:
"
+
isActived
);
expect
(
isActived
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0600 end====
"
);
done
();
})
/*
* @tc.number : ActsOsAccountIsActived_0700
* @tc.name : isOsAccountActived callback
* @tc.desc : Verify that the query active state is not received with parameter undefined
*/
it
(
'
ActsOsAccountIsActived_0700
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0700 start
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
function
funcIsActived
(
err
,
data
){
console
.
debug
(
"
====>error received callback====
"
);
console
.
debug
(
"
====>receive isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>receive isOsAccountActived data:
"
+
JSON
.
stringify
(
data
));
expect
().
assertFail
();
done
();
}
AccountManager
.
isOsAccountActived
(
undefined
,
funcIsActived
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountIsActived_0700 end====
"
);
done
();
},
TIMEOUT
);
})
/*
* @tc.number : ActsOsAccountIsActived_0800
* @tc.name : isOsAccountActived promise
* @tc.desc : Verify that the query active state is not received with parameter undefined
*/
it
(
'
ActsOsAccountIsActived_0800
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsActived_0800 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
isActived
=
await
AccountManager
.
isOsAccountActived
(
undefined
);
console
.
debug
(
"
====>get active status is:
"
+
isActived
);
expect
(
isActived
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountIsActived_0800 end====
"
);
done
();
})
/*
...
...
@@ -219,18 +265,54 @@ describe('ActsOsAccountThirdPartyTest', function () {
done
();
})
/*
* @tc.number : ActsOsAccountVerified_0100
* @tc.name : isOsAccountVerified callback
* @tc.desc : Verify that the initial state query is unlocked to false
*/
it
(
'
ActsOsAccountVerified_0100
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>isOsAccountVerified_0100 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountVerified
((
err
,
data
)
=>
{
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>isOsAccountVerified data:
"
+
data
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
).
assertEqual
(
false
);
console
.
debug
(
"
====>ActsOsAccountVerified_0100 end====
"
);
done
();
})
})
/*
* @tc.number : ActsOsAccountVerified_0200
* @tc.name : isOsAccountVerified promise
* @tc.desc : Verify that the initial state query is unlocked to false
*/
it
(
'
ActsOsAccountVerified_0200
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>isOsAccountVerified_0200 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
isVerified
=
await
AccountManager
.
isOsAccountVerified
();
console
.
debug
(
"
====>isOsAccountVerified data:
"
+
isVerified
);
expect
(
isVerified
).
assertEqual
(
false
);
console
.
debug
(
"
====>ActsOsAccountVerified_0200 end====
"
);
done
();
})
/*
* @tc.number : ActsOsAccountIsVerified_0300
* @tc.name : isOsAccountVerified callback
* @tc.desc
: Verify query 0 user is unlocked failed
* @tc.desc
: Verify that the initial state query 0 user is unlocked to false
*/
it
(
'
ActsOsAccountIsVerified_0300
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsVerified_0300 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountVerified
(
0
,
(
err
)
=>
{
AccountManager
.
isOsAccountVerified
(
0
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
).
assertFalse
();
console
.
debug
(
"
====>ActsOsAccountIsVerified_0300 end====
"
);
done
();
})
...
...
@@ -239,21 +321,16 @@ describe('ActsOsAccountThirdPartyTest', function () {
/*
* @tc.number : ActsOsAccountIsVerified_0400
* @tc.name : isOsAccountVerified promise
* @tc.desc
: Verify query 0 user is unlocked failed
* @tc.desc
: Verify that the initial state query 0 user is unlocked to false
*/
it
(
'
ActsOsAccountIsVerified_0400
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsOsAccountIsVerified_0400 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
try
{
await
AccountManager
.
isOsAccountVerified
(
0
);
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
var
isVerified
=
await
AccountManager
.
isOsAccountVerified
(
0
);
expect
(
isVerified
).
assertFalse
();
console
.
debug
(
"
====>ActsOsAccountIsVerified_0400 end====
"
);
done
();
}
})
/*
...
...
@@ -265,12 +342,19 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>ActsOsAccountIsVerified_0500 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountVerified
(
"
100
"
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
var
localIdStr
=
"
100
"
;
function
funcIsVerified
(
err
,
data
){
console
.
debug
(
"
====>error received callback====
"
);
console
.
debug
(
"
====>receive isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>receive isOsAccountVerified data:
"
+
JSON
.
stringify
(
data
));
expect
().
assertFail
();
done
();
}
AccountManager
.
isOsAccountVerified
(
localIdStr
,
funcIsVerified
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountIsVerified_0500 end====
"
);
done
();
}
)
}
,
TIMEOUT
);
})
/*
...
...
@@ -282,15 +366,12 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>ActsOsAccountIsVerified_0600 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
try
{
await
AccountManager
.
isOsAccountVerified
(
"
100
"
);
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
var
localIdStr
=
"
100
"
;
var
isVerified
=
await
AccountManager
.
isOsAccountVerified
(
localIdStr
);
console
.
debug
(
"
====>get verified status is:
"
+
isVerified
);
expect
(
isVerified
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountIsVerified_0600 end====
"
);
done
();
}
})
/*
...
...
@@ -302,12 +383,19 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>ActsOsAccountIsVerified_0700 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
AccountManager
.
isOsAccountVerified
(
undefined
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
var
localIdUndefined
=
undefined
;
function
funcIsVerified
(
err
,
data
){
console
.
debug
(
"
====>error received callback====
"
);
console
.
debug
(
"
====>receive isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>receive isOsAccountVerified data:
"
+
JSON
.
stringify
(
data
));
expect
().
assertFail
();
done
();
}
AccountManager
.
isOsAccountVerified
(
localIdUndefined
,
funcIsVerified
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountIsVerified_0700 end====
"
);
done
();
}
)
}
,
TIMEOUT
);
})
/*
...
...
@@ -319,15 +407,12 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>ActsOsAccountIsVerified_0800 start====
"
);
var
AccountManager
=
osAccount
.
getAccountManager
();
console
.
debug
(
"
====>get os AccountManager finish====
"
);
try
{
await
AccountManager
.
isOsAccountVerified
(
undefined
);
}
catch
(
err
){
console
.
debug
(
"
====>ActsOsAccountIsVerified_0800 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
();
var
localIdUndefined
=
undefined
;
var
isVerified
=
await
AccountManager
.
isOsAccountVerified
(
localIdUndefined
);
console
.
debug
(
"
====>get verified status is:
"
+
isVerified
);
expect
(
isVerified
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountIsVerified_0800 end====
"
);
done
();
}
})
/*
...
...
@@ -342,7 +427,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
var
osAccountLocalId
=
1000
;
AccountManager
.
isOsAccountVerified
(
osAccountLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
);
console
.
debug
(
"
====>ActsOsAccountIsVerified_0900 end====
"
);
done
();
})
...
...
@@ -363,7 +448,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
}
catch
(
err
){
console
.
debug
(
"
====>isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertTrue
(
);
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
);
console
.
debug
(
"
====>ActsOsAccountIsVerified_1000 end====
"
);
done
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录