Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
90c6440f
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看板
提交
90c6440f
编写于
9月 01, 2022
作者:
B
bayanxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ets api覆盖 用例补齐
Signed-off-by:
N
bayanxing
<
bayanxing@kaihong.com
>
上级
9f8c84be
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
424 addition
and
782 deletion
+424
-782
arkui/ace_ets_component_apilack/entry/src/main/config.json
arkui/ace_ets_component_apilack/entry/src/main/config.json
+2
-3
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/alphabetIndexer.ets
.../entry/src/main/ets/MainAbility/pages/alphabetIndexer.ets
+43
-63
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/attr_animate.ets
...ack/entry/src/main/ets/MainAbility/pages/attr_animate.ets
+0
-280
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
...ck/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
+47
-27
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets
...t_apilack/entry/src/main/ets/MainAbility/pages/circle.ets
+2
-5
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets
..._apilack/entry/src/main/ets/MainAbility/pages/ellipse.ets
+28
-19
arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
...s_component_apilack/entry/src/main/ets/test/List.test.ets
+4
-2
arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets
..._apilack/entry/src/main/ets/test/alphabetIndexer.test.ets
+156
-97
arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets
...nt_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets
+25
-128
arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets
...component_apilack/entry/src/main/ets/test/circle.test.ets
+22
-158
arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets
...omponent_apilack/entry/src/main/ets/test/ellipse.test.ets
+82
-0
local.properties
local.properties
+10
-0
package-lock.json
package-lock.json
+3
-0
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/config.json
浏览文件 @
90c6440f
...
...
@@ -71,12 +71,11 @@
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
,
"pages/alphabetIndexer"
,
"pages/attr_animate"
,
"pages/bindContextMenu"
,
"pages/checkBoxGroup"
,
"pages/circle"
,
"pages/
index
"
"pages/
ellipse
"
],
"name"
:
".MainAbility"
,
"window"
:
{
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/alphabetIndexer.ets
浏览文件 @
90c6440f
...
...
@@ -15,6 +15,7 @@
import Log from '../common/Log.ets';
import prompt from '@ohos.prompt'
import events_emitter from '@ohos.events.emitter';
const TAG = 'ets_apiLack_add';
@Entry
...
...
@@ -23,6 +24,8 @@ export default
struct AlphabetIndexerOnSelect {
private value: string[] = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N']
private content: string = "AlphabetIndexer Page"
@State onSelectStatus: boolean = false;
@State onRequestPopupDataStatus: boolean = false;
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear AlphabetIndexerOnSelect start`)
}
...
...
@@ -40,63 +43,6 @@ struct AlphabetIndexerOnSelect {
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("alphabetIndexer-OnSelect")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onSelectText")
Text("alphabetIndexer-OnRequestPopupData")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onRequestPopupDataText")
Text("alphabetIndexer-OnPopupSelect")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("onPopupSelectText")
Text("alphabetIndexer-PopupPosition")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("popupPositionText")
Text(`${this.content}`)
.fontSize(20)
.align(Alignment.Center)
...
...
@@ -112,22 +58,56 @@ struct AlphabetIndexerOnSelect {
.selectedFont({ size: 16, weight: FontWeight.Regular })
.popupFont({ size: 30, weight: FontWeight.Bolder, style: FontStyle.Normal })
.itemSize(28)
.width(100)
.height(300)
.alignStyle(IndexerAlign.Left)
.onSelect((index: number) => {
console.info(this.value[index] + 'on onSelect')
this.showToast("onSelect() " + index);
this.showToast("onSelect() " + index)
this.onSelectStatus = true;
try {
var backData = {
data: {
"STATUS": this.onSelectStatus
}
}
let backEvent = {
eventId: 10201,
priority: events_emitter.EventPriority.LOW
}
console.info("onSelect start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("onSelect emit action state err: " + JSON.stringify(err.message))
}
})
.onPopupSelect((index: number) => {
console.info(this.value[index] + 'on onPopupSelect')
this.showToast("onPopupSelect() " + index)
;
this.showToast("onPopupSelect() " + index)
})
.onRequestPopupData((index: number) => {
console.info(this.value[index] + 'on onRequestPopupData')
this.showToast("onRequestPopupData() " + index);
return ['1','2','3','4','5'];
this.showToast("onRequestPopupData() " + index)
this.onRequestPopupDataStatus = true
try {
var backData = {
data: {
"STATUS": this.onRequestPopupDataStatus
}
}
let backEvent = {
eventId: 10202,
priority: events_emitter.EventPriority.LOW
}
console.info("onRequestPopupData start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("onRequestPopupData emit action state err: " + JSON.stringify(err.message))
}
return ['1', '2', '3', '4', '5']
})
// 这个地方发生crash Error message: is not callable
// .popupPosition({ x:100, y:200})
// .popupPosition({ x:100, y:200})
}.width("100%").height("100%")
}
}
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/attr_animate.ets
已删除
100644 → 0
浏览文件 @
9f8c84be
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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.
*/
@Entry
@Component
struct AttrAnimationExample {
scroller: Scroller = new Scroller()
@State widthSize: number = 200
@State heightSize: number = 80
@State flag: boolean = true
@State widthSizeEaseOut: number = 200
@State heightSizeEaseOut: number = 80
@State flagEaseOut: boolean = true
@State widthSizeFastOutSlowIn: number = 200
@State heightSizeFastOutSlowIn: number = 80
@State flagFastOutSlowIn: boolean = true
@State widthSizeLinearOutSlowIn: number = 200
@State heightSizeLinearOutSlowIn: number = 80
@State flagLinearOutSlowIn: boolean = true
@State widthSizeFastOutLinearIn: number = 200
@State heightSizeFastOutLinearIn: number = 80
@State flagFastOutLinearIn: boolean = true
@State widthSizeExtremeDeceleration: number = 200
@State heightSizeExtremeDeceleration: number = 80
@State flagExtremeDeceleration: boolean = true
@State widthSizeSharp: number = 200
@State heightSizeSharp: number = 80
@State flagSharp: boolean = true
@State widthSizeRhythm: number = 200
@State heightSizeRhythm: number = 80
@State flagRhythm: boolean = true
@State widthSizeSmooth: number = 200
@State heightSizeSmooth: number = 80
@State flagSmooth: boolean = true
@State widthSizeFriction: number = 200
@State heightSizeFriction: number = 80
@State flagFriction: boolean = true
build() {
Column() {
Scroll(this.scroller) {
Column() {
Button('Curve.EaseInOut')
.onClick((event: ClickEvent) => {
if (this.flag) {
this.widthSize = 100
this.heightSize = 50
} else {
this.widthSize = 200
this.heightSize = 80
}
this.flag = !this.flag
})
.width(this.widthSize).height(this.heightSize).backgroundColor(0x317aff)
.animation({
duration: 2000, // 动画时长
curve: Curve.EaseInOut, // 动画曲线
delay: 500, // 动画延迟
iterations: 1, // 播放次数
playMode: PlayMode.Normal // 动画模式
})
Button('Curve.EaseOut')
.onClick((event: ClickEvent) => {
if (this.flagEaseOut) {
this.widthSizeEaseOut = 100
this.heightSizeEaseOut = 50
} else {
this.widthSizeEaseOut = 200
this.heightSizeEaseOut = 80
}
this.flagEaseOut = !this.flagEaseOut
})
.width(this.widthSizeEaseOut).height(this.heightSizeEaseOut).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.EaseOut,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.FastOutSlowIn')
.onClick((event: ClickEvent) => {
if (this.flagFastOutSlowIn) {
this.widthSizeFastOutSlowIn = 100
this.heightSizeFastOutSlowIn = 50
} else {
this.widthSizeFastOutSlowIn = 200
this.heightSizeFastOutSlowIn = 80
}
this.flagFastOutSlowIn = !this.flagFastOutSlowIn
})
.width(this.widthSizeFastOutSlowIn).height(this.heightSizeFastOutSlowIn).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.FastOutSlowIn,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.LinearOutSlowIn')
.onClick((event: ClickEvent) => {
if (this.flagLinearOutSlowIn) {
this.widthSizeLinearOutSlowIn = 100
this.heightSizeLinearOutSlowIn = 50
} else {
this.widthSizeLinearOutSlowIn = 200
this.heightSizeLinearOutSlowIn = 80
}
this.flagLinearOutSlowIn = !this.flagLinearOutSlowIn
})
.width(this.widthSizeLinearOutSlowIn).height(this.heightSizeLinearOutSlowIn).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.LinearOutSlowIn,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.FastOutLinearIn')
.onClick((event: ClickEvent) => {
if (this.flagFastOutLinearIn) {
this.widthSizeFastOutLinearIn = 100
this.heightSizeFastOutLinearIn = 50
} else {
this.widthSizeFastOutLinearIn = 200
this.heightSizeFastOutLinearIn = 80
}
this.flagFastOutLinearIn = !this.flagFastOutLinearIn
})
.width(this.widthSizeFastOutLinearIn).height(this.heightSizeFastOutLinearIn).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.FastOutLinearIn,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.ExtremeDeceleration')
.onClick((event: ClickEvent) => {
if (this.flagExtremeDeceleration) {
this.widthSizeExtremeDeceleration = 100
this.heightSizeExtremeDeceleration = 50
} else {
this.widthSizeExtremeDeceleration = 200
this.heightSizeExtremeDeceleration = 80
}
this.flagExtremeDeceleration = !this.flagExtremeDeceleration
})
.width(this.widthSizeExtremeDeceleration).height(this.heightSizeExtremeDeceleration).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.ExtremeDeceleration,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.Sharp')
.onClick((event: ClickEvent) => {
if (this.flagSharp) {
this.widthSizeSharp = 100
this.heightSizeSharp = 50
} else {
this.widthSizeSharp = 200
this.heightSizeSharp = 80
}
this.flagSharp = !this.flagSharp
})
.width(this.widthSizeSharp).height(this.heightSizeSharp).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.Sharp,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.Rhythm')
.onClick((event: ClickEvent) => {
if (this.flagRhythm) {
this.widthSizeRhythm = 100
this.heightSizeRhythm = 50
} else {
this.widthSizeRhythm = 200
this.heightSizeRhythm = 80
}
this.flagRhythm = !this.flagRhythm
})
.width(this.widthSizeRhythm).height(this.heightSizeRhythm).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.Rhythm,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.Smooth')
.onClick((event: ClickEvent) => {
if (this.flagSmooth) {
this.widthSizeSmooth = 100
this.heightSizeSmooth = 50
} else {
this.widthSizeSmooth = 200
this.heightSizeSmooth = 80
}
this.flagSmooth = !this.flagSmooth
})
.width(this.widthSizeSmooth).height(this.heightSizeSmooth).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.Smooth,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
Button('Curve.Friction')
.onClick((event: ClickEvent) => {
if (this.flagFriction) {
this.widthSizeFriction = 100
this.heightSizeFriction = 50
} else {
this.widthSizeFriction = 200
this.heightSizeFriction = 80
}
this.flagFriction = !this.flagFriction
})
.width(this.widthSizeFriction).height(this.heightSizeFriction).backgroundColor(0x317aff)
.animation({
duration: 2000,
curve: Curve.Friction,
delay: 500,
iterations: 1,
playMode: PlayMode.Normal
})
}.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.scrollBar(BarState.On)
.scrollBarColor(Color.Gray)
.scrollBarWidth(30)
.onScroll((xOffset: number, yOffset: number) => {
console.info(xOffset + ' ' + yOffset)
})
.onScrollEdge((side: Edge) => {
console.info('To the edge')
})
.onScrollEnd(() => {
console.info('Scroll Stop')
})
}.width('100%').margin({ top: 5 })
}
}
\ No newline at end of file
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/checkBoxGroup.ets
浏览文件 @
90c6440f
...
...
@@ -14,7 +14,7 @@
*/
import prompt from '@ohos.prompt'
import events_emitter from '@ohos.events.emitter';
import Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
...
...
@@ -23,6 +23,26 @@ const TAG = 'ets_apiLack_add';
@Component
export default
struct CheckBoxGroupSelectAll {
@State isSelect: boolean = true;
onPageShow() {
console.info('[CheckBoxGroup] page show called');
var stateChangeEvent = {
eventId: 908,
priority: events_emitter.EventPriority.LOW
}
events_emitter.on(stateChangeEvent, this.stateChangCallBack);
}
private stateChangCallBack = (eventData) => {
console.info("[CheckBoxGroup] page stateChangCallBack");
if (eventData != null) {
console.info("[CheckBoxGroup] page state change called:" + JSON.stringify(eventData));
if (eventData.data.isSelect != null) {
this.isSelect = eventData.data.isSelect;
}
}
}
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear CheckBoxGroupSelectAll start`)
...
...
@@ -57,33 +77,33 @@ struct CheckBoxGroupSelectAll {
.key("selectAllText")
Scroll() {
Column() {
CheckboxGroup({group : 'checkboxGroup'})
.selectedColor(0xed6f21)
.key('CheckboxGroup')
.selectAll(true)
.onChange((itemName:CheckboxGroupResult) => {
console.info("TextPicker::dialogResult is" + JSON.stringify(itemName))
this.showToast(itemName.status.valueOf() == 0 ? "selectAll true" : "selectAll false");
})
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.selectedColor(0x39a2db)
.onChange((value: boolean) => {
console.info('Checkbox1 change is' + value)
})
Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
.selectedColor(0x39a2db)
.onChange((value: boolean) => {
console.info('Checkbox2 change is' + value)
})
Checkbox({ name: 'checkbox3', group: 'checkboxGroup' })
.selectedColor(0x39a2db)
.onChange((value: boolean) => {
console.info('Checkbox3 change is' + value)
})
Column() {
CheckboxGroup({group : 'checkboxGroup'})
.selectedColor(0xed6f21)
.key('CheckboxGroup')
.selectAll(this.isSelect)
.onChange((itemName:CheckboxGroupResult) => {
console.info("TextPicker::dialogResult is" + JSON.stringify(itemName))
this.showToast(itemName.status.valueOf() == 0 ? "selectAll true" : "selectAll false");
})
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.selectedColor(0x39a2db)
.onChange((value: boolean) => {
console.info('Checkbox1 change is' + value)
})
Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
.selectedColor(0x39a2db)
.onChange((value: boolean) => {
console.info('Checkbox2 change is' + value)
})
Checkbox({ name: 'checkbox3', group: 'checkboxGroup' })
.selectedColor(0x39a2db)
.onChange((value: boolean) => {
console.info('Checkbox3 change is' + value)
})
}
}
}
}.width("100%").height("100%")
}
}
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/circle.ets
浏览文件 @
90c6440f
...
...
@@ -21,7 +21,7 @@ const TAG = 'ets_apiLack_add';
export default
struct CircleNe {
@State w: string = "100px";
@State h: string = "
2
00px";
@State h: string = "
1
00px";
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear CircleNew start`)
}
...
...
@@ -33,7 +33,7 @@ struct CircleNe {
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("circle-Ne")
Text("circle-Ne
w
")
.width(100)
.height(70)
.fontSize(20)
...
...
@@ -46,9 +46,6 @@ struct CircleNe {
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("neText")
// .onSelect((index: number) => {
// console.info(this.value[index] + 'on onSelect')
// })
Circle()
.width(`${this.w}`)
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/
bindContextMenu
.ets
→
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/
ellipse
.ets
浏览文件 @
90c6440f
...
...
@@ -14,31 +14,40 @@
*/
import Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
struct MenuExample {
// @State responseType: ResponseType = RightClick;
export default
struct EllipseNe {
@State w: string = "300.00px";
@State h: string = "300.00px";
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear EllipseNe start`)
}
@Builder ContextMenuBuilder() {
Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text('text3')
.fontSize(20)
.width(100)
.height(50)
.textAlign(TextAlign.Center)
Divider().height(10)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear EllipseNe end`)
}
build() {
Column() {
Text('click for menu')
}
.width('100%')
.margin({ top: 5 })
//.bindContextMenu(this.ContextMenuBuilder(),this.responseType)
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("ellipse-Ne")
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("neText")
Ellipse().width(`${this.w}`).height(`${this.h}`).key('ellipse')
}.width('100%').height('100%')
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
浏览文件 @
90c6440f
...
...
@@ -15,10 +15,12 @@
import alphabetIndexerOnSelectJsunit from './alphabetIndexer.test.ets';
import checkBoxGroupSelectAllJsunit from './checkBoxGroup.test.ets';
import circleNeJsunit from './circle.test.ets';
import circleNewJsunit from './circle.test.ets';
import ellipseNeJsunit from './ellipse.test.ets';
export default function testsuite() {
alphabetIndexerOnSelectJsunit()
checkBoxGroupSelectAllJsunit()
circleNeJsunit()
circleNewJsunit()
ellipseNeJsunit()
}
\ No newline at end of file
arkui/ace_ets_component_apilack/entry/src/main/ets/test/alphabetIndexer.test.ets
浏览文件 @
90c6440f
...
...
@@ -14,191 +14,250 @@
*/
import router from '@system.router';
import events_emitter from '@ohos.events.emitter';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function alphabetIndexerOnSelectJsunit() {
describe('alphabetIndexerOnSelectTest', function () {
/**
* run before testcase
*/
beforeAll(async function (done) {
console.info('[alphabetIndexerOnSelectTest] before each called')
let result;
console.info("flex beforeEach start");
let options = {
uri: 'pages/alphabetIndexer'
uri: 'pages/alphabetIndexer'
,
}
try {
result = router.push(options)
console.info("push alphabetIndexerOnSelectTest page success " + JSON.stringify(result));
router.clear();
let pages = router.getState();
console.info("get alphabetIndexer state success " + JSON.stringify(pages));
if (!("alphabetIndexer" == pages.name)) {
console.info("get alphabetIndexer state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push alphabetIndexer page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push alphabetIndexer
OnSelectTest page error " + JSON.stringify(result)
);
console.error("push alphabetIndexer
page error: " + err
);
}
await Utils.sleep(4000)
done()
});
/**
* run after testcase
*/
afterAll(async function () {
console.info('[alphabetIndexerOnSelectTest] after each called')
await Utils.sleep(1000)
afterEach(async function () {
await Utils.sleep(1000);
console.info("alphabetIndexerOnSelect after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testalphabetIndexer
OnSelect
0001
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0001
* @tc.name testalphabetIndexer0001
* @tc.desic acealphabetIndexerEtsTest0001
*/
it('testalphabetIndexer
OnSelect
0001', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect
0001 START');
it('testalphabetIndexer
Width
0001', 0, async function (done) {
console.info('alphabetIndexer
Width testalphabetIndexerWidth
0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect
0001] component width strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
Width
0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testalphabetIndexer
OnSelect
0001] width value :" + obj.$attrs.width);
console.info("[testalphabetIndexer
Width
0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testalphabetIndexer
OnSelect
0002
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0002
* @tc.name testalphabetIndexer0002
* @tc.desic acealphabetIndexerEtsTest0002
*/
it('testalphabetIndexer
OnSelec
t0002', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelec
t0002 START');
it('testalphabetIndexer
Heigh
t0002', 0, async function (done) {
console.info('alphabetIndexer
Height testalphabetIndexerHeigh
t0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelec
t0002] component height strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
Heigh
t0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.height).assertEqual("
7
0.00vp");
console.info("[testalphabetIndexer
OnSelec
t0002] height value :" + obj.$attrs.height);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.height).assertEqual("
30
0.00vp");
console.info("[testalphabetIndexer
Heigh
t0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testalphabetIndexer
OnSelect
0003
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0003
* @tc.name testalphabetIndexer0003
* @tc.desic acealphabetIndexerEtsTest0003
*/
it('testalphabetIndexer
OnSelect
0003', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect
0003 START');
it('testalphabetIndexer
Color
0003', 0, async function (done) {
console.info('alphabetIndexer
Color testalphabetIndexerColor
0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect
0003] component fontSize strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
Color
0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
fontSize).assertEqual("20.00fp"
);
console.info("[testalphabetIndexer
OnSelect0003] fontSize value :" + obj.$attrs.fontSize
);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
color).assertEqual(undefined
);
console.info("[testalphabetIndexer
Color0003] color value :" + obj.$attrs.color
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testalphabetIndexer
OnSelect
0004
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0004
* @tc.name testalphabetIndexer0004
* @tc.desic acealphabetIndexerEtsTest0004
*/
it('testalphabetIndexer
OnSelect
0004', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect
0004 START');
it('testalphabetIndexer
SelectedColor
0004', 0, async function (done) {
console.info('alphabetIndexer
SelectedColor testalphabetIndexerSelectedColor
0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexerOnSelect0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
opacity).assertEqual(1
);
console.info("[testalphabetIndexer
OnSelect0004] opacity value :" + obj.$attrs.opacity
);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
selectedColor).assertEqual("#FFFFFFFF"
);
console.info("[testalphabetIndexer
SelectedColor0004] selectedColor value :" + obj.$attrs.selectedColor
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testalphabetIndexer
OnSelect
0005
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0005
* @tc.name testalphabetIndexer0005
* @tc.desic acealphabetIndexerEtsTest0005
*/
it('testalphabetIndexer
OnSelect
0005', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect
0005 START');
it('testalphabetIndexer
PopupColor
0005', 0, async function (done) {
console.info('alphabetIndexer
PopupColor testalphabetIndexerPopupColor
0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect
0005] component align strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
PopupColor
0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
align).assertEqual("Alignment.TopStart
");
console.info("[testalphabetIndexer
OnSelect0005] align value :" + obj.$attrs.align
);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
popupColor).assertEqual("#FF48D1CC
");
console.info("[testalphabetIndexer
PopupColor0005] popupColor value :" + obj.$attrs.popupColor
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testalphabetIndexer
OnSelect
0006
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0006
* @tc.name testalphabetIndexer0006
* @tc.desic acealphabetIndexerEtsTest0006
*/
it('testalphabetIndexer
OnSelect
0006', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect
0006 START');
it('testalphabetIndexer
SelectedBackgroundColor
0006', 0, async function (done) {
console.info('alphabetIndexer
SelectedBackgroundColor testalphabetIndexerSelectedBackgroundColor
0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect
0006] component fontColor strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
SelectedBackgroundColor
0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
fontColor).assertEqual("#FFCCCCCC
");
console.info("[testalphabetIndexer
OnSelect0006] fontColor value :" + obj.$attrs.font
Color);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
selectedBackgroundColor).assertEqual("#FF0000E6
");
console.info("[testalphabetIndexer
SelectedBackgroundColor0006] selectedBackgroundColor value :" + obj.$attrs.selectedBackground
Color);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testalphabetIndexer
OnSelect
0007
* @tc.desic acealphabetIndexer
OnSelect
EtsTest0007
* @tc.name testalphabetIndexer0007
* @tc.desic acealphabetIndexerEtsTest0007
*/
it('testalphabetIndexer
OnSelect
0007', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect
0007 START');
it('testalphabetIndexer
PopupBackground
0007', 0, async function (done) {
console.info('alphabetIndexer
PopupBackground testalphabetIndexerPopupBackground
0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect
0007] component lineHeight strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
PopupBackground
0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
lineHeight).assertEqual("25.00fp
");
console.info("[testalphabetIndexer
OnSelect0007] lineHeight value :" + obj.$attrs.lineHeight
);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
popupBackground).assertEqual("#E500DDDD
");
console.info("[testalphabetIndexer
PopupBackground0007] popupBackground value :" + obj.$attrs.popupBackground
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testalphabetIndexerOnSelect0009
* @tc.desic acealphabetIndexerOnSelectEtsTest0009
* @tc.name testalphabetIndexer0009
* @tc.desic acealphabetIndexerEtsTest0009
*/
it('testalphabetIndexerUsingPopup0009', 0, async function (done) {
console.info('alphabetIndexerUsingPopup testalphabetIndexerUsingPopup009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('alphabetIndexer');
console.info("[testalphabetIndexerUsingPopup0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('AlphabetIndexer');
expect(obj.$attrs.usingPopup).assertEqual(true);
console.info("[testalphabetIndexerUsingPopup0009] usingPopup value :" + obj.$attrs.usingPopup);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testalphabetIndexer0010
* @tc.desic acealphabetIndexerEtsTest0010
*/
it('testalphabetIndexer
OnSelect0009
', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect009
START');
it('testalphabetIndexer
ItemSize0010
', 0, async function (done) {
console.info('alphabetIndexer
ItemSize testalphabetIndexerItemSize0010
START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect0009] component padding
strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
ItemSize0010] component textAlign
strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
padding).assertEqual("10.00vp
");
console.info("[testalphabetIndexer
OnSelect0009] padding value :" + obj.$attrs.padding
);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
itemSize).assertEqual("28.000000
");
console.info("[testalphabetIndexer
ItemSize0010] itemSize value :" + obj.$attrs.itemSize
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testalphabetIndexer
OnSelect0010
* @tc.desic acealphabetIndexer
OnSelectEtsTest0010
* @tc.name testalphabetIndexer
0011
* @tc.desic acealphabetIndexer
EtsTest0011
*/
it('testalphabetIndexer
OnSelect0010
', 0, async function (done) {
console.info('alphabetIndexer
OnSelect testalphabetIndexerOnSelect0010
START');
it('testalphabetIndexer
AlignStyle0011
', 0, async function (done) {
console.info('alphabetIndexer
AlignStyle testalphabetIndexerAlignStyle0011
START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
onSelectText
');
console.info("[testalphabetIndexer
OnSelect0010] component textAlign
strJson:" + strJson);
let strJson = getInspectorByKey('
alphabetIndexer
');
console.info("[testalphabetIndexer
AlignStyle0011] component
strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
textAlign).assertEqual("TextAlign
.Left");
console.info("[testalphabetIndexer
OnSelect0010] textAlign value :" + obj.$attrs.textAlign
);
expect(obj.$type).assertEqual('
AlphabetIndexer
');
expect(obj.$attrs.
alignStyle).assertEqual("AlignStyle
.Left");
console.info("[testalphabetIndexer
ItemSize0010] alignStyle value :" + obj.$attrs.alignStyle
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0012
* @tc.name testalphabetIndexerOnSelect0012
* @tc.desic acealphabetIndexerOnSelectEtsTest0012
*/
it('testalphabetIndexerOnSelect0012', 0, async function (done) {
console.info('alphabetIndexerOnSelect testalphabetIndexerOnSelect0011 START');
await Utils.sleep(2000);
try{
let callback = (indexEvent) => {
console.info("onSelect_0012 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.STATUS).assertEqual(true);
}
let indexEvent = {
eventId: 10201,
priority: events_emitter.EventPriority.LOW
}
sendEventByKey('alphabetIndexer', 10, "")
events_emitter.on(indexEvent, callback);
}catch(err){
console.info("onSelect_0012 on events_emitter err : " + JSON.stringify(err));
}
await Utils.sleep(2000);
try {
var innerEventOne = {
eventId: 10202,
priority: events_emitter.EventPriority.LOW
}
var callback1 = (eventData) => {
console.info("onRequestPopupData_0012 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.STATUS).assertEqual(true);
}
sendEventByKey('alphabetIndexer', 10, "")
console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('alphabetIndexer', 10, "")));
events_emitter.on(innerEventOne, callback1);
} catch (err) {
console.info("onRequestPopupData_0012 on events_emitter err : " + JSON.stringify(err));
}
console.info('testalphabetIndexerOnSelect0012 END');
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/checkBoxGroup.test.ets
浏览文件 @
90c6440f
...
...
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
...
...
@@ -53,12 +54,12 @@ export default function checkBoxGroupSelectAllJsunit() {
it('testcheckBoxGroupSelectAll0001', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('
selectAllText
');
console.info("[testcheckBoxGroupSelectAll0001] component
width
strJson:" + strJson);
let strJson = getInspectorByKey('
CheckboxGroup
');
console.info("[testcheckBoxGroupSelectAll0001] component
selectedColor
strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
width).assertEqual("100.00vp
");
console.info("[testcheckBoxGroupSelectAll0001]
width value :" + obj.$attrs.width
);
expect(obj.$type).assertEqual('
CheckboxGroup
');
expect(obj.$attrs.
selectedColor).assertEqual("#FFED6F21
");
console.info("[testcheckBoxGroupSelectAll0001]
selectedColor value :" + obj.$attrs.selectedColor
);
done();
});
...
...
@@ -69,132 +70,28 @@ export default function checkBoxGroupSelectAllJsunit() {
*/
it('testcheckBoxGroupSelectAll0002', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0002 START');
try {
var eventData = {
data: {
"isSelect": false
}
}
var innerEvent = {
eventId: 908,
priority: events_emitter.EventPriority.LOW
}
console.info("[testcheckBoxGroupSelectAll0002] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[testcheckBoxGroupSelectAll0002] change component data error: " + err.message);
}
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testcheckBoxGroupSelectAll0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testcheckBoxGroupSelectAll0003
* @tc.desic acecheckBoxGroupSelectAllEtsTest0003
*/
it('testcheckBoxGroupSelectAll0003', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testcheckBoxGroupSelectAll0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testcheckBoxGroupSelectAll0004
* @tc.desic acecheckBoxGroupSelectAllEtsTest0004
*/
it('testcheckBoxGroupSelectAll0004', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testcheckBoxGroupSelectAll0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testcheckBoxGroupSelectAll0005
* @tc.desic acecheckBoxGroupSelectAllEtsTest0005
*/
it('testcheckBoxGroupSelectAll0005', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testcheckBoxGroupSelectAll0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testcheckBoxGroupSelectAll0006
* @tc.desic acecheckBoxGroupSelectAllEtsTest0006
*/
it('testcheckBoxGroupSelectAll0006', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testcheckBoxGroupSelectAll0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testcheckBoxGroupSelectAll0007
* @tc.desic acecheckBoxGroupSelectAllEtsTest0007
*/
it('testcheckBoxGroupSelectAll0007', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testcheckBoxGroupSelectAll0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testcheckBoxGroupSelectAll0009
* @tc.desic acecheckBoxGroupSelectAllEtsTest0009
*/
it('testcheckBoxGroupSelectAll0009', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testcheckBoxGroupSelectAll0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testcheckBoxGroupSelectAll0010
* @tc.desic acecheckBoxGroupSelectAllEtsTest0010
*/
it('testcheckBoxGroupSelectAll0010', 0, async function (done) {
console.info('checkBoxGroupSelectAll testcheckBoxGroupSelectAll0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('selectAllText');
console.info("[testcheckBoxGroupSelectAll0010] component textAlign strJson:" + strJson);
let strJson = getInspectorByKey('CheckboxGroup');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text'
);
expect(obj.$attrs.
textAlign).assertEqual("TextAlign.Left"
);
console.info(
"[testcheckBoxGroupSelectAll0010] textAlign value :" + obj.$attrs.textAlign
);
console.info("[testcheckBoxGroupSelectAll0002] obj is: " + JSON.stringify(obj)
);
expect(obj.$attrs.
selectAll).assertEqual('false'
);
console.info(
'testcheckBoxGroupSelectAll0002 END'
);
done();
});
})
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/test/circle.test.ets
浏览文件 @
90c6440f
...
...
@@ -17,10 +17,10 @@ import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function circleNeJsunit() {
describe('circleNeTest', function () {
export default function circleNe
w
Jsunit() {
describe('circleNe
w
Test', function () {
beforeAll(async function (done) {
console.info("
flex
beforeEach start");
console.info("
circle
beforeEach start");
let options = {
uri: 'pages/circle',
}
...
...
@@ -42,176 +42,40 @@ export default function circleNeJsunit() {
afterEach(async function () {
await Utils.sleep(1000);
console.info("circleNe after each called");
console.info("circleNe
w
after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00
0
1
* @tc.name testcircleNe
0
001
* @tc.desic acecircleNe
EtsTest0
001
* @tc.number SUB_ACE_BASIC_ETS_API_001
* @tc.name testcircleNe
w
001
* @tc.desic acecircleNe
wEtsTest
001
*/
it('testcircleNe
0
001', 0, async function (done) {
console.info('circleNe
testcircleNe000
1 START');
it('testcircleNe
w
001', 0, async function (done) {
console.info('circleNe
w testcircleNew001
1 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testcircleNe0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testcircleNe0002
* @tc.desic acecircleNeEtsTest0002
*/
it('testcircleNe0002', 0, async function (done) {
console.info('circleNe testcircleNe0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testcircleNe0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testcircleNe0003
* @tc.desic acecircleNeEtsTest0003
*/
it('testcircleNe0003', 0, async function (done) {
console.info('circleNe testcircleNe0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testcircleNe0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testcircleNe0004
* @tc.desic acecircleNeEtsTest0004
*/
it('testcircleNe0004', 0, async function (done) {
console.info('circleNe testcircleNe0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testcircleNe0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testcircleNe0005
* @tc.desic acecircleNeEtsTest0005
*/
it('testcircleNe0005', 0, async function (done) {
console.info('circleNe testcircleNe0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testcircleNe0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testcircleNe0006
* @tc.desic acecircleNeEtsTest0006
*/
it('testcircleNe0006', 0, async function (done) {
console.info('circleNe testcircleNe0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testcircleNe0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testcircleNe0007
* @tc.desic acecircleNeEtsTest0007
*/
it('testcircleNe0007', 0, async function (done) {
console.info('circleNe testcircleNe0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testcircleNe0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testcircleNe0009
* @tc.desic acecircleNeEtsTest0009
*/
it('testcircleNe0009', 0, async function (done) {
console.info('circleNe testcircleNe009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testcircleNe0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testcircleNe0010
* @tc.desic acecircleNeEtsTest0010
*/
it('testcircleNe0010', 0, async function (done) {
console.info('circleNe testcircleNe0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('neText');
console.info("[testcircleNe0010] component textAlign strJson:" + strJson);
let strJson = getInspectorByKey('circle');
console.info("[testcircleNew001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('
Text
');
expect(obj.$attrs.
textAlign).assertEqual("TextAlign.Left
");
console.info("[testcircleNe
0010] textAlign value :" + obj.$attrs.textAlign
);
expect(obj.$type).assertEqual('
Shape
');
expect(obj.$attrs.
width).assertEqual("100.00px
");
console.info("[testcircleNe
w001] width value :" + obj.$attrs.width
);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00
11
* @tc.name testcircleNe
0011
* @tc.desic acecircleNe
EtsTest0011
* @tc.number SUB_ACE_BASIC_ETS_API_00
2
* @tc.name testcircleNe
w002
* @tc.desic acecircleNe
wEtsTest002
*/
it('testcircleNe
0011
', 0, async function (done) {
console.info('circleNe
testcircleNe0011
START');
it('testcircleNe
w002
', 0, async function (done) {
console.info('circleNe
w testcircleNew002
START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('circle');
console.info("[testcircleNe
0011
] component textAlign strJson:" + strJson);
console.info("[testcircleNe
w002
] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.
width
).assertEqual("100.00px");
console.info("[testcircleNe
0011
] width value :" + obj.$attrs.width);
expect(obj.$attrs.
height
).assertEqual("100.00px");
console.info("[testcircleNe
w002
] width value :" + obj.$attrs.width);
done();
});
})
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/test/ellipse.test.ets
0 → 100644
浏览文件 @
90c6440f
/**
* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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 router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function ellipseNeJsunit() {
describe('ellipseNeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/ellipse',
}
try {
router.clear();
let pages = router.getState();
console.info("get ellipse state success " + JSON.stringify(pages));
if (!("ellipse" == pages.name)) {
console.info("get ellipse state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push ellipse page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push ellipse page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("ellipseNe after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testellipseNe0001
* @tc.desic aceellipseNeEtsTest0001
*/
it('testellipseNe0001', 0, async function (done) {
console.info('ellipseNe testellipseNe0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('ellipse');
console.info("[testellipseNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.width).assertEqual("300.00px");
console.info("[testellipseNe0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testellipseNe0002
* @tc.desic aceellipseNeEtsTest0002
*/
it('testellipseNe0002', 0, async function (done) {
console.info('ellipseNe testellipseNe0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('ellipse');
console.info("[testellipseNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape');
expect(obj.$attrs.height).assertEqual("300.00px");
console.info("[testellipseNe0002] height value :" + obj.$attrs.height);
done();
});
})
}
local.properties
0 → 100644
浏览文件 @
90c6440f
# This file is automatically generated by DevEco Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# For customization when using a Version Control System, please read the header note.
sdk.dir
=
D:/beta3Sdk
nodejs.dir
=
D:/software/DevEco Studio 3.0.0.900/tools/nodejs
npm.dir
=
D:/software/DevEco Studio 3.0.0.900/tools/nodejs
\ No newline at end of file
package-lock.json
0 → 100644
浏览文件 @
90c6440f
{
"lockfileVersion"
:
1
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录