Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7cd1800c
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看板
未验证
提交
7cd1800c
编写于
1月 10, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7112 新增电话用例
Merge pull request !7112 from zhangfuzhi/monthly_20221018
上级
e8c88c05
ed13df7b
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
885 addition
and
8 deletion
+885
-8
telephony/telephonyjstest/telephony_base/BUILD.gn
telephony/telephonyjstest/telephony_base/BUILD.gn
+2
-1
telephony/telephonyjstest/telephony_base/call_manager/BUILD.gn
...hony/telephonyjstest/telephony_base/call_manager/BUILD.gn
+2
-2
telephony/telephonyjstest/telephony_base/call_manager/src/main/config.json
...nyjstest/telephony_base/call_manager/src/main/config.json
+1
-1
telephony/telephonyjstest/telephony_base/cellular_data/BUILD.gn
...ony/telephonyjstest/telephony_base/cellular_data/BUILD.gn
+2
-2
telephony/telephonyjstest/telephony_base/cellular_data/src/main/config.json
...yjstest/telephony_base/cellular_data/src/main/config.json
+1
-1
telephony/telephonyjstest/telephony_base/cellular_data/src/main/js/test/List.test.js
...elephony_base/cellular_data/src/main/js/test/List.test.js
+1
-1
telephony/telephonyjstest/telephony_base/sms_mms/BUILD.gn
telephony/telephonyjstest/telephony_base/sms_mms/BUILD.gn
+35
-0
telephony/telephonyjstest/telephony_base/sms_mms/Test.json
telephony/telephonyjstest/telephony_base/sms_mms/Test.json
+20
-0
telephony/telephonyjstest/telephony_base/sms_mms/signature/openharmony_sx.p7b
...stest/telephony_base/sms_mms/signature/openharmony_sx.p7b
+0
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/config.json
...lephonyjstest/telephony_base/sms_mms/src/main/config.json
+96
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/app.js
...est/telephony_base/sms_mms/src/main/js/MainAbility/app.js
+23
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/i18n/en-US.json
...hony_base/sms_mms/src/main/js/MainAbility/i18n/en-US.json
+8
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/i18n/zh-CN.json
...hony_base/sms_mms/src/main/js/MainAbility/i18n/zh-CN.json
+8
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.css
...ase/sms_mms/src/main/js/MainAbility/pages/index/index.css
+9
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.hml
...ase/sms_mms/src/main/js/MainAbility/pages/index/index.hml
+5
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.js
...base/sms_mms/src/main/js/MainAbility/pages/index/index.js
+39
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/app.js
...est/telephony_base/sms_mms/src/main/js/TestAbility/app.js
+23
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/i18n/en-US.json
...hony_base/sms_mms/src/main/js/TestAbility/i18n/en-US.json
+8
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/i18n/zh-CN.json
...hony_base/sms_mms/src/main/js/TestAbility/i18n/zh-CN.json
+8
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/pages/index/index.css
...ase/sms_mms/src/main/js/TestAbility/pages/index/index.css
+30
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/pages/index/index.hml
...ase/sms_mms/src/main/js/TestAbility/pages/index/index.hml
+5
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/pages/index/index.js
...base/sms_mms/src/main/js/TestAbility/pages/index/index.js
+26
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...e/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+59
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/List.test.js
...test/telephony_base/sms_mms/src/main/js/test/List.test.js
+20
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js
...y_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js
+426
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/resources/base/element/string.json
..._base/sms_mms/src/main/resources/base/element/string.json
+28
-0
telephony/telephonyjstest/telephony_base/sms_mms/src/main/resources/base/media/icon.png
...phony_base/sms_mms/src/main/resources/base/media/icon.png
+0
-0
未找到文件。
telephony/telephonyjstest/telephony_base/BUILD.gn
浏览文件 @
7cd1800c
# Copyright (C) 202
1
Huawei Device Co., Ltd.
# Copyright (C) 202
3
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
...
...
@@ -19,6 +19,7 @@ group("telephony_base") {
deps = [
"call_manager:ActsBaseCallManagerTest",
"cellular_data:ActsBaseCellularDataTest",
"sms_mms:ActsBaseSmsMmsTest",
]
}
}
telephony/telephonyjstest/telephony_base/call_manager/BUILD.gn
浏览文件 @
7cd1800c
...
...
@@ -21,8 +21,8 @@ ohos_js_hap_suite("ActsBaseCallManagerTest") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsBaseCallManagerTest"
part_name = "
netstack
"
subsystem_name = "
communication
"
part_name = "
call_manager
"
subsystem_name = "
telephony
"
}
ohos_js_assets("hjs_demo_js_assets") {
js2abc = true
...
...
telephony/telephonyjstest/telephony_base/call_manager/src/main/config.json
浏览文件 @
7cd1800c
...
...
@@ -8,7 +8,7 @@
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"target"
:
7
,
"releaseType"
:
"Release"
}
},
...
...
telephony/telephonyjstest/telephony_base/cellular_data/BUILD.gn
浏览文件 @
7cd1800c
...
...
@@ -21,8 +21,8 @@ ohos_js_hap_suite("ActsBaseCellularDataTest") {
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsBaseCellularDataTest"
part_name = "
netmanager_ext
"
subsystem_name = "
communication
"
part_name = "
cellular_data
"
subsystem_name = "
telephony
"
}
ohos_js_assets("hjs_demo_js_assets") {
js2abc = true
...
...
telephony/telephonyjstest/telephony_base/cellular_data/src/main/config.json
浏览文件 @
7cd1800c
...
...
@@ -8,7 +8,7 @@
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"target"
:
7
,
"releaseType"
:
"Release"
}
},
...
...
telephony/telephonyjstest/telephony_base/cellular_data/src/main/js/test/List.test.js
浏览文件 @
7cd1800c
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
PdpProfileDataStorageFunction
from
'
./PdpProfileDataStorageFunction.test.js
'
import
PdpProfileDataStorageFunction
from
'
./PdpProfileDataStorageFunction.test.js
'
;
export
default
function
testsuite
()
{
PdpProfileDataStorageFunction
();
...
...
telephony/telephonyjstest/telephony_base/sms_mms/BUILD.gn
0 → 100644
浏览文件 @
7cd1800c
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsBaseSmsMmsTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsBaseSmsMmsTest"
part_name = "sms_mms"
subsystem_name = "telephony"
}
ohos_js_assets("hjs_demo_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
telephony/telephonyjstest/telephony_base/sms_mms/Test.json
0 → 100644
浏览文件 @
7cd1800c
{
"description"
:
"Function test of sms_mms manager interface"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"900000"
,
"bundle-name"
:
"com.ohos.sms_mms"
,
"package-name"
:
"com.ohos.sms_mms"
,
"shell-timeout"
:
"900000"
,
"testcase-timeout"
:
"30000"
},
"kits"
:
[
{
"test-file-name"
:
[
"$module.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
telephony/telephonyjstest/telephony_base/sms_mms/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
7cd1800c
文件已添加
telephony/telephonyjstest/telephony_base/sms_mms/src/main/config.json
0 → 100644
浏览文件 @
7cd1800c
{
"app"
:
{
"bundleName"
:
"com.ohos.sms_mms"
,
"vendor"
:
"ohos"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
7
,
"releaseType"
:
"Release"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.ohos.sms_mms"
,
"name"
:
".entry"
,
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility_desc"
,
"label"
:
"$string:MainAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"TestAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
}
}
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
}
};
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
7cd1800c
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
7cd1800c
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
7cd1800c
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
7cd1800c
<div class="container">
<text class="title">
SMS_MMS TEST
</text>
</div>
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
import
{
Hypium
}
from
'
@ohos/hypium
'
;
import
testsuite
from
'
../../../test/List.test
'
;
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
''
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish!
'
);
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
console
.
info
(
'
start run testcase!!!
'
);
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
);
},
onReady
()
{
},
};
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
TestApplication onDestroy
'
);
}
};
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
7cd1800c
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
7cd1800c
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
7cd1800c
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
7cd1800c
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
}
}
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
,
'
-s dryRun
'
]);
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
];
}
}
return
targetParams
.
trim
();
}
export
default
{
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
);
},
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
);
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
;
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
);
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
];
console
.
info
(
'
debug value :
'
+
debug
);
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
;
}
console
.
info
(
'
cmd :
'
+
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
});
}
}
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
SmsMmsBatchInsert
from
'
./SmsMmsBatchInsert.test
'
;
export
default
function
testsuite
()
{
SmsMmsBatchInsert
();
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/js/test/SmsMmsBatchInsert.test.js
0 → 100644
浏览文件 @
7cd1800c
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
featureAbility
from
"
@ohos.ability.featureAbility
"
;
import
{
describe
,
expect
,
it
,
beforeEach
}
from
'
@ohos/hypium
'
;
export
default
function
SmsMmsBatchInsert
()
{
describe
(
'
SmsMmsBatchInsert
'
,
function
()
{
const
URL_DAH
=
"
dataability:///com.ohos.smsmmsability
"
;
const
URL_INFO
=
"
dataability:///com.ohos.smsmmsability/sms_mms/sms_mms_info
"
;
const
URL_INFO_ERR
=
"
dataability:///com.ohos.smsmmsability/sms_mms/sms_mms_infos
"
;
const
DAHelper
=
featureAbility
.
acquireDataAbilityHelper
(
URL_DAH
);
let
smsMmsInfo
=
{
"
receiver_number
"
:
"
134XXXXXXXX
"
,
//接收方号码 TEXT
"
sender_number
"
:
"
135XXXXXXXX
"
,
//发送方号码 TEXT
"
is_sender
"
:
1
,
//是否是发送方 0 - 接收方 1 - 发送方 integer
"
msg_type
"
:
0
,
//消息类型 0主题、1图片、2视频、3音频、4文本、5名片 integer
"
sms_type
"
:
1
,
//短息类型 0-普通,1-通知 integer
"
start_time
"
:
"
1659506935398
"
,
//启始时间 TEXT
"
end_time
"
:
"
1659506935399
"
,
//结束时间 TEXT
"
msg_state
"
:
0
,
//消息状态 0:成功 ,1 :失败 , 2 : 发送中... integer
"
msg_title
"
:
"
message title
"
,
//消息标题 TEXT
"
msg_content
"
:
"
The test text message content
"
,
//消息内容 TEXT
"
operator_service_number
"
:
"
123456
"
,
//操作员服务号码 TEXT
"
is_lock
"
:
0
,
//是否锁定 0-否,1-是 integer
"
is_collect
"
:
0
,
//是否收藏 0-未收藏,1-已收藏 integer
"
is_read
"
:
0
,
// 是否读取 0-已读,1-未读 integer
"
session_type
"
:
0
,
//会话类型 0 - 普通 1 - 广播 2 - 群发 integer
"
retry_number
"
:
0
,
//重试次数 integer
"
session_id
"
:
-
1
,
//会话Id integer
"
group_id
"
:
1
,
//群组ID integer
"
device_id
"
:
-
1
,
//设备id integer
"
is_subsection
"
:
0
,
//是否分支 0 - 否 1 - 是 integer
"
is_send_report
"
:
1
,
//是否发送报告 0 - 否 1 - 是 integer
"
msg_code
"
:
0
};
//消息码 integer
let
smsMmsInfoErr
=
{
"
receiver_number_s
"
:
"
134XXXXXXXX
"
,
//接收方号码 TEXT
"
sender_number
"
:
"
135XXXXXXXX
"
,
//发送方号码 TEXT
"
is_sender_s
"
:
1
,
//是否是发送方 0 - 接收方 1 - 发送方 integer
"
msg_type
"
:
0
,
//消息类型 0主题、1图片、2视频、3音频、4文本、5名片 integer
"
sms_type
"
:
1
,
//短息类型 0-普通,1-通知 integer
"
start_time
"
:
"
1659506935398
"
,
//启始时间 TEXT
"
end_time
"
:
"
1659506935399
"
,
//结束时间 TEXT
"
msg_state
"
:
0
,
//消息状态 0:成功 ,1 :失败 , 2 : 发送中... integer
"
msg_title
"
:
"
message title
"
,
//消息标题 TEXT
"
msg_content
"
:
"
The err test text message content
"
,
//消息内容 TEXT
"
operator_service_number
"
:
"
123456
"
,
//操作员服务号码 TEXT
"
is_lock
"
:
0
,
//是否锁定 0-否,1-是 integer
"
is_collect
"
:
0
,
//是否收藏 0-未收藏,1-已收藏 integer
"
is_read
"
:
0
,
// 是否读取 0-已读,1-未读 integer
"
session_type
"
:
0
,
//会话类型 0 - 普通 1 - 广播 2 - 群发 integer
"
retry_number
"
:
0
,
//重试次数 integer
"
session_id
"
:
-
1
,
//会话Id integer
"
group_id
"
:
1
,
//群组ID integer
"
device_id
"
:
-
1
,
//设备id integer
"
is_subsection
"
:
0
,
//是否分支 0 - 否 1 - 是 integer
"
is_send_report
"
:
1
,
//是否发送报告 0 - 否 1 - 是 integer
"
msg_code
"
:
0
};
//消息码 integer
beforeEach
(
async
function
()
{
if
(
DAHelper
==
null
)
{
console
.
log
(
'
beforeEach get DAHelper fail.
'
);
return
;
}
try
{
let
dataQuery
=
await
DAHelper
.
query
(
URL_INFO
);
console
.
log
(
'
beforeEach query Success, data:
'
+
JSON
.
stringify
(
dataQuery
.
rowCount
));
if
(
dataQuery
.
rowCount
!==
0
)
{
let
dataDel
=
await
DAHelper
.
delete
(
URL_INFO
);
console
.
log
(
'
beforeEach delete Success, data:
'
+
JSON
.
stringify
(
dataDel
));
}
}
catch
(
err
)
{
console
.
log
(
'
beforeEach test fail, err :
'
+
JSON
.
stringify
(
err
));
return
;
}
});
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
){
return
;
}
}
}
function
ExpectTrue
(
data
)
{
try
{
expect
(
data
).
assertTrue
();
}
catch
(
err
)
{
console
.
log
(
'
assertion failure
'
);
}
}
function
ExpectFalse
()
{
try
{
expect
().
assertFail
();
}
catch
(
err
)
{
console
.
log
(
'
assertion failure
'
);
}
}
/*
* @tc.number Telephony_SmsMms_batchInsert_Async_0100
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Async_0100
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Async_0100
'
;
let
valuesBuckets
=
[];
let
num
=
1
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfo
;
}
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
,
(
data
,
err
)
=>
{
if
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
ExpectTrue
(
data
.
code
===
0
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
});
sleep
(
100
);
try
{
let
data
=
await
DAHelper
.
query
(
URL_INFO
);
ExpectTrue
(
data
.
rowCount
===
num
);
console
.
log
(
CASE_NAME
+
'
query Success, data:
'
+
JSON
.
stringify
(
data
.
rowCount
));
done
();
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
query fail, err:
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Async_0200
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Async_0200
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Async_0200
'
;
let
valuesBuckets
=
[];
let
num
=
1
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfo
;
}
DAHelper
.
batchInsert
(
URL_INFO_ERR
,
valuesBuckets
,
(
data
,
err
)
=>
{
if
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert Success, err :
'
+
JSON
.
stringify
(
err
));
ExpectTrue
(
true
);
done
();
return
;
}
ExpectFalse
();
console
.
log
(
CASE_NAME
+
'
batchInsert failed, data:
'
+
JSON
.
stringify
(
data
));
done
();
});
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Async_0300
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Async_0300
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Async_0300
'
;
let
valuesBuckets
=
[];
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
,
(
data
,
err
)
=>
{
if
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
ExpectTrue
(
data
.
code
===
0
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
});
sleep
(
100
);
try
{
let
data
=
await
DAHelper
.
query
(
URL_INFO
);
ExpectTrue
(
data
.
rowCount
===
0
);
console
.
log
(
CASE_NAME
+
'
query Success, data:
'
+
JSON
.
stringify
(
data
.
rowCount
));
done
();
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
query fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Async_0400
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Async_0400
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Async_0400
'
;
let
valuesBuckets
=
[];
let
num
=
248
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfo
;
}
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
,
(
data
,
err
)
=>
{
if
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
}
ExpectTrue
(
data
.
code
===
0
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
});
sleep
(
2000
);
try
{
let
data
=
await
DAHelper
.
query
(
URL_INFO
);
ExpectTrue
(
data
.
rowCount
===
num
);
console
.
log
(
CASE_NAME
+
'
query Success, data:
'
+
JSON
.
stringify
(
data
.
rowCount
));
done
();
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
query fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Async_0500
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Async_0500
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Async_0500
'
;
let
valuesBuckets
=
[];
let
num
=
1
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfoErr
;
}
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
,
(
data
,
err
)
=>
{
if
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert Success, err :
'
+
JSON
.
stringify
(
err
));
ExpectTrue
(
true
);
done
();
return
;
}
ExpectFalse
();
console
.
log
(
CASE_NAME
+
'
batchInsert failed, data:
'
+
JSON
.
stringify
(
data
));
done
();
});
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Promise_0100
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Promise_0100
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Promise_0100
'
;
let
valuesBuckets
=
[];
let
num
=
1
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfo
;
}
try
{
let
data
=
await
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
);
ExpectTrue
(
data
===
0
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
try
{
let
data
=
await
DAHelper
.
query
(
URL_INFO
);
ExpectTrue
(
data
.
rowCount
===
num
);
console
.
log
(
CASE_NAME
+
'
query Success, data:
'
+
JSON
.
stringify
(
data
.
rowCount
));
done
();
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
query fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Promise_0200
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Promise_0200
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Promise_0200
'
;
let
valuesBuckets
=
[];
let
num
=
1
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfo
;
}
try
{
let
data
=
await
DAHelper
.
batchInsert
(
URL_INFO_ERR
,
valuesBuckets
);
ExpectTrue
(
data
===
-
1
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
done
();
return
;
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert failed, err :
'
+
JSON
.
stringify
(
err
));
ExpectTrue
(
true
);
done
();
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Promise_0300
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Promise_0300
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Promise_0300
'
;
let
valuesBuckets
=
[];
try
{
let
data
=
await
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
);
ExpectTrue
(
data
===
0
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
sleep
(
100
);
try
{
let
data
=
await
DAHelper
.
query
(
URL_INFO
);
ExpectTrue
(
data
.
rowCount
===
0
);
console
.
log
(
CASE_NAME
+
'
query Success, data:
'
+
JSON
.
stringify
(
data
.
rowCount
));
done
();
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
query fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Promise_0400
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Promise_0400
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Promise_0400
'
;
let
valuesBuckets
=
[];
let
num
=
100
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfo
;
}
try
{
let
data
=
await
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
);
ExpectTrue
(
data
===
0
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success, data:
'
+
JSON
.
stringify
(
data
));
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
sleep
(
100
);
try
{
let
data
=
await
DAHelper
.
query
(
URL_INFO
);
ExpectTrue
(
data
.
rowCount
===
num
);
console
.
log
(
CASE_NAME
+
'
query Success, data:
'
+
JSON
.
stringify
(
data
.
rowCount
));
done
();
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
query fail, err :
'
+
JSON
.
stringify
(
err
));
ExpectFalse
();
done
();
return
;
}
});
/*
* @tc.number Telephony_SmsMms_batchInsert_Promise_0500
* @tc.name
* @tc.desc Function test
*/
it
(
'
Telephony_SmsMms_batchInsert_Promise_0500
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_SmsMms_batchInsert_Promise_0500
'
;
let
valuesBuckets
=
[];
let
num
=
1
;
for
(
let
i
=
0
;
i
<
num
;
i
++
)
{
valuesBuckets
[
i
]
=
smsMmsInfoErr
;
}
try
{
let
data
=
await
DAHelper
.
batchInsert
(
URL_INFO
,
valuesBuckets
);
ExpectTrue
(
data
===
-
1
);
console
.
log
(
CASE_NAME
+
'
batchInsert Success , data:
'
+
JSON
.
stringify
(
data
));
done
();
return
;
}
catch
(
err
)
{
console
.
log
(
CASE_NAME
+
'
batchInsert failed, err :
'
+
JSON
.
stringify
(
err
));
ExpectTrue
(
true
);
done
();
}
});
});
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
7cd1800c
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"sms_mms Test"
},
{
"name"
:
"mainability_description"
,
"value"
:
"sms_mms Test"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
telephony/telephonyjstest/telephony_base/sms_mms/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
7cd1800c
6.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录