Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
22de6529
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看板
提交
22de6529
编写于
3月 22, 2023
作者:
C
chensi10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
slider_xts_1
Signed-off-by:
N
chensi10
<
chensi52@huawei.com
>
上级
3b090571
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
1936 addition
and
0 deletion
+1936
-0
arkui/ace_ets_components_ux/BUILD.gn
arkui/ace_ets_components_ux/BUILD.gn
+1
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/AppScope/app.json
..._components_ux/ace_ets_component_slider/AppScope/app.json
+19
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/AppScope/resources/base/element/string.json
...ponent_slider/AppScope/resources/base/element/string.json
+8
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/AppScope/resources/base/media/app_icon.png
...mponent_slider/AppScope/resources/base/media/app_icon.png
+0
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/BUILD.gn
...i/ace_ets_components_ux/ace_ets_component_slider/BUILD.gn
+43
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/Test.json
.../ace_ets_components_ux/ace_ets_component_slider/Test.json
+26
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/signature/openharmony_sx.p7b
..._ux/ace_ets_component_slider/signature/openharmony_sx.p7b
+0
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestAbility/TestAbility.ets
...component_slider/src/main/ets/TestAbility/TestAbility.ets
+58
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestAbility/pages/Index.ets
...component_slider/src/main/ets/TestAbility/pages/Index.ets
+1077
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...t_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+85
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/test/List.test.ets
.../ace_ets_component_slider/src/main/ets/test/List.test.ets
+19
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/test/SliderTest.ets
...ace_ets_component_slider/src/main/ets/test/SliderTest.ets
+497
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/module.json
...mponents_ux/ace_ets_component_slider/src/main/module.json
+41
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/element/color.json
...mponent_slider/src/main/resources/base/element/color.json
+16
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/element/string.json
...ponent_slider/src/main/resources/base/element/string.json
+41
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/media/icon.png
...s_component_slider/src/main/resources/base/media/icon.png
+0
-0
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/profile/test_pages.json
...nt_slider/src/main/resources/base/profile/test_pages.json
+5
-0
未找到文件。
arkui/ace_ets_components_ux/BUILD.gn
浏览文件 @
22de6529
...
...
@@ -20,6 +20,7 @@ group("componentUxTest") {
"ace_ets_component_radio:ActsAceRadioTest",
"ace_ets_component_select:ActsAceSelectTest",
"ace_ets_component_sidebar:ActsAceSideBarTest",
"ace_ets_component_slider:ActsAceSliderTest",
"ace_ets_component_tabs:ActsAceTabsTest",
"ace_ets_component_text:ActsAceTextTest",
"ace_ets_component_textpicker:ActsAceTextPickerTest",
...
...
arkui/ace_ets_components_ux/ace_ets_component_slider/AppScope/app.json
0 → 100644
浏览文件 @
22de6529
{
"app"
:
{
"bundleName"
:
"com.example.slidertest"
,
"vendor"
:
"example"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"icon"
:
"$media:app_icon"
,
"label"
:
"$string:app_name"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
22de6529
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"MyApplication"
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
22de6529
6.6 KB
arkui/ace_ets_components_ux/ace_ets_component_slider/BUILD.gn
0 → 100644
浏览文件 @
22de6529
# Copyright (c) 2021 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("ActsAceSliderTest") {
hap_profile = "src/main/module.json"
js_build_mode = "debug"
deps = [
":ace_ets_component_slider_js_assets",
":ace_ets_component_slider_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAceSliderTest"
part_name = "ace_engine"
subsystem_name = "arkui"
}
ohos_app_scope("ace_ets_component_slider_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("ace_ets_component_slider_js_assets") {
source_dir = "src/main/ets"
}
ohos_resources("ace_ets_component_slider_resources") {
sources = [ "src/main/resources" ]
deps = [ ":ace_ets_component_slider_profile" ]
hap_profile = "src/main/module.json"
}
arkui/ace_ets_components_ux/ace_ets_component_slider/Test.json
0 → 100644
浏览文件 @
22de6529
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"com.example.slidertest"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
240000
},
"kits"
:
[{
"test-file-name"
:
[
"ActsAceSliderTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
]
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
22de6529
文件已添加
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestAbility/TestAbility.ets
0 → 100644
浏览文件 @
22de6529
/*
* 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 hilog from '@ohos.hilog';
import Ability from '@ohos.app.ability.UIAbility'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import testsuite from '../test/List.test'
import Window from '@ohos.window'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate');
hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? '');
hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? '');
}
onDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}
onWindowStageCreate(windowStage: Window.WindowStage) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('TestAbility/pages/Index', (err, data) => {
if (err.code) {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR);
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}
onWindowStageDestroy() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}
onForeground() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}
onBackground() {
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestAbility/pages/Index.ets
0 → 100644
浏览文件 @
22de6529
/*
* 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.
*/
//@ts-nocheck
import events_emitter from '@ohos.events.emitter';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry';
import { Hypium } from '@ohos/hypium';
import hilog from '@ohos.hilog';
import testsuite from '../../test/List.test'
@Entry
@Component
struct SliderTest {
aboutToAppear(){
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO);
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
@State message: string = 'Hello Worlds'
@State str: string = '200'
@State inSetValueOne: number = 40;
circle = new Circle({ width: '280px', height: '280px' }).fill('#FFFF0000')
Ellipse = new Ellipse({ width: '280px', height: '280px' }).fill('#FFFF0000')
Path = new Path({ width: '280px', height: '280px' }).fill('#FFFF0000')
Rect = new Rect({ width: '280px', height: '280px' }).fill('#FFFF0000')
private sliderImage: SliderBlockStyle = { type: 1, image: $r('app.media.icon') }
private sliderShapeCircle: SliderBlockStyle = { type: 2, shape: this.circle }
private sliderShapeEllipse: SliderBlockStyle = { type: 2, shape: this.Ellipse }
private sliderShapePath: SliderBlockStyle = { type: 2, shape: this.Path }
private sliderShapeRect: SliderBlockStyle = { type: 2, shape: this.Rect }
private sliderDefault: SliderBlockStyle = { type: 0 }
build() {
Row() {
Column() {
List({ space: 0, initialIndex: 0 }){
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0100')
.blockBorderColor(0xffa500)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0200')
.blockBorderColor('#ffc709e9')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0300')
.blockBorderColor(Color.Pink)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0400')
.blockBorderColor($r("app.color.start_block_Border_Color"))
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0500')
.blockBorderColor(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0600')
.blockBorderColor("rgb(0,255,255)")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0700')
.blockBorderColor(0x00ff00)
.backgroundColor(Color.Pink)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0800')
.blockBorderColor(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_0900')
.blockBorderColor('bgr(138,43,226)')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_1000')
.blockBorderColor('')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_1100')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_1200')
.blockBorderColor(0xffa500)
.blockBorderColor('#ffc709e9')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderColor_1300')
.blockBorderColor(0xffa500)
.blockBorderColor('bgr(138,43,226)')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0100')
.blockBorderWidth(5)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0200')
.blockBorderWidth('5px')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0300')
.blockBorderWidth($r("app.string.block_border_width_test"))
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0400')
.blockBorderWidth('')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0500')
.blockBorderWidth(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0600')
.blockBorderWidth(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0700')
.blockBorderWidth(0)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0800')
.blockBorderWidth(-1)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_0900')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_1000')
.blockBorderWidth(5)
.blockBorderWidth(7)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_1100')
.blockBorderWidth(5)
.blockBorderWidth(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_1200')
.blockBorderWidth('asdf%^7')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockBorderWidth_1300')
.blockBorderWidth(5)
.width(7)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0100')
.stepColor(0xffa500)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0200')
.stepColor('#ffc709e9')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0300')
.stepColor(Color.Pink)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0400')
.stepColor($r("app.color.start_Step_Color"))
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0500')
.stepColor(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0600')
.stepColor("rgb(0,255,255)")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0700')
.stepColor(0x00ff00)
.backgroundColor(Color.Pink)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0800')
.stepColor(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_0900')
.stepColor('bgr(138,43,226)')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_1000')
.stepColor('')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_1100')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_1200')
.stepColor(0xffa500)
.stepColor('#ffc709e9')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepColor_1300')
.stepColor(0xffa500)
.stepColor('bgr(138,43,226)')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0100')
.trackBorderRadius(0)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0200')
.trackBorderRadius(10)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0300')
.trackBorderRadius('60px')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0400')
.trackBorderRadius('120%')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0500')
.trackBorderRadius($r("app.string.trach_border_radius_test"))
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0600')
.trackBorderRadius("")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0700')
.trackBorderRadius(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0800')
.trackBorderRadius(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_0900')
.trackBorderRadius(-1)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_1000')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_1100')
.trackBorderRadius(10)
.trackBorderRadius(40)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_1200')
.trackBorderRadius(10)
.trackBorderRadius(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_1300')
.trackBorderRadius("asdf#$8")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_trackBorderRadius_1400')
.trackBorderRadius(0)
.size(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0100')
.blockSize({ width: 0, height: 0 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0200')
.blockSize({ width: 5, height: 5 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0300')
.blockSize({ width: 15, height: 20 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0400')
.blockSize({ width: 12, height: 12 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0500')
.blockSize({ width: "20px", height: "20px" })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0600')
.blockSize({ width: "120%", height: "120%" })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0700')
.blockSize({
width: $r("app.string.block_size_width_test"),
height: $r("app.string.block_size_height_test")
})
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0800')
.blockSize({ width: " ", height: " " })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_0900')
.blockSize({ width: null, height: null })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1000')
.blockSize({ width: undefined, height: undefined })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1100')
.blockSize({ width: -1, height: -1 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1200')
.blockSize({ width: -1, height: 15 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1300')
.blockSize({ width: "15", height: "-1" })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1400')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1500')
.blockSize({ width: 15, height: 20 })
.blockSize({ width: "20fp", height: "25fp" })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1600')
.blockSize({ width: 15, height: 20 })
.blockSize({ width: -1, height: -1 })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1700')
.blockSize({ width: "asdf#$8", height: "asdf#$8" })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockSize_1800')
.blockSize({ width: "20lsp", height: "20lsp" })
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0100')
.stepSize(0)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0200')
.stepSize(10)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0300')
.stepSize("60px")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0400')
.stepSize("120%")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0500')
.stepSize($r("app.string.step_size_test"))
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0600')
.stepSize("")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0700')
.stepSize(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0800')
.stepSize(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_0900')
.stepSize(-1)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_1000')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_1100')
.stepSize(10)
.stepSize(40)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_1200')
.stepSize(10)
.stepSize(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_1300')
.stepSize("asdf#$8")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_stepSize_1400')
.stepSize(10)
.size(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_Test_0100')
.blockBorderColor('#ffc709e9')
.blockBorderWidth(10)
.stepColor('#fff10202')
.trackBorderRadius(15)
.blockSize({ width: 10, height: 10 })
.stepSize(10)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0100')
.blockStyle(this.sliderDefault)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0200')
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0300')
.blockStyle(this.sliderImage)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0400')
.blockStyle(this.sliderShapeCircle)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0500')
.blockStyle(this.sliderShapeEllipse)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0600')
.blockStyle(this.sliderShapePath)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0700')
.blockStyle(this.sliderShapeRect)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0800')
.blockStyle(this.sliderDefault)
.blockStyle(this.sliderShapeCircle)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_0900')
.blockStyle(this.sliderImage)
.blockStyle(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_1000')
.blockStyle(" ")
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_1100')
.blockStyle(null)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_1200')
.blockStyle(undefined)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_1300')
.blockStyle(-1)
}
ListItem() {
Slider({
value: this.inSetValueOne,
min: 0,
max: 100,
style: SliderStyle.InSet
})
.key('ArkUX_Stage_Slider_blockStyle_1400')
.blockStyle(this.sliderShapeCircle)
.size(null)
}
}
}
.width('100%')
}
.height('100%')
}
}
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
22de6529
/*
* 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
hilog
from
'
@ohos.hilog
'
;
import
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
addAbilityMonitorCallback : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner OnPrepare
'
);
}
async
onRun
()
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.TestAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a TestAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
'
-D
'
]
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
cmd : %{public}s
'
,
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
hilog
.
isLoggable
(
0x0000
,
'
testTag
'
,
hilog
.
LogLevel
.
INFO
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : err : %{public}s
'
,
JSON
.
stringify
(
err
)
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
stdResult
??
''
);
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
executeShellCommand : data : %{public}s
'
,
d
.
exitCode
??
''
);
})
hilog
.
info
(
0x0000
,
'
testTag
'
,
'
%{public}s
'
,
'
OpenHarmonyTestRunner onRun end
'
);
}
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
22de6529
/*
* 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 sliderTest from './SliderTest'
export default function testsuite() {
sliderTest()
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/ets/test/SliderTest.ets
0 → 100644
浏览文件 @
22de6529
/*
* 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.
*/
//@ts-nocheck
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve("ok")
}, time)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
export default function sliderTest() {
describe('ActsAbilityTest', function () {
/*
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0100
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to 0xffa500
*/
it('ArkUX_Stage_Slider_blockBorderColor_0100', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0100] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0100');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0100 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FFFFA500");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0100 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0200
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to "ffc709e9"
*/
it('ArkUX_Stage_Slider_blockBorderColor_0200', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0200] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0200');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0200 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FFC709E9");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0200 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0300
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to Color.Pink
*/
it('ArkUX_Stage_Slider_blockBorderColor_0300', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0300] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0300');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0300 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FFFFC0CB");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0300 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0400
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to $r("app.color.start_block_Border_Color")
*/
it('ArkUX_Stage_Slider_blockBorderColor_0400', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0400] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0400');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0400 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FF19D41C");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0400 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0500
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to null
*/
it('ArkUX_Stage_Slider_blockBorderColor_0500', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0500] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0500');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0500 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#00000000");
done()
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0500 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0600
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to "rgb(0,255,255)"
*/
it('ArkUX_Stage_Slider_blockBorderColor_0600', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0600] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0600');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0600 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FF00FFFF");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0600 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0700
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to 0x00ff00 and set the backgroundColor attribute to Color.Pink
*/
it('ArkUX_Stage_Slider_blockBorderColor_0700', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0700] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0700');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0700 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FF00FF00");
done();
} catch (err) {
expect().assertFail()
console.info('ArkUX_Stage_Slider_blockBorderColor_0700 ERROR: ' + JSON.stringify(err));
done()
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0800
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to undefined
*/
it('ArkUX_Stage_Slider_blockBorderColor_0800', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0800] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0800');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0800 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#00000000");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0800 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_0900
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to "bgr(138,43,226)"
*/
it('ArkUX_Stage_Slider_blockBorderColor_0900', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_0900] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_0900');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_0900 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#00000000");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_0900 ERROR: ' + JSON.stringify(err));
done()
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_1000
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to " "
*/
it('ArkUX_Stage_Slider_blockBorderColor_1000', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_1000] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_1000');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_1000 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#00000000");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_1000 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_1100
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Do not set the blockBorderColor
*/
it('ArkUX_Stage_Slider_blockBorderColor_1100', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_1100] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_1100');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_1100 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#00000000");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_1100 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_1200
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to 0xffa500a and then set the blockBorderColor attribute to "#ffc709e9"
*/
it('ArkUX_Stage_Slider_blockBorderColor_1200', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_1200] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_1200');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_1200 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FFC709E9");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_1200 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderColor_1300
* @tc.name Test the blockBorderColor property of the Slider component
* @tc.desc Set the blockBorderColor attribute to 0xffa500 and then set the blockBorderColor attribute to "bgr(138,43,226)"
*/
it('ArkUX_Stage_Slider_blockBorderColor_1300', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderColor_1300] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderColor_1300');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_blockBorderColor_1300 is" + JSON.stringify(obj.$attrs.blockBorderColor));
expect(obj.$attrs.blockBorderColor).assertEqual("#FFFFA500");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_1300 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0100
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to 5
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0100', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0100] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0100');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0100 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("5.00vp");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_1100 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0200
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to "5px"
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0200', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0200] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0200');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0200 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("5.00px");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderWidth_0200 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0300
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to $r("app.string.block_border_width_test")
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0300', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0300] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0300');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0300 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("7.00vp");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderColor_1100 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0400
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to ' '
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0400', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0400] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0400');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0400 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("0.00vp");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderWidth_0400 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0500
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to null
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0500', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0500] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0500');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0500 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("0.00px");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderWidth_0500 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0600
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to undefined
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0600', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0600] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0600');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0600 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("0.00px");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderWidth_0600 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0700
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to 0
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0700', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0700] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0700');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0700 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("0.00vp");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderWidth_0700 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
/**
* @tc.number ArkUX_Stage_Slider_blockBorderWidth_0800
* @tc.name Test the blockBorderWidth property of the Slider component
* @tc.desc Set the blockBorderWidth attribute to -1
*/
it('ArkUX_Stage_Slider_blockBorderWidth_0800', 0, async function (done) {
console.info('[ArkUX_Stage_Slider_blockBorderWidth_0800] START');
setTimeout(() => {
try {
let strJson = getInspectorByKey('ArkUX_Stage_Slider_blockBorderWidth_0800');
let obj = JSON.parse(strJson);
console.info("----ArkUX_Stage_Slider_blockBorderWidth_0800 is" + JSON.stringify(obj.$attrs.blockBorderWidth));
expect(obj.$attrs.blockBorderWidth).assertEqual("0.00px");
done();
} catch (err) {
expect().assertFail();
console.info('ArkUX_Stage_Slider_blockBorderWidth_0800 ERROR: ' + JSON.stringify(err));
done();
}
}, 500)
})
})
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/module.json
0 → 100644
浏览文件 @
22de6529
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"feature"
,
"description"
:
"$string:module_test_desc"
,
"mainElement"
:
"TestAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"pages"
:
"$profile:test_pages"
,
"metadata"
:
[{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"true"
}],
"abilities"
:
[
{
"name"
:
"TestAbility"
,
"srcEntrance"
:
"./ets/TestAbility/TestAbility.ets"
,
"description"
:
"$string:TestAbility_desc"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:TestAbility_label"
,
"visible"
:
true
,
"startWindowIcon"
:
"$media:icon"
,
"startWindowBackground"
:
"$color:start_window_background"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
]
}
}
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/element/color.json
0 → 100644
浏览文件 @
22de6529
{
"color"
:
[
{
"name"
:
"start_window_background"
,
"value"
:
"#FFFFFF"
},
{
"name"
:
"start_block_Border_Color"
,
"value"
:
"#FF19D41C"
},
{
"name"
:
"start_Step_Color"
,
"value"
:
"#FF19D41C"
}
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
22de6529
{
"string"
:
[
{
"name"
:
"module_test_desc"
,
"value"
:
"test ability description"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"the test ability"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"test label"
},
{
"name"
:
"block_border_width_test"
,
"value"
:
"7"
},
{
"name"
:
"trach_border_radius_test"
,
"value"
:
"50"
},
{
"name"
:
"block_size_test"
,
"value"
:
"50"
},
{
"name"
:
"step_size_test"
,
"value"
:
"50vp"
},
{
"name"
:
"block_size_width_test"
,
"value"
:
"50vp"
},
{
"name"
:
"block_size_height_test"
,
"value"
:
"50vp"
},
]
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
22de6529
6.6 KB
arkui/ace_ets_components_ux/ace_ets_component_slider/src/main/resources/base/profile/test_pages.json
0 → 100644
浏览文件 @
22de6529
{
"src"
:
[
"TestAbility/pages/Index"
]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录