Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
07e21563
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
07e21563
编写于
1月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
1月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1714 ACE api覆盖率补充
Merge pull request !1714 from 刘旭/master
上级
b3703101
98665070
变更
42
隐藏空白更改
内联
并排
Showing
42 changed file
with
931 addition
and
84 deletion
+931
-84
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Badge.ets
+1
-1
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets
..._standard/entry/src/main/ets/MainAbility/pages/Button.ets
+3
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets
..._standard/entry/src/main/ets/MainAbility/pages/Column.ets
+1
-1
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets
...andard/entry/src/main/ets/MainAbility/pages/DataPanel.ets
+11
-3
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets
...ts_standard/entry/src/main/ets/MainAbility/pages/Flex.ets
+3
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets
...rd/entry/src/main/ets/MainAbility/pages/GridContainer.ets
+1
-1
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Image.ets
+30
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets
...andard/entry/src/main/ets/MainAbility/pages/Navigator.ets
+8
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets
...s_standard/entry/src/main/ets/MainAbility/pages/Panel.ets
+8
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets
...tandard/entry/src/main/ets/MainAbility/pages/Progress.ets
+34
-3
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets
..._standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets
+11
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets
..._standard/entry/src/main/ets/MainAbility/pages/Rating.ets
+13
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets
..._standard/entry/src/main/ets/MainAbility/pages/Scroll.ets
+50
-12
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
..._standard/entry/src/main/ets/MainAbility/pages/Slider.ets
+24
-2
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets
...ts_standard/entry/src/main/ets/MainAbility/pages/Span.ets
+13
-1
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets
...ts_standard/entry/src/main/ets/MainAbility/pages/Text.ets
+7
-1
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets
.../entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets
+9
-4
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets
...entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets
+6
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets
...ry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets
+29
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets
...d/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets
+6
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets
.../entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets
+9
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets
...try/src/main/ets/MainAbility/test/ProgressJsunit.test.ets
+48
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets
...entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets
+1
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets
...entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets
+19
-2
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets
...entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets
+17
-15
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets
...d/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets
+5
-0
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets
...d/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets
+7
-1
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets
...test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets
+283
-1
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets
.../entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets
+7
-0
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets
...ts_test/entry/src/main/ets/MainAbility/pages/Calendar.ets
+43
-12
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets
...est/entry/src/main/ets/MainAbility/pages/CustomDialog.ets
+22
-10
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets
...ce_ets_test/entry/src/main/ets/MainAbility/pages/List.ets
+63
-6
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets
...ts_test/entry/src/main/ets/MainAbility/pages/ListItem.ets
+22
-4
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets
..._ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets
+5
-0
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets
...ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets
+6
-0
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets
...e_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets
+37
-0
ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets
...try/src/main/ets/MainAbility/test/ListItemJsunit.test.ets
+48
-4
ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets
...entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets
+1
-0
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets
..._test/entry/src/main/ets/MainAbility/pages/Navigation.ets
+3
-0
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets
...ird_test/entry/src/main/ets/MainAbility/pages/Stepper.ets
+6
-0
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets
...rd_test/entry/src/main/ets/MainAbility/pages/TextArea.ets
+2
-0
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets
...d_test/entry/src/main/ets/MainAbility/pages/TextInput.ets
+9
-0
未找到文件。
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Badge.ets
浏览文件 @
07e21563
...
...
@@ -57,7 +57,7 @@ struct badge {
count: this.counts,
position: BadgePosition.RightTop,
maxCount: 99,
style: { color: 0xFFFFFF, fontSize:
16, badgeSize: 20
, badgeColor: Color.Red }
style: { color: 0xFFFFFF, fontSize:
'16', badgeSize: '20'
, badgeColor: Color.Red }
}) {
Button('message')
.onClick(() => {
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Button.ets
浏览文件 @
07e21563
...
...
@@ -36,6 +36,9 @@ struct button_testcase {
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button('1.value', { type: ButtonType.Circle, stateEffect: this.stateEffect })
.fontSize(12)
.fontWeight(FontWeight.Bold)
.fontColor(0xCCCCCC)
.height(40)
.width(40)
.key('button')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Column.ets
浏览文件 @
07e21563
...
...
@@ -36,7 +36,7 @@ struct column {
}.alignItems(HorizontalAlign.Center).width('90%').border({ width: 1 }).key('column')
Text('alignItems(Start)').fontSize(9).fontColor(0xCCCCCC).width('90%')
Column() {
Column(
{ space: '5' }
) {
Column().width('50%').height(50).backgroundColor(0xAFEEEE)
Column().width('50%').height(50).backgroundColor(0x00FFFF)
}.alignItems(HorizontalAlign.Start).width('90%').border({ width: 1 }).key('column1')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/DataPanel.ets
浏览文件 @
07e21563
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router'
@Entry
...
...
@@ -35,7 +35,7 @@ struct dataPanel_testcase {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
DataPanel({ values: [20, 40, 20], max: 100 })
DataPanel({ values: [20, 40, 20], max: 100
, type: DataPanelType.Line
})
.width(this.width)
.height(this.height)
.key('DataPanel')
...
...
@@ -44,7 +44,7 @@ struct dataPanel_testcase {
})
.closeEffect(false)
DataPanel({ values: [20, 40, 20], max: 100
})
DataPanel({ values: [20, 40, 20], max: 100
, type: DataPanelType.Circle
})
.width(this.width)
.height(this.height)
.key('DataPanel2')
...
...
@@ -52,6 +52,14 @@ struct dataPanel_testcase {
router.back()
})
.closeEffect(true)
DataPanel({ values: [20, 40, 20], max: 100})
.width(this.width)
.height(this.height)
.key('DataPanel3')
.onClick(() => {
router.back()
})
.closeEffect(false)
}
.key('flex')
.width('100%')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Flex.ets
浏览文件 @
07e21563
...
...
@@ -34,6 +34,7 @@ struct flex {
direction: FlexDirection.Column,
wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.Center,
alignItems:ItemAlign.Start,
alignContent: FlexAlign.Start,
}) {
Text('1').width('100%').height(20).backgroundColor(0xF5DEB3)
...
...
@@ -51,6 +52,7 @@ struct flex {
direction: FlexDirection.Row,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.Start,
alignItems:ItemAlign.Start,
alignContent: FlexAlign.Center,
}) {
Text('1').width('20%').height(20).backgroundColor(0xF5DEB3)
...
...
@@ -68,6 +70,7 @@ struct flex {
direction: FlexDirection.RowReverse,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.End,
alignItems:ItemAlign.End,
alignContent: FlexAlign.End,
}) {
Text('1').width('50%').height(20).backgroundColor(0xF5DEB3)
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/GridContainer.ets
浏览文件 @
07e21563
...
...
@@ -76,7 +76,7 @@ struct gridContainer {
}).backgroundColor(0x317aff)
}
GridContainer({ columns:
12, sizeType: SizeType.MD, gutter: 10, margin: 20
}) {
GridContainer({ columns:
"auto", sizeType: SizeType.MD, gutter: '10', margin: '20'
}) {
Row() {
Text('1')
.useSizeType({
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Image.ets
浏览文件 @
07e21563
...
...
@@ -16,6 +16,17 @@
@Entry
@Component
struct image_textcase {
@State Width: number = 0
@State height: number = 0
onPageShow() {
console.info('Image page show called');
}
onBuildDone() {
console.info('Image page build done called');
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Column() {
...
...
@@ -23,10 +34,15 @@ struct image_textcase {
.fontSize(50)
.fontWeight(FontWeight.Bold)
Image("/resources/rawfile/hand.png")
.matchTextDirection(false)
.fitOriginalSize(false)
.fillColor(0xCCCCCC)
.objectFit(ImageFit.Cover)
.objectRepeat(ImageRepeat.NoRepeat)
.interpolation(ImageInterpolation.None)
.renderMode(ImageRenderMode.Original)
.autoResize(false)
.syncLoad(false)
.sourceSize({ width: 200, height: 100 })
.alt("/resources/rawfile/person.png")
.key('image1')
...
...
@@ -36,6 +52,20 @@ struct image_textcase {
.interpolation(ImageInterpolation.High)
.renderMode(ImageRenderMode.Template)
.key('image2')
.height(180)
.width(180)
.onComplete((msg: {
width: number,
height: number
}) => {
this.Width = msg.width
this.height = msg.height
console.info('Width ----' + this.Width)
console.info('height ----' + this.height)
})
.onError(() => {
console.info('load image fail')
})
Image("/resources/rawfile/hand.png")
.objectFit(ImageFit.Fill)
.objectRepeat(ImageRepeat.Y)
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Navigator.ets
浏览文件 @
07e21563
...
...
@@ -19,6 +19,14 @@ struct navigator_testcase {
@State active: boolean = false
@State params: Object = { text: 'news' }
onPageShow() {
console.info('Navigator page show called');
}
onBuildDone() {
console.info('Navigator page build done called');
}
build() {
Column() {
Navigator({ target: "pages/index", type: NavigationType.Back }) {
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Panel.ets
浏览文件 @
07e21563
...
...
@@ -18,6 +18,14 @@
struct PanelExample {
@State show: boolean = true
onPageShow() {
console.info('Panel page show called');
}
onBuildDone() {
console.info('Panel page build done called');
}
build() {
Column() {
Text('2021-09-30 Today Calendar: 1.afternoon......Click for details')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Progress.ets
浏览文件 @
07e21563
...
...
@@ -12,10 +12,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct progress_testcase {
onPageShow() {
console.info('Progress page show called');
}
onBuildDone() {
console.info('Progress page build done called');
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Column() {
...
...
@@ -27,6 +35,8 @@ struct progress_testcase {
.color(Color.Blue)
.width(50)
.height(70)
.circularStyle({ strokeWidth: 10, scaleCount: 2, scaleWidth: 10 })
.cricularStyle({ strokeWidth: 10, scaleCount: 2, scaleWidth: 10 })
.key('progress')
Progress({ value: 20, total: 40, style: ProgressStyle.Eclipse })
...
...
@@ -36,9 +46,30 @@ struct progress_testcase {
.height(70)
.key('progress2')
Progress({ value: 20, total: 40, style: ProgressStyle.Ring })
.value(3)
.color(Color.Blue)
.width(50)
.height(70)
.key('progress3')
Progress({ value: 20, total: 40, style: ProgressStyle.ScaleRing })
.value(3)
.color(Color.Blue)
.width(50)
.height(70)
.key('progress4')
Progress({ value: 20, total: 40, style: ProgressStyle.Capsule })
.value(3)
.color(Color.Blue)
.width(50)
.height(70)
.key('progress5')
}
.width(
3
00)
.height(
3
00)
.width(
4
00)
.height(
4
00)
.borderColor(Color.Pink)
.borderWidth(2)
}
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Qrcode.ets
浏览文件 @
07e21563
...
...
@@ -16,6 +16,16 @@
@Entry
@Component
struct qrcode_textcase {
@State Color: Color = Color.Pink
onPageShow() {
console.info('Qrcode page show called');
}
onBuildDone() {
console.info('Qrcode page build done called');
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`Qrcode page`)
...
...
@@ -23,6 +33,7 @@ struct qrcode_textcase {
.fontWeight(FontWeight.Bold)
QRCode('hello world')
.color("#FFFFC0CB")
.backgroundColor(this.Color)
.width("200")
.height("100")
.key('qrcode')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Rating.ets
浏览文件 @
07e21563
...
...
@@ -16,6 +16,16 @@
@Entry
@Component
struct rating_testcase {
@State rating: number = 2
onPageShow() {
console.info('Rating page show called');
}
onBuildDone() {
console.info('Rating page build done called');
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Column() {
...
...
@@ -30,6 +40,9 @@ struct rating_testcase {
foregroundUri: '/resources/rawfile/star-1-3.png',
secondaryUri: '/resources/rawfile/star-1-2.png'
})
.onChange((value: number) => {
this.rating = value
})
.key('rating1')
Rating({ rating: 2, indicator: true })
.stepSize(0.5)
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Scroll.ets
浏览文件 @
07e21563
...
...
@@ -21,7 +21,7 @@ struct scroll_testcase {
@State scrollBarColor: Color = Color.Pink
@State scrollBar: BarState= BarState.On
private value1: Array<number> = [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
@State edge: Edge= Edge.
Bottom
@State edge: Edge= Edge.
Top
private content: string = "Scroll Page";
scroller: Scroller = new Scroller();
...
...
@@ -60,19 +60,21 @@ struct scroll_testcase {
.scrollBarColor(this.scrollBarColor)
.scrollBarWidth(this.scrollBarWidth)
.key('scroll')
.width(
3
00)
.width(
4
00)
.height(200)
.onScroll((xOffset: number, yOffset: number) => {
console.
error
(` current offset is ${xOffset} ${yOffset}`)
console.
info
(` current offset is ${xOffset} ${yOffset}`)
})
.onScrollEnd(() => {
console.error(` now on scroll end`)
console.info(` now on scroll end`)
})
.onScrollEdge((side: Edge) => {
console.info(`To the edge`)
})
Scroll() {
Row() {
Text('scroll uppppp')
.width(
8
0)
.width(
6
0)
.height(100)
.backgroundColor(Color.Yellow)
.margin({
...
...
@@ -82,7 +84,7 @@ struct scroll_testcase {
.key('text')
Text('scroll to')
.width(
10
0)
.width(
6
0)
.height(100)
.backgroundColor(Color.Green)
.margin({
...
...
@@ -96,7 +98,7 @@ struct scroll_testcase {
})
})
Text('scroll page')
.width(
10
0)
.width(
6
0)
.height(100)
.backgroundColor(Color.Blue)
.margin({
...
...
@@ -108,9 +110,45 @@ struct scroll_testcase {
next: true
})
})
Text('scroll Edge')
.width(60)
.height(100)
.backgroundColor(Color.Blue)
.margin({
right: 5,
left: 5
})
.onClick(() => {
this.scroller.scrollEdge(Edge.Top)
})
Text('scroll Edge')
.width(60)
.height(100)
.backgroundColor(Color.Blue)
.margin({
right: 5,
left: 5
})
.onClick(() => {
this.scroller.currentOffset()
})
Text('scroll to index')
.width(60)
.height(100)
.backgroundColor(Color.Blue)
.margin({
right: 5,
left: 5
})
.onClick(() => {
this.scroller.scrollToIndex(0)
console.info(` now on scroll end`)
})
}
}
.height(100).scrollable(ScrollDirection.Horizontal)
.key('scroll1')
.height(100)
.scrollable(ScrollDirection.Horizontal)
Scroll() {
Column() {
...
...
@@ -132,7 +170,7 @@ struct scroll_testcase {
.scrollBarWidth(5)
.width(300)
.height(200)
.key('scroll
1
')
.key('scroll
2
')
Scroll() {
Column() {
...
...
@@ -148,13 +186,13 @@ struct scroll_testcase {
}
}
.padding(10)
.scrollable(ScrollDirection.
Horizontal
)
.scrollable(ScrollDirection.
Free
)
.scrollBar(BarState.Off)
.scrollBarColor(Color.Red)
.scrollBarWidth(5)
.width(300)
.height(200)
.key('scroll
2
')
.key('scroll
3
')
}
.key('flex')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Slider.ets
浏览文件 @
07e21563
...
...
@@ -16,6 +16,19 @@
@Entry
@Component
struct slider {
@State inSetValue: number= 40
@State outSetValue: number= 40
@State direction: Axis= Axis.Horizontal
@State Begin: number = SliderChangeMode.Begin
onPageShow() {
console.info('Slider page show called');
}
onBuildDone() {
console.info('Slider page build done called');
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Column() {
...
...
@@ -23,18 +36,27 @@ struct slider {
.fontSize(50)
.fontWeight(FontWeight.Bold)
Slider({
value:
40
,
value:
this.outSetValue
,
min: 0,
max: 100,
step: 1,
direction: Axis.Horizontal,
reverse: false,
style: SliderStyle.OutSet
})
.blockColor('#FFFF0000')
.selectedColor('#FF0000FF')
.trackColor('#FF808080')
.minLabel('10')
.maxLabel('10')
.showTips(false)
.showSteps(false)
.width("200")
.onChange((value: number, mode: SliderChangeMode) => {
this.outSetValue = value
this.Begin = mode
console.info('value: ' + value + '---mode: ' + mode)
})
.width("100")
.height("100")
.key('slider1')
Slider({
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Span.ets
浏览文件 @
07e21563
...
...
@@ -16,6 +16,15 @@
@Entry
@Component
struct span_textcase {
onPageShow() {
console.info('Span page show called');
}
onBuildDone() {
console.info('Span page build done called');
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Column() {
...
...
@@ -25,13 +34,16 @@ struct span_textcase {
.textCase(TextCase.UpperCase)
.fontColor(Color.Blue)
.fontSize("20fp")
.letterSpacing(5)
.fontFamily("sans-serif")
.fontWeight(FontWeight.Bold)
.fontStyle(FontStyle.Italic)
.key('span1')
Span('The second test Span demo')
.textCase(TextCase.LowerCase)
.fontColor(Color.Black)
.fontSize("30fp")
.letterSpacing('5')
.fontSize(30)
.key('span2')
Span('The third test Span demo')
.textCase(TextCase.Normal)
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/pages/Text.ets
浏览文件 @
07e21563
...
...
@@ -79,6 +79,9 @@ struct text_textcase {
@State zIndex: number = 1
@State fontStyle: FontStyle = FontStyle.Italic
@State fontSize: number = 15
@State minFontSize: number = 15
@State maxFontSize: number = 15
@State letterSpacing: number= 10
@State fontWeight: FontWeight= FontWeight.Bold
@State fontColor: Color= Color.Black
@State active: boolean = false
...
...
@@ -124,6 +127,9 @@ struct text_textcase {
.zIndex(this.zIndex)
.fontColor(this.fontColor)
.fontSize(this.fontSize)
.minFontSize(this.minFontSize)
.letterSpacing(this.letterSpacing)
.maxFontSize(this.maxFontSize)
.fontWeight(this.fontWeight)
.fontStyle(this.fontStyle)
.fontFamily("sans-serif")
...
...
@@ -141,7 +147,7 @@ struct text_textcase {
.size({ width: 100, height: 50 })
.padding({ bottom: 5, top: 5, right: 5, left: 10 })
.margin({ bottom: 15, top: 10, right: 10, left: 10 })
.fontSize(
13
)
.fontSize(
'13'
)
.textAlign(TextAlign.Start)
.align(Alignment.Start)
.direction(Direction.Ltr)
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/BadgeJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -64,6 +64,7 @@ export default function badgeJsunit() {
console.info('new Badge0 START');
let strJson = getInspectorByKey('badge');
let obj = JSON.parse(strJson);
let style = JSON.parse(obj.$attrs.style)
expect(obj.$type).assertEqual('Badge');
console.log(JSON.stringify(obj.$type))
console.info("yr badge0 type: " + JSON.stringify(obj.$type));
...
...
@@ -74,10 +75,9 @@ export default function badgeJsunit() {
console.log("yr badge0 position-BadgePosition.Right" + JSON.stringify(obj.$attrs.position))
expect(obj.$attrs.maxCount).assertEqual('99');
console.log("yr badge0 maxCount-'99'" + JSON.stringify(obj.$attrs.maxCount))
let style = JSON.parse(obj.$attrs.style)
console.log(style.color)
console.log(style.fontSize)
console.log(style.badgeSize)
console.log("yr badge0 style.color" + style.color);
console.log("yr badge0 style.fontSize" + style.fontSize);
console.log("yr badge0 style.badgeSize" + style.badgeSize);
expect(style.color).assertEqual('#FFFFFFFF');
expect(style.fontSize).assertEqual('16.000000fp');
expect(style.badgeSize).assertEqual('20.000000fp');
...
...
@@ -95,9 +95,14 @@ export default function badgeJsunit() {
console.info('new Badge1 START');
let strJson = getInspectorByKey('badge1');
let obj = JSON.parse(strJson);
let style = JSON.parse(obj.$attrs.style)
console.info("component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.position).assertEqual('BadgePosition.RightTop');
console.log("yr badge1 position-'BadgePosition.RightTop'" + JSON.stringify(obj.$attrs.position))
console.log("yr badge0 style.fontSize" + style.fontSize);
console.log("yr badge0 style.badgeSize" + style.badgeSize);
expect(style.fontSize).assertEqual('16.000000fp');
expect(style.badgeSize).assertEqual('20.000000fp');
console.info('new Badge1 END');
done();
});
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ButtonJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -64,15 +64,21 @@ export default function buttonJsunit() {
console.info('testGetInspectorByKey START');
let strJson = getInspectorByKey('button');
let obj = JSON.parse(strJson);
let style = JSON.parse(obj.$attrs.style)
console.log(style.fontSize)
console.info("cd button component obj is: " + JSON.stringify(obj));
console.log("cd button type" + JSON.stringify(obj.$type));
console.log("cd button Buttontype" + JSON.stringify(obj.$attrs.type));
console.log("cd button stateEffect" + JSON.stringify(obj.$attrs.stateEffect));
console.log("cd button label" + JSON.stringify(obj.$attrs.label));
console.log("cd button fontSize" + JSON.stringify(obj.$attrs.fontSize));
console.log("cd button fontWeight" + JSON.stringify(obj.$attrs.fontWeight));
console.log("cd button fontColor" + JSON.stringify(obj.$attrs.fontColor));
expect(obj.$type).assertEqual('Button')
expect(obj.$attrs.type).assertEqual('ButtonType.Circle')
expect(obj.$attrs.stateEffect).assertEqual('true')
expect(obj.$attrs.label).assertEqual('1.value')
expect(obj.$attrs.fontSize).assertEqual('12')
console.info('cd buttonInspectorByKey END');
done();
});
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/DataPanelJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -69,10 +69,12 @@ export default function datapanelJsunit() {
console.log("cd DataPanel values1 " + typeof ([20, 40, 20]));
console.log("cd DataPanel values " + typeof (obj.$attrs.values));
console.log("cd DataPanel values" + JSON.stringify(obj.$attrs.values));
console.log("cd DataPanel dataPanelType" + JSON.stringify(obj.$attrs.DataPanelType));
console.log("cd DataPanel max" + JSON.stringify(obj.$attrs.max));
console.log("panel closeEffect" + JSON.stringify(obj.$attrs.closeEffect))
expect(obj.$attrs.closeEffect).assertEqual("false")
expect(obj.$type).assertEqual("DataPanel")
expect(obj.$attrs.DataPanelType).assertEqual("Line")
expect(JSON.stringify(obj.$attrs.values)).assertEqual('[20,40,20]')
expect(obj.$attrs.max).assertEqual(100.000000.toFixed(6))
console.info('cd dataPanelInspectorByKey END');
...
...
@@ -89,10 +91,37 @@ export default function datapanelJsunit() {
let strJson = getInspectorByKey('DataPanel2');
let obj = JSON.parse(strJson);
console.info("cd DatePanel component obj is: " + JSON.stringify(obj));
console.log("cd DataPanel dataPanelType" + JSON.stringify(obj.$attrs));
console.log("cd DataPanel Type" + JSON.stringify(obj.$attrs.type));
expect(obj.$attrs.type).assertEqual("DataPanelType.Circle")
console.log("panel closeEffect" + JSON.stringify(obj.$attrs.closeEffect))
expect(obj.$attrs.closeEffect).assertEqual("true")
console.info('cd dataPanelInspectorByKey END');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_0740
* @tc.name testDataPanelGetInspectorByKey020
* @tc.desc aceEtsTest
*/
it('testDataPanelGetInspectorByKey030', 0, async function (done) {
console.info('testGetInspectorByKey START');
let strJson = getInspectorByKey('DataPanel3');
let obj = JSON.parse(strJson);
console.info("cd DatePanel component obj is: " + JSON.stringify(obj));
console.log("cd DataPanel type " + JSON.stringify(obj.$type));
console.log("cd DataPanel values1 " + typeof ([20, 40, 20]));
console.log("cd DataPanel values " + typeof (obj.$attrs.values));
console.log("cd DataPanel values" + JSON.stringify(obj.$attrs.values));
console.log("cd DataPanel max" + JSON.stringify(obj.$attrs.max));
console.log("panel closeEffect" + JSON.stringify(obj.$attrs.closeEffect))
expect(obj.$attrs.closeEffect).assertEqual("false")
expect(obj.$type).assertEqual("DataPanel")
expect(JSON.stringify(obj.$attrs.values)).assertEqual('[20,40,20]')
expect(obj.$attrs.max).assertEqual(100.000000.toFixed(6))
console.info('cd dataPanelInspectorByKey END');
done();
});
})
}
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/FlexJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -71,6 +71,8 @@ export default function flexJsunit() {
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.NoWrap');
console.log("yr flex0 obj.$attrs.constructor.wrap-'FlexWrap.NoWrap':" + JSON.stringify(obj.$attrs.constructor.wrap));
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
console.log("yr flex0 obj.$attrs.constructor.alignItems-'FlexWrap.NoWrap':" + JSON.stringify(obj.$attrs.constructor.alignItems));
expect(obj.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start');
console.log("yr flex0 obj.$attrs.constructor.justifyContent-'FlexAlign.Center':" + JSON.stringify(obj.$attrs.constructor.justifyContent));
expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.Start");
console.log("yr flex0 obj.$attrs.constructor.alignContent-'FlexAlign.Start':" + JSON.stringify(obj.$attrs.constructor.alignContent));
...
...
@@ -92,6 +94,8 @@ export default function flexJsunit() {
console.log("yr flex1 direction-'FlexDirection.Row':" + JSON.stringify(obj.$attrs.constructor.direction));
expect(obj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap')
console.log("yr flex1 wrap-'FlexWrap.Wrap':" + JSON.stringify(obj.$attrs.constructor.wrap));
expect(obj.$attrs.ItemAlign.Start).assertEqual('ItemAlign.Start')
console.log("yr flex1 alignItems-'ItemAlign.Start':" + JSON.stringify(obj.$attrs.ItemAlign.Start));
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
console.log("yr flex1 justifyContent-'FlexAlign.Start':" + JSON.stringify(obj.$attrs.constructor.justifyContent));
expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.Center");
...
...
@@ -112,6 +116,8 @@ export default function flexJsunit() {
console.info("component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.RowReverse');
console.log("yr flex2 direction-'FlexDirection.RowReverse':" + JSON.stringify(obj.$attrs.constructor.direction));
expect(obj.$attrs.ItemAlign.Start).assertEqual('ItemAlign.Start')
console.log("yr flex1 alignItems-'ItemAlign.Start':" + JSON.stringify(obj.$attrs.ItemAlign.Start));
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
console.log("yr flex2 justifyContent-'FlexAlign.End':" + JSON.stringify(obj.$attrs.constructor.justifyContent));
expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.End");
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ImageJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -65,13 +65,22 @@ export default function imageJsunit() {
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info("component obj is: " + JSON.stringify(obj));
console.log("image1 matchTextDirection" + JSON.stringify(obj.$attrs.matchTextDirection));
console.log("image1 objectFit" + JSON.stringify(obj.$attrs.objectFit));
console.log("image1 fitOriginalSize" + JSON.stringify(obj.$attrs.fitOriginalSize));
console.log("image1 fillColor" + JSON.stringify(obj.$attrs.fillColor));
console.log("image1 autoResize" + JSON.stringify(obj.$attrs.autoResize));
console.log("image1 syncLoad" + JSON.stringify(obj.$attrs.syncLoad));
console.log("image1 objectRepeat" + JSON.stringify(obj.$attrs.objectRepeat));
console.log("image1 interpolation" + JSON.stringify(obj.$attrs.interpolation));
console.log("image1 renderMode" + JSON.stringify(obj.$attrs.renderMode));
console.log("image1 sourceSize" + JSON.stringify(obj.$attrs.sourceSize));
console.log("image1 alt" + JSON.stringify(obj.$attrs.alt));
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover')
expect(obj.$attrs.fitOriginalSize).assertEqual('false')
expect(obj.$attrs.fillColor).assertEqual('0xCCCCCC')
expect(obj.$attrs.autoResize).assertEqual('false')
expect(obj.$attrs.syncLoad).assertEqual('false')
expect(obj.$attrs.objectRepeat).assertEqual('ImageRepeat.NoRepeat')
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.None')
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Original')
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ProgressJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -98,5 +98,53 @@ export default function progressJsunit() {
console.info('testGetProgressAttr2 END');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_0970
* @tc.name testGetProgressAttr030
* @tc.desc aceEtsTest
*/
it('testGetProgressAttr030', 0, async function (done) {
console.info('testGetProgressAttr3 START');
let strJson = getInspectorByKey('progress3');
let obj = JSON.parse(strJson);
console.info("component obj is: " + JSON.stringify(obj));
console.log("progress style" + JSON.stringify(obj.$attrs.style))
expect(obj.$attrs.style).assertEqual("ProgressStyle.Ring")
console.info('testGetProgressAttr3 END');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_0970
* @tc.name testGetProgressAttr040
* @tc.desc aceEtsTest
*/
it('testGetProgressAttr040', 0, async function (done) {
console.info('testGetProgressAttr4 START');
let strJson = getInspectorByKey('progress4');
let obj = JSON.parse(strJson);
console.info("component obj is: " + JSON.stringify(obj));
console.log("progress style" + JSON.stringify(obj.$attrs.style))
expect(obj.$attrs.style).assertEqual("ProgressStyle.ScaleRing")
console.info('testGetProgressAttr4 END');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_0970
* @tc.name testGetProgressAttr050
* @tc.desc aceEtsTest
*/
it('testGetProgressAttr020', 0, async function (done) {
console.info('testGetProgressAttr5 START');
let strJson = getInspectorByKey('progress5');
let obj = JSON.parse(strJson);
console.info("component obj is: " + JSON.stringify(obj));
console.log("progress style" + JSON.stringify(obj.$attrs.style))
expect(obj.$attrs.style).assertEqual("ProgressStyle.Capsule")
console.info('testGetProgressAttr5 END');
done();
});
})
}
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/QrcodeJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -65,6 +65,7 @@ export default function qrcodeJsunit() {
let strJson = getInspectorByKey('qrcode');
let obj = JSON.parse(strJson);
console.info("Qrcode component obj is: " + JSON.stringify(obj));
console.info("qrcode backgroundColor" + JSON.stringify(obj.$attrs.backgroundColor))
console.info("qrcode width" + JSON.stringify(obj.$attrs.width))
console.info("qrcode height" + JSON.stringify(obj.$attrs.height))
console.info("qrcode value" + JSON.stringify(obj.$attrs.value))
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/ScrollJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -88,7 +88,7 @@ export default function ScrollJsunit() {
console.info("cd scroll1 component obj is: " + JSON.stringify(obj));
console.log("cd scroll1 scrollable" + JSON.stringify(obj.$attrs.scrollable));
console.log("cd scroll1 scrollBar" + JSON.stringify(obj.$attrs.scrollBar));
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.
None
')
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.
Horizontal
')
expect(obj.$attrs.scrollBar).assertEqual('BarState.Off')
console.info('cd Scorll1GetInspectorByKey END');
done();
...
...
@@ -105,10 +105,27 @@ export default function ScrollJsunit() {
console.info("cd scroll2 component obj is: " + JSON.stringify(obj));
console.log("cd scroll2 scrollable" + JSON.stringify(obj.$attrs.scrollable));
console.log("cd scroll2 scrollBar" + JSON.stringify(obj.$attrs.scrollBar));
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.
Horizontal
')
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.
None
')
expect(obj.$attrs.scrollBar).assertEqual('BarState.Off')
console.info('cd Scorll2GetInspectorByKey END');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_1050
* @tc.name testScrollGetInspectorByKey040
* @tc.desc aceEtsTest
*/
it('testScrollGetInspectorByKey040', 0, async function (done) {
let strJson = getInspectorByKey('scroll3');
let obj = JSON.parse(strJson);
console.info("cd scroll3 component obj is: " + JSON.stringify(obj));
console.log("cd scroll3 scrollable" + JSON.stringify(obj.$attrs.scrollable));
console.log("cd scroll3 scrollBar" + JSON.stringify(obj.$attrs.scrollBar));
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Free')
expect(obj.$attrs.scrollBar).assertEqual('BarState.Off')
console.info('cd Scorll3GetInspectorByKey END');
done();
});
})
}
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SliderJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -64,19 +64,21 @@ export default function sliderJsunit() {
let strJson = getInspectorByKey('slider1');
let obj = JSON.parse(strJson);
console.info("component obj is Slider: " + JSON.stringify(obj));
console.info("component obj is Slider: " + JSON.stringify(obj.$attrs.constructor));
console.info("slider1 blockColor " + JSON.stringify(obj.$attrs.constructor.blockColor))
console.info("slider1 selectedColor " + JSON.stringify(obj.$attrs.constructor.selectedColor))
console.info("slider1 trackColor " + JSON.stringify(obj.$attrs.constructor.trackColor))
console.info("slider1 showTips " + JSON.stringify(obj.$attrs.constructor.showTips))
console.info("slider1 showSteps " + JSON.stringify(obj.$attrs.constructor.showSteps))
console.info("slider1 value " + JSON.stringify(obj.$attrs.constructor.value))
console.info("slider1 min " + JSON.stringify(obj.$attrs.constructor.min))
console.info("slider1 max " + JSON.stringify(obj.$attrs.constructor.max))
console.info("slider1 step " + JSON.stringify(obj.$attrs.constructor.step))
console.info("slider1 style " + JSON.stringify(obj.$attrs.constructor.style))
console.info("slider1 blockColor" + JSON.stringify(obj.$attrs.constructor.blockColor))
console.info("slider1 selectedColor" + JSON.stringify(obj.$attrs.constructor.selectedColor))
console.info("slider1 trackColor" + JSON.stringify(obj.$attrs.constructor.trackColor))
console.info("slider1 showTips" + JSON.stringify(obj.$attrs.constructor.showTips))
console.info("slider1 showSteps" + JSON.stringify(obj.$attrs.constructor.showSteps))
console.info("slider1 value" + JSON.stringify(obj.$attrs.constructor.value))
console.info("slider1 direction" + JSON.stringify(obj.$attrs.constructor.direction))
console.info("slider1 reverse" + JSON.stringify(obj.$attrs.constructor.reverse))
console.info("slider1 minLabel" + JSON.stringify(obj.$attrs.constructor.minLabel))
console.info("slider1 maxLabel" + JSON.stringify(obj.$attrs.constructor.maxLabel))
console.info("slider1 min" + JSON.stringify(obj.$attrs.constructor.min))
console.info("slider1 max" + JSON.stringify(obj.$attrs.constructor.max))
console.info("slider1 step" + JSON.stringify(obj.$attrs.constructor.step))
console.info("slider1 style" + JSON.stringify(obj.$attrs.constructor.style))
expect(obj.$attrs.constructor.blockColor).assertEqual('#FFFF0000')
expect(obj.$attrs.constructor.selectedColor).assertEqual('#FF0000FF')
expect(obj.$attrs.constructor.trackColor).assertEqual('#FF808080')
...
...
@@ -101,9 +103,9 @@ export default function sliderJsunit() {
let strJson = getInspectorByKey('slider2');
let obj = JSON.parse(strJson);
console.info("component obj is Slider: " + JSON.stringify(obj));
console.info("slider2 showTips
" + JSON.stringify(obj.$attrs.constructor.showTips))
console.info("slider2 showSteps
" + JSON.stringify(obj.$attrs.constructor.showSteps))
console.info("slider1 style
" + JSON.stringify(obj.$attrs.constructor.style))
console.info("slider2 showTips" + JSON.stringify(obj.$attrs.constructor.showTips))
console.info("slider2 showSteps" + JSON.stringify(obj.$attrs.constructor.showSteps))
console.info("slider1 style" + JSON.stringify(obj.$attrs.constructor.style))
expect(obj.$attrs.constructor.showTips).assertEqual("true")
expect(obj.$attrs.constructor.showSteps).assertEqual("true")
expect(obj.$attrs.constructor.style).assertEqual("SliderStyle.Inset")
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/SpanJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -64,12 +64,17 @@ export default function spanJsunit() {
let strJson = getInspectorByKey('span1');
let obj = JSON.parse(strJson);
console.info("component obj is: " + JSON.stringify(obj));
console.info("span1 decoration" + JSON.stringify(obj.$attrs.decoration))
console.info("span1 textCase" + JSON.stringify(obj.$attrs.textCase))
console.info("span1 content" + JSON.stringify(obj.$attrs.content))
console.info("span1 fontSize" + JSON.stringify(obj.$attrs.fontSize))
console.info("span1 letterSpacing" + JSON.stringify(obj.$attrs.letterSpacing))
expect(obj.$attrs.decoration).assertEqual('{"Type":"TextDecorationType.LineThrough","Color":"#FFFF0000"}')
expect(obj.$attrs.textCase).assertEqual('TextCase.UpperCase')
expect(obj.$attrs.content).assertEqual('Test Span demo')
expect(obj.$attrs.fontSize).assertEqual('20fp')
expect(obj.$attrs.letterSpacing).assertEqual(5)
console.info('testGetSpanAttr1 END');
done();
});
...
...
ace/ace_ets_standard/entry/src/main/ets/MainAbility/test/TextJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -95,6 +95,9 @@ export default function textJsunit() {
console.log("cd text fontColor" + JSON.stringify(obj.$attrs.fontColor));
console.log("cd text visibility" + JSON.stringify(obj.$attrs.visibility));
console.log("cd text fontSize" + JSON.stringify(obj.$attrs.fontSize));
console.log("cd text minFontSize" + JSON.stringify(obj.$attrs.minFontSize));
console.log("cd text letterSpacing" + JSON.stringify(obj.$attrs.letterSpacing));
console.log("cd text maxFontSize" + JSON.stringify(obj.$attrs.maxFontSize));
console.log("cd text fontWeight" + JSON.stringify(obj.$attrs.fontWeight));
console.log("cd text fontStyle" + JSON.stringify(obj.$attrs.fontStyle));
console.log("cd text fontFamily" + JSON.stringify(obj.$attrs.fontFamily));
...
...
@@ -135,7 +138,10 @@ export default function textJsunit() {
expect(obj.$attrs.zIndex).assertEqual(1)
expect(obj.$attrs.fontColor).assertEqual("#FF000000")
expect(obj.$attrs.visibility).assertEqual("Visibility.Visible")
expect(obj.$attrs.fontSize).assertEqual("15.000000fp")
expect(obj.$attrs.fontSize).assertEqual("15.000000px")
expect(obj.$attrs.minFontSize).assertEqual("15")
expect(obj.$attrs.letterSpacing).assertEqual("15")
expect(obj.$attrs.maxFontSize).assertEqual("15")
expect(obj.$attrs.fontWeight).assertEqual("FontWeight.Bold")
expect(obj.$attrs.fontStyle).assertEqual("FontStyle.Italic")
expect(obj.$attrs.fontFamily).assertEqual("sans-serif")
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlertDialog.ets
浏览文件 @
07e21563
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -12,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct alertdialog {
...
...
@@ -31,14 +32,20 @@ struct alertdialog {
AlertDialog.show({
title: 'Title',
message: 'This is message',
autoCancel: true,
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
alignment: 'DialogAlignment.Top',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
...
...
@@ -49,6 +56,281 @@ struct alertdialog {
})
.key('alertDialog')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.Center',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog1')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.Bottom',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog2')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.Default',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog3')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.TopStart',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog4')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.TopEnd',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog5')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.CenterStart',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog6')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.CenterEnd',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'secondaryButton'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog7')
})
Button('Show Dialog With Two Buttons')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
alignment: 'DialogAlignment.BottomStart',
primaryButton: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'primaryButton'
}
},
secondaryButton: {
value: 'cancle',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'BottomStart'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog8')
})
Button('Show Dialog With Confirm')
.width(300)
.margin(10)
.backgroundColor(Color.Blue)
.onClick(() => {
AlertDialog.show({
title: 'Title',
message: 'This is message',
gridCount: '1',
alignment: 'DialogAlignment.BottomEnd',
confirm: {
value: '11111111111',
fontColor: '#FFFF0000',
backgroundColor: '#FFFFC0CB',
action: () => {
this.currentTest = 'confirm'
}
},
cancel: () => {
this.currentTest = 'cancel'
}
})
.key('alertDialog9')
})
}
.width('100%')
.height('100%')
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/AlphabetIndexer.ets
浏览文件 @
07e21563
...
...
@@ -36,6 +36,7 @@ struct alphabetIndexer {
.fontWeight(FontWeight.Bold)
Text("AlphabetIndexer0")
AlphabetIndexer({ arrayValue: this.value, selected: 0 })
.color('#FF00DDDD')
.selectedColor(0xffffff)
.key('alphabetIndexer')
.popupColor('#FF737373')
...
...
@@ -46,6 +47,9 @@ struct alphabetIndexer {
.popupFont({ size: 30, weight: FontWeight.Bolder, style: FontStyle.Normal })
.itemSize(28)
.alignStyle(IndexerAlign.Left)
.onSelected((index: number) => {
console.info(this.value[index] + ' on selected')
})
Text("AlphabetIndexer1")
AlphabetIndexer({ arrayValue: this.value1, selected: 0 })
.selectedColor(0xffffff)
...
...
@@ -59,6 +63,9 @@ struct alphabetIndexer {
.itemSize(28)
.alignStyle(IndexerAlign.Right)
.margin({ left: 50 })
.onSelected((index: number) => {
console.info(this.value[index] + ' on selected')
})
}
}
}
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Calendar.ets
浏览文件 @
07e21563
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct calendar {
...
...
@@ -47,31 +47,49 @@ struct calendar {
preData: this.preMonth,
nextData: this.nextMonth,
controller: this.Controller
})
.showLunar(true)
.showHoliday(true)
.needSlide(true)
.offDays(Week.Tue | Week.Wed)
.startOfWeek(Week.Sun)
.direction(Axis.Horizontal)
.currentDayStyle({
dayColor: Color.Black,
lunarColor: Color.Gray,
markLunarColor: Color.Black,
dayFontSize: 15,
lunarDayFontSize: 10,
boundaryColOffset: 10
boundaryColOffset: 10,
})
.nonCurrentDayStyle({
nonCurrentMonthDayColor: Color.Black,
nonCurrentMonthLunarColor: Color.Gray
nonCurrentMonthLunarColor: Color.Gray,
nonCurrentMonthWorkDayMarkColor: Color.Green,
nonCurrentMonthOffDayMarkColor: Color.Brown,
})
.todayStyle({
focusedDayColor: Color.Red,
focusedLunarColor: Color.Orange,
focusedAreaBackgroundColor: Color.Blue,
focusedAreaRadius: 20
})
.weekStyle({
weekColor: Color.Black,
weekendDayColor: Color.Orange,
weekendLunarColor: Color.Blue,
weekFontSize: 20,
weekHeight: 5,
weekWidth: 48,
})
.workStateStyle({
workDayMarkColor: Color.Red,
offDayMarkColor: Color.Orange,
workDayMarkSize: 10,
offDayMarkSize: 2,
workStateWidth: 12,
workStateHorizontalMovingDistance: 0,
workStateVerticalMovingDistance: 12,
})
.onRequestData((request) => {
switch (request.monthState) {
...
...
@@ -88,9 +106,9 @@ struct calendar {
lunarDay: this.lunarMonthDays[i % 30],
dayMark: "work",
dayMarkValue: "",
year: request.year
;
month: request.month
;
day: i + 1
;
year: request.year
,
month: request.month
,
day: i + 1
,
isFirstOfLunar: false,
hasSchedule: false,
markLunarDay: false
...
...
@@ -153,9 +171,22 @@ struct calendar {
break;
}
})
.onSelectChange((request) => {
this.year = request.year;
this.month = request.month;
console.info('On Select change: ' + this.year + '/' + this.month)
})
Row() {
Button("back To Today").onClick(() => {
this.Controller.backToToday();
console.info("back To Today")
});
Button("go To").onClick(() => {
this.Controller.goTo({ year: 2021, month: 9, day: 10 });
console.info("go To : 2021/9/10")
});
}
}.margin({ bottom: 10, right: 20, left: 20, top: 0 })
.height("50%")
}
}
\ No newline at end of file
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/CustomDialog.ets
浏览文件 @
07e21563
...
...
@@ -27,44 +27,56 @@ struct CustomDialogExample {
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('cancel')
.onClick(() => {
this.controller.close()
this.cancel()
}).backgroundColor(0xffffff).fontColor(Color.Black)
this.controller.close()
this.cancel()
}).backgroundColor(0xffffff).fontColor(Color.Black)
Button('confirm')
.onClick(() => {
this.controller.close()
this.confirm()
}).backgroundColor(0xffffff).fontColor(Color.Red)
this.controller.close()
this.confirm()
}).backgroundColor(0xffffff).fontColor(Color.Red)
}.margin({ bottom: 10 })
}
}
}
let Offset = { dx: 5, dy: 5 }
@Entry
@Component
struct CustomDialogUser {
dialogController: CustomDialogController = new CustomDialogController({
builder: CustomDialogExample({ cancel: this.onCancel, confirm: this.onAccept }),
cancel: this.existApp,
autoCancel: true
autoCancel: true,
offset: Offset,
alignment: DialogAlignment.Center,
customStyle: false,
gridCount: 5
})
onCancel() {
console.info('Callback when the first button is clicked')
}
onAccept() {
console.info('Callback when the second button is clicked')
}
existApp() {
console.info('Click the callback in the blank area')
}
build() {
Column() {
Row() {
Button('click me')
.onClick(() => {
this.dialogController.open()
}).backgroundColor(0x317aff)
Button('click me')
.onClick(() => {
this.dialogController.open
()
}).backgroundColor(0x317aff)
this.dialogController.close
()
}).backgroundColor(0x317aff)
}.width('100%').margin({ top: 5 })
}
}
\ No newline at end of file
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/List.ets
浏览文件 @
07e21563
// @ts-nocheck
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
@@ -12,18 +13,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
let ItemDragInfo: {
x: 5,
y: 5
}
@Entry
@Component
struct ListExample {
private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
private arr1: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
private arr2: number[] = ['a', 'b', 'c', 'd', 'e', 'f']
@State editFlag: boolean = false
@State bool1: boolean = false
@State bool2: boolean = false
build() {
Stack({ alignContent: Alignment.TopStart }) {
Column() {
List({ space: 20, initialIndex: 0 }) {
ForEach(this.arr, (item) => {
ForEach(this.arr
1
, (item) => {
ListItem() {
Text('' + item)
.width('100%')
...
...
@@ -44,14 +52,63 @@ struct ListExample {
console.info('first' + firstIndex)
console.info('last' + lastIndex)
})
.onScroll((scrollOffset: number, scrollState: ScrollState) => {
console.info('scrollOffset:' + scrollOffset)
console.info('ScrollState:' + scrollState)
})
.editMode(this.editFlag)
.onItemDelete((index: number) => {
console.info(this.arr[index] + 'Delete')
this.arr.splice(index, 1)
console.info(JSON.stringify(this.arr))
console.info(this.arr
1
[index] + 'Delete')
this.arr
1
.splice(index, 1)
console.info(JSON.stringify(this.arr
1
))
this.editFlag = false
return true
})
.onReachStart(() => {
console.info("On Reach Start")
})
.onReachEnd(() => {
console.info("On Reach End")
})
.onScrollStop(() => {
console.info("On Scroll Stop")
})
.onItemMove((from: number, to: number) => {
console.info(from + 'from')
console.info(to + 'to')
return true
})
.onItemDragStart((event: ItemDragInfo, itemIndex: number) => {
this.bool1 = true
this.text = this.arr1[itemIndex]
console.log('onItemDragStart, itemIndex:' + itemIndex);
return this.pixelMapBuilder;
})
.onItemDragEnter((event: ItemDragInfo) => {
console.log('onItemDragEnter');
})
.onItemDragMove((event: ItemDragInfo, itemIndex: number, insertIndex: number) => {
console.log('onItemDragMove,itemIndex:' + itemIndex + 'insertIndex:' + insertIndex)
})
.onItemDragLeave((event: ItemDragInfo, itemIndex: number) => {
console.log('onItemDragLeave, itemIndex:' + itemIndex);
})
.onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => {
console.log('ItemDragInfo, itemIndex:' + itemIndex + 'insertIndex:' + insertIndex + 'isSuccess:' + isSuccess);
if (isSuccess) {
if (this.bool2) {
this.arr2.splice(itemIndex, 1)
this.arr1.splice(insertIndex, 0, this.text)
this.bool1 = false
this.bool2 = false
} else if (this.bool1) {
this.arr2.splice(itemIndex, 1)
this.arr1.splice(insertIndex, 0, this.text)
this.bool1 = false
this.bool2 = false
}
}
})
.width('90%')
}.width('100%')
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/ListItem.ets
浏览文件 @
07e21563
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct listItem_testcase {
...
...
@@ -25,22 +25,40 @@ struct listItem_testcase {
Column() {
List() {
ListItem() {
Text('sticky:No
rmal
, item1111')
Text('sticky:No
ne
, item1111')
.width('100%')
.height(40)
.fontSize(12)
}.sticky(Sticky.No
rmal
)
}.sticky(Sticky.No
ne
)
.editable(true)
.key('listitem')
ListItem() {
Text('sticky:Normal , item2222')
.width('100%')
.height(40)
.fontSize(12)
}.sticky(Sticky.Normal)
.editable(EditMode.Deletable)
.key('listitem2')
ListItem() {
Text('sticky:Opacity , item3333')
.width('100%')
.height(40)
.fontSize(12)
}.sticky(Sticky.Opacity)
.editable(
tru
e)
.editable(
EditMode.Non
e)
.key('listitem3')
ListItem() {
Text('sticky:Opacity , item4444')
.width('100%')
.height(40)
.fontSize(12)
}.sticky(Sticky.Opacity)
.editable(EditMode.Movable)
.key('listitem4')
}
}.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
}.width(300)
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Swiper.ets
浏览文件 @
07e21563
...
...
@@ -72,6 +72,7 @@ struct SwiperExample {
.loop(false)
.duration(1000)
.vertical(false)
.disableSwipe(true)
.itemSpace(0)
.onChange((index: number) => {
console.info(index.toString())
...
...
@@ -86,6 +87,10 @@ struct SwiperExample {
.onClick(() => {
this.swiperController.showPrevious()
})
Button('finishAnimation')
.onClick(() => {
this.swiperController.finishAnimation()
})
}
}.margin({ top: 5 })
}
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Tab.ets
浏览文件 @
07e21563
...
...
@@ -20,6 +20,12 @@ struct TabsExample {
build() {
Column() {
Button('changeIndex')
.onClick(() => {
this.controller.changeIndex(0)
console.log('change Index ')
})
Tabs({ barPosition: BarPosition.Start, index: 1, controller: this.controller }) {
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Pink)
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/pages/Video.ets
浏览文件 @
07e21563
...
...
@@ -40,6 +40,31 @@ struct VideoCreateComponent {
.loop(true)
.objectFit(ImageFit.Cover)
.key('video')
.onStart(() => {
console.info("onStart");
})
.onPause(() => {
console.info("onPause");
})
.onFinish(() => {
console.info("onFinish");
})
.onPrepared(() => {
console.info("onPrepared");
})
.onSeeking(() => {
console.info("onSeeking");
})
.onSeeked(() => {
console.info("onSeeked");
})
.onUpdate(() => {
console.info("onUpdate");
})
.onError(() => {
console.info("onError");
})
Row() {
Button("start").onClick(() => {
this.myVideoController.start();
...
...
@@ -53,6 +78,18 @@ struct VideoCreateComponent {
Button("setCurrentTime").onClick(() => {
this.myVideoController.setCurrentTime(9);
});
Button("setCurrentTime").onClick(() => {
this.myVideoController.setCurrentTime(9, SeekMode.PreviousSync);
});
Button("setCurrentTime").onClick(() => {
this.myVideoController.setCurrentTime(9, SeekMode.NextSync);
});
Button("setCurrentTime").onClick(() => {
this.myVideoController.setCurrentTime(9, SeekMode.Closest);
});
Button("setCurrentTime").onClick(() => {
this.myVideoController.setCurrentTime(9, SeekMode.ClosestSync);
});
}
}
}
...
...
ace/ace_ets_test/entry/src/main/ets/MainAbility/test/ListItemJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -70,7 +70,7 @@ export default function listItemJsunit() {
console.log(JSON.stringify(obj.$attrs.type))
console.log('ListItem1‘s sticky is ' + JSON.stringify(obj.$attrs.sticky))
console.log('ListItem1‘s editable is ' + JSON.stringify(obj.$attrs.editable))
expect(obj.$attrs.sticky).assertEqual('Sticky.No
rmal
')
expect(obj.$attrs.sticky).assertEqual('Sticky.No
ne
')
expect(obj.$attrs.editable).assertEqual('true')
console.info('++++++++++++++++ ListItem TestCase 1 End ++++++++++++++++');
done();
...
...
@@ -83,7 +83,7 @@ export default function listItemJsunit() {
*/
it('listItemTest002', 0, async function (done) {
console.info('++++++++++++++++ ListItem TestCase 2 START ++++++++++++++++');
let strJson = getInspectorByKey('listitem
3
');
let strJson = getInspectorByKey('listitem
2
');
let obj = JSON.parse(strJson);
console.info("get inspector value is: " + JSON.stringify(obj));
console.log(JSON.stringify(obj.$type))
...
...
@@ -92,10 +92,54 @@ export default function listItemJsunit() {
console.log('ListItem2‘s sticky is ' + JSON.stringify(obj.$attrs.sticky))
console.log('ListItem2‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attrs.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attrs.editable).assertEqual('true')
expect(obj.$attr.sticky).assertEqual('Sticky.Normal')
expect(obj.$attr.editable).assertEqual('EditMode.Deletable')
console.info('++++++++++++++++ ListItem TestCase 2 End ++++++++++++++++');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_0410
* @tc.name listItemTest003
* @tc.desc aceEtsTest
*/
it('listItemTest003', 0, async function (done) {
console.info('++++++++++++++++ ListItem TestCase 3 START ++++++++++++++++');
let strJson = getInspectorByKey('listitem3');
let obj = JSON.parse(strJson);
console.info("get inspector value is: " + JSON.stringify(obj));
console.log(JSON.stringify(obj.$type))
expect(obj.$type).assertEqual('ListItem')
console.log(JSON.stringify(obj.$attrs.type))
console.log('ListItem3‘s sticky is ' + JSON.stringify(obj.$attrs.sticky))
console.log('ListItem3‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attr.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attr.editable).assertEqual('EditMode.None')
console.info('++++++++++++++++ ListItem TestCase 3 End ++++++++++++++++');
done();
});
/**
* @tc.number SUB_ACE_BASIC_ETS_API_0420
* @tc.name listItemTest004
* @tc.desc aceEtsTest
*/
it('listItemTest004', 0, async function (done) {
console.info('++++++++++++++++ ListItem TestCase 4 START ++++++++++++++++');
let strJson = getInspectorByKey('listitem4');
let obj = JSON.parse(strJson);
console.info("get inspector value is: " + JSON.stringify(obj));
console.log(JSON.stringify(obj.$type))
expect(obj.$type).assertEqual('ListItem')
console.log(JSON.stringify(obj.$attrs.type))
console.log('ListItem4‘s sticky is ' + JSON.stringify(obj.$attrs.sticky))
console.log('ListItem4‘s editable is ' + JSON.stringify(obj.$attrs.editable))
await sleep(1)
expect(obj.$attr.sticky).assertEqual('Sticky.Opacity')
expect(obj.$attr.editable).assertEqual('EditMode.Movable')
console.info('++++++++++++++++ ListItem TestCase 4 End ++++++++++++++++');
done();
});
})
}
ace/ace_ets_test/entry/src/main/ets/MainAbility/test/SwiperJsunit.test.ets
浏览文件 @
07e21563
...
...
@@ -100,6 +100,7 @@ export default function swiperJsunit() {
console
.
log
(
'Swiper‘s duration is '
+
JSON
.
stringify
(
obj
.
$attrs
.
duration
))
console
.
log
(
'Swiper‘s vertical is '
+
JSON
.
stringify
(
obj
.
$attrs
.
vertical
))
console
.
log
(
'Swiper‘s itemSpace is '
+
JSON
.
stringify
(
obj
.
$attrs
.
itemSpace
))
console
.
log
(
'Swiper‘s disableSwipe is '
+
JSON
.
stringify
(
obj
.
$attrs
.
disableSwipe
))
expect
(
obj
.
$attrs
.
index
)
.
assertEqual
(
'1'
)
expect
(
obj
.
$attrs
.
autoPlay
)
.
assertEqual
(
'true'
)
expect
(
obj
.
$attrs
.
interval
)
.
assertEqual
(
'4000'
)
...
...
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Navigation.ets
浏览文件 @
07e21563
...
...
@@ -69,6 +69,9 @@ struct NavigationExample {
{ value: 'add' },
{ value: 'collect' }
] })
.onTitleModeChanged((titleModel: NavigationTitleMode) => {
console.log('titleMode:' + titleModel)
})
Navigation() {
Search({ value: '', placeholder: '' }).width('90%').margin(0)
...
...
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/Stepper.ets
浏览文件 @
07e21563
...
...
@@ -61,6 +61,12 @@ struct StepperExample {
.onChange((prevIndex: number, index: number) => {
this.currentIndex = index
})
.onNext((index: number, pendingIndex: number) => {
console.info('pendingIndex:' + pendingIndex)
})
.onPrevious((index: number, pendingIndex: number) => {
console.info('pendingIndex:' + pendingIndex)
})
.align(Alignment.Center)
}
}
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextArea.ets
浏览文件 @
07e21563
...
...
@@ -46,6 +46,8 @@ struct TextAreaExample {
.onChange((value: string) => {
this.text1 = value
})
.onCopy((value: string) => {
})
.key('textArea1')
Text(this.text2).width('90%').height(60).fontSize(40)
...
...
ace/ace_ets_third_test/entry/src/main/ets/MainAbility/pages/TextInput.ets
浏览文件 @
07e21563
...
...
@@ -46,6 +46,15 @@ struct TextInputExample {
.onChange((value: string) => {
this.textNew = value
})
.onSubmit((enterKey) => {
this.textNew = 'onSubmit'
})
.onEditChanged((isEditing) => {
this.textNew = 'onEditChanged'
})
.onCopy((value: string) => {
})
.key('textInput1')
TextInput({ placeholder: 'textInput 2', text: this.text })
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录