Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2260d0bc
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看板
提交
2260d0bc
编写于
1月 11, 2022
作者:
G
gaoxi785
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add new osaccunt test
Signed-off-by:
N
gaoxi785
<
gaoxi785@huawei.com
>
上级
33df8ab1
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
757 addition
and
5 deletion
+757
-5
account/osaccount/actsosaccountsystemtest/Test.json
account/osaccount/actsosaccountsystemtest/Test.json
+1
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/default/pages/index/index.js
...systemtest/entry/src/main/js/default/pages/index/index.js
+1
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
...sosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
+627
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
...sosaccountsystemtest/entry/src/main/js/test/Query.test.js
+88
-2
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
...thirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
+40
-2
未找到文件。
account/osaccount/actsosaccountsystemtest/Test.json
浏览文件 @
2260d0bc
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
2
00000"
,
"test-timeout"
:
"
3
00000"
,
"package"
:
"com.example.actsosaccountsystemtest"
,
"shell-timeout"
:
"60000"
},
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
2260d0bc
...
...
@@ -35,6 +35,7 @@ export default {
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
8000
;
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
浏览文件 @
2260d0bc
此差异已折叠。
点击以展开。
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
浏览文件 @
2260d0bc
...
...
@@ -32,6 +32,12 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>queryOsAccountById data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
localId
).
assertEqual
(
100
);
expect
(
data
.
type
.
ADMIN
).
assertEqual
(
0
);
var
serialNumberStr
=
data
.
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000001
"
);
expect
(
data
.
isCreateCompleted
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_0100 end====
"
);
done
();
})
...
...
@@ -49,6 +55,12 @@ describe('ActsOsAccountSystemTest', function () {
var
osAccountInfo
=
await
osAccountManager
.
queryOsAccountById
(
100
);
console
.
debug
(
"
====>queryOsAccountById osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
expect
(
osAccountInfo
.
localId
).
assertEqual
(
100
);
expect
(
osAccountInfo
.
type
.
ADMIN
).
assertEqual
(
0
);
var
serialNumberStr
=
osAccountInfo
.
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
00000001
"
);
expect
(
osAccountInfo
.
isCreateCompleted
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_0200 end====
"
);
done
();
});
...
...
@@ -212,7 +224,7 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>queryAllCreatedOsAccounts data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
data
[
i
].
localId
,
data
[
i
].
owner
)
dataMap
.
set
(
data
[
i
].
localId
,
data
[
i
].
localName
)
}
expect
(
dataMap
.
has
(
100
)).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_1100 end====
"
);
...
...
@@ -233,13 +245,87 @@ describe('ActsOsAccountSystemTest', function () {
var
osAccountCreated
=
await
osAccountManager
.
queryAllCreatedOsAccounts
();
console
.
debug
(
"
====>queryAllCreatedOsAccounts:
"
+
JSON
.
stringify
(
osAccountCreated
));
for
(
let
i
=
0
,
len
=
osAccountCreated
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
osAccountCreated
[
i
].
localId
,
osAccountCreated
[
i
].
owner
)
dataMap
.
set
(
osAccountCreated
[
i
].
localId
,
osAccountCreated
[
i
].
localName
)
}
expect
(
dataMap
.
has
(
100
)).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_1200 end====
"
);
done
();
});
/*
* @tc.number : ActsOsAccountQuery_1300
* @tc.name : queryAllCreatedOsAccounts callback
* @tc.desc : Verify that all local users contain 100 user and created users
*/
it
(
'
ActsOsAccountQuery_1300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQuery_1300 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
createIocalId
;
let
dataMap
=
new
Map
();
osAccountManager
.
createOsAccount
(
"
osAccountNameQueryA
"
,
1
,
(
err
,
osAccountInfo
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
createIocalId
=
osAccountInfo
.
localId
;
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
osAccountNameQueryA
"
);
osAccountManager
.
queryAllCreatedOsAccounts
((
err
,
data
)
=>
{
console
.
debug
(
"
====>queryAllCreatedOsAccounts err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>queryAllCreatedOsAccounts data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
data
[
i
].
localId
,
data
[
i
].
localName
)
}
expect
(
dataMap
.
has
(
100
)).
assertTrue
();
expect
(
dataMap
.
has
(
createIocalId
)).
assertTrue
();
if
(
dataMap
.
has
(
createIocalId
))
{
let
createdlocalName
=
dataMap
.
get
(
createIocalId
);
console
.
debug
(
"
====>query all local users containing localId:
"
+
createIocalId
);
console
.
debug
(
"
====>created localName
"
+
createdlocalName
);
expect
(
createdlocalName
).
assertEqual
(
"
osAccountNameQueryA
"
);
osAccountManager
.
removeOsAccount
(
createIocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>remove localId:
"
+
createIocalId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountQuery_1300 end====
"
);
done
();
})
}
})
});
});
/*
* @tc.number : ActsOsAccountQuery_1400
* @tc.name : queryAllCreatedOsAccounts promise
* @tc.desc : Verify that all local users contain 100 user and created users
*/
it
(
'
ActsOsAccountQuery_1400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountQuery_1400 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
createIocalId
;
let
dataMap
=
new
Map
();
var
osAccountInfo
=
await
osAccountManager
.
createOsAccount
(
"
osAccountNameQueryB
"
,
1
);
console
.
debug
(
"
====>createOsAccount osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
createIocalId
=
osAccountInfo
.
localId
;
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
osAccountNameQueryB
"
);
var
data
=
await
osAccountManager
.
queryAllCreatedOsAccounts
();
console
.
debug
(
"
====>queryAllCreatedOsAccounts data:
"
+
JSON
.
stringify
(
data
));
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
data
[
i
].
localId
,
data
[
i
].
localName
)
}
expect
(
dataMap
.
has
(
100
)).
assertTrue
();
expect
(
dataMap
.
has
(
createIocalId
)).
assertTrue
();
if
(
dataMap
.
has
(
createIocalId
))
{
let
createdlocalName
=
dataMap
.
get
(
createIocalId
);
console
.
debug
(
"
====>query all local users containing localId:
"
+
createIocalId
);
expect
(
createdlocalName
).
assertEqual
(
"
osAccountNameQueryB
"
);
}
await
osAccountManager
.
removeOsAccount
(
createIocalId
);
console
.
debug
(
"
====>ActsOsAccountQuery_1400 end====
"
);
done
();
});
/*
* @tc.number : ActsOsAccountQuery_1500
* @tc.name : queryMaxOsAccountNumber callback
...
...
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
浏览文件 @
2260d0bc
...
...
@@ -138,6 +138,45 @@ 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
*/
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
"
);
done
();
})
})
/*
* @tc.number : ActsOsAccountIsActived_0600
* @tc.name : isOsAccountActived promise
* @tc.desc : Authentication failed to query the active status of the user that does not exist
*/
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
"
);
done
();
}
})
/*
* @tc.number : ActsOsAccountIsMulty_0100
* @tc.name : isMultiOsAccountEnable callback
...
...
@@ -363,5 +402,4 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>ActsOsAccountIsTest_0200 end====
"
);
done
();
})
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录