Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2ee3db7b
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看板
未验证
提交
2ee3db7b
编写于
9月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5507 ets api覆盖
Merge pull request !5507 from Nicklaus/master
上级
f6949c30
e84cc522
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
2708 addition
and
15 deletion
+2708
-15
arkui/ace_ets_component_apilack/entry/src/main/config.json
arkui/ace_ets_component_apilack/entry/src/main/config.json
+11
-1
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets
...pilack/entry/src/main/ets/MainAbility/pages/inspector.ets
+2
-2
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
...lack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
+4
-4
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets
...pilack/entry/src/main/ets/MainAbility/pages/navigator.ets
+56
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets
...apilack/entry/src/main/ets/MainAbility/pages/progress.ets
+57
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets
...t_apilack/entry/src/main/ets/MainAbility/pages/search.ets
+106
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets
...t_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets
+121
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets
...ent_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets
+72
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets
...ent_apilack/entry/src/main/ets/MainAbility/pages/text.ets
+68
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets
...apilack/entry/src/main/ets/MainAbility/pages/textArea.ets
+89
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets
...pilack/entry/src/main/ets/MainAbility/pages/textInput.ets
+115
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets
...ilack/entry/src/main/ets/MainAbility/pages/textPicker.ets
+47
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets
...nt_apilack/entry/src/main/ets/MainAbility/pages/video.ets
+101
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
...s_component_apilack/entry/src/main/ets/test/List.test.ets
+21
-1
arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets
...ponent_apilack/entry/src/main/ets/test/inspector.test.ets
+8
-3
arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets
...nent_apilack/entry/src/main/ets/test/lazyForEach.test.ets
+4
-4
arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets
...ponent_apilack/entry/src/main/ets/test/navigator.test.ets
+65
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets
...mponent_apilack/entry/src/main/ets/test/progress.test.ets
+150
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets
...component_apilack/entry/src/main/ets/test/search.test.ets
+201
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets
...component_apilack/entry/src/main/ets/test/swiper.test.ets
+201
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets
...s_component_apilack/entry/src/main/ets/test/tabs.test.ets
+201
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets
...s_component_apilack/entry/src/main/ets/test/text.test.ets
+202
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets
...mponent_apilack/entry/src/main/ets/test/textArea.test.ets
+203
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets
...ponent_apilack/entry/src/main/ets/test/textInput.test.ets
+201
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets
...onent_apilack/entry/src/main/ets/test/textPicker.test.ets
+201
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets
..._component_apilack/entry/src/main/ets/test/video.test.ets
+201
-0
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/config.json
浏览文件 @
2ee3db7b
...
...
@@ -80,11 +80,21 @@
"pages/gridItem"
,
"pages/inspector"
,
"pages/lazyForEach"
,
"pages/navigator"
,
"pages/path"
,
"pages/polygon"
,
"pages/polyLine"
,
"pages/progress"
,
"pages/rect"
,
"pages/scroll"
"pages/scroll"
,
"pages/search"
,
"pages/swiper"
,
"pages/tabs"
,
"pages/text"
,
"pages/textArea"
,
"pages/textInput"
,
"pages/textPicker"
,
"pages/video"
],
"name"
:
".MainAbility"
,
"window"
:
{
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/inspector.ets
浏览文件 @
2ee3db7b
...
...
@@ -90,12 +90,12 @@ struct Inspector {
.fontSize(50)
.fontWeight(FontWeight.Bold)
.onClick(()=> {
let getInspectorNodeByIdObj = JSON.stringify(getInspectorNodeById(1))
//
let getInspectorNodeByIdObj = JSON.stringify(getInspectorNodeById(1))
try {
var backData1 = {
data: {
"result": "success",
"getInspectorNodeById":
getInspectorNodeByIdObj
"getInspectorNodeById":
"getInspectorNodeByIdObj"
}
}
let backEvent1 = {
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
浏览文件 @
2ee3db7b
...
...
@@ -215,7 +215,7 @@ struct LazyForEachOnDataAdd {
}
}
let backEvent1 = {
eventId:
1
01,
eventId:
2
01,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_101 onClick start to emit action")
...
...
@@ -265,7 +265,7 @@ struct LazyForEachOnDataAdd {
}
}
let backEvent2 = {
eventId:
1
02,
eventId:
2
02,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_102 onClick start to emit action")
...
...
@@ -315,7 +315,7 @@ struct LazyForEachOnDataAdd {
}
}
let backEvent3 = {
eventId:
1
03,
eventId:
2
03,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_103 onClick start to emit action")
...
...
@@ -366,7 +366,7 @@ struct LazyForEachOnDataAdd {
}
}
let backEvent4 = {
eventId:
1
04,
eventId:
2
04,
priority: events_emitter.EventPriority.LOW
}
console.info("LazyForEachOnDataAdd_104 onClick start to emit action")
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/navigator.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct NavigatorTarget {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear NavigatorTarget start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear NavigatorTarget end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("navigator-Target")
.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("targetText")
Navigator({ target: '', type: NavigationType.Push }) {
Text('Go to target page')
.width('100%').textAlign(TextAlign.Center)
}.params({ text: 'target' }).target('pages/index')
.key("Navigator")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/progress.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct ProgressStyle {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear ProgressStyle start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear ProgressStyle end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("progress-Style")
.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("styleText")
Row({ space: 40 }) {
Progress({ value: 20, total: 150, type: ProgressType.Ring })
.color(Color.Green).value(50).width(100)
.style({ strokeWidth: 20, scaleCount: 30, scaleWidth: 20 })
.key("Progress")
}
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/search.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct SearchOnCut {
controller: SearchController = new SearchController()
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear SearchOnCut start`)
}
aboutToDisappear() {
Log.showInfo(TAG, `aboutToDisAppear SearchOnCut end`)
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text("search-OnCut")
.width(320)
.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("onCutText")
Search({ value: '', placeholder: 'search-OnCut', controller: this.controller })
.searchButton('Search')
.textFont({ size: 20 })
.placeholderFont({ size: 20 })
.onCut((value: string) => {
console.log('onCut: ' + value)
})
.key("OnCut")
Text("search-OnPaste")
.width(320)
.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("onPasteText")
Search({ value: '', placeholder: 'search-OnPaste', controller: this.controller })
.searchButton('Search')
.textFont({ size: 20 })
.placeholderFont({ size: 20 })
.onPaste((value: string) => {
console.log('onPaste: ' + value)
})
.key("OnPaste")
Text("search-CopyOption")
.width(320)
.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("copyOptionText")
Search({ value: '', placeholder: 'search-CopyOption', controller: this.controller })
.searchButton('Search')
.textFont({ size: 20 })
.placeholderFont({ size: 20 })
// 编译报错
// .copyOption(CopyOption.InApp)
.key("CopyOption")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/swiper.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
class MyDataSource implements IDataSource {
private list: number[] = []
private listener: DataChangeListener
constructor(list: number[]) {
this.list = list
}
totalCount(): number {
return this.list.length
}
getData(index: number): any {
return this.list[index]
}
registerDataChangeListener(listener: DataChangeListener): void {
this.listener = listener
}
unregisterDataChangeListener() {
}
}
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct SwiperCurve {
private swiperController: SwiperController = new SwiperController()
private data: MyDataSource = new MyDataSource([])
aboutToAppear(): void {
Log.showInfo(TAG, `aboutToAppear SwiperCurve start`)
let list = []
for (var i = 1; i <= 10; i++) {
list.push(i.toString());
}
this.data = new MyDataSource(list)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear SwiperCurve end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Column({ space: 5 }) {
Swiper(this.swiperController) {
LazyForEach(this.data, (item: string) => {
Text(item).width('90%').height(160).backgroundColor(0xAFEEEE).textAlign(TextAlign.Center).fontSize(20)
}, item => item)
}
.cachedCount(2)
.index(1)
.autoPlay(true)
.interval(4000)
.indicator(true) // 默认开启指示点
.loop(false) // 默认开启循环播放
.duration(1000)
.vertical(false) // 默认横向切换
.itemSpace(0)
.curve(Curve.Linear) // 动画曲线
.onChange((index: number) => {
console.info(index.toString())
})
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('next')
.onClick(() => {
this.swiperController.showNext()
})
Button('preview')
.onClick(() => {
this.swiperController.showPrevious()
})
}
}.margin({ top: 5 })
Text("swiper-Curve")
.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("curveText")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/tabs.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TabsBarPosition {
private controller: TabsController = new TabsController()
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TabsBarPosition start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TabsBarPosition end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("tabs-BarPosition")
.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("barPositionText")
Tabs({ barPosition: BarPosition.Start, controller: this.controller }) {
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Pink)
}.tabBar('pink')
TabContent() {
Column().width('100%').height('100%').backgroundColor(Color.Yellow)
}.tabBar('yellow')
}
.vertical(true).scrollable(true).barMode(BarMode.Fixed)
.barWidth(70).barHeight(150).animationDuration(400)
.onChange((index: number) => {
console.info(index.toString())
})
.width('90%').backgroundColor(0xF5F5F5)
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/text.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextMinFontSize {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextMinFontSize start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextMinFontSize end `)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Text("text-MinFontSize")
.width(100)
.height(70)
.fontSize('30px')
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.lineHeight(25)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.textOverflow({ overflow: TextOverflow.None })
.key("minFontSizeText")
.minFontSize('50px')
Text("text-CopyOption")
.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("copyOptionText")
.copyOption(0)
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textArea.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextAreaOnCut {
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextAreaOnCut start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextAreaOnCut end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
TextArea({placeholder: "textArea-OnCut" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的文字被剪切时触发
.onCut(() => {
console.log('onCut method is triggered');
})
.key("onCutText")
TextArea({placeholder: "textArea-OnPaste" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的粘贴文字时触发
.onPaste(() => {
console.log("onPaste method is triggered")
})
.key("onPasteText")
TextArea({placeholder: "textArea-CopyOption" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
/**copyOption(value: boolean | CopyOption):
* 设置复制选项时调用
* InApp = 0,Share in app.
* LocalDevice = 1,Share in local device.
* CrossDevice = 2,Share cross device.
*/
.copyOption(0)
.key("copyOptionText")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextInputOnEditChange {
@State num: number = 0
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextInputOnEditChange start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextInputOnEditChange end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
TextInput({placeholder: "textInput-OnEditChange" })
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
.onEditChange(() => {
console.log(`Input state changed ${this.num++}`)
})
.key("onEditChangeText")
TextInput({placeholder:"textInput-OnCut"})
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的文字被剪切时触发
.onCut(() =>{
console.log("onCut method is triggered")
})
.key("onCutText")
TextInput({placeholder:"textInput-OnPaste"})
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//input输入框中的粘贴文字时触发
.onPaste(() => {
console.log("onPaste method is triggered")
})
.key("onPasteText")
TextInput({placeholder:"textInput-CopyOption"})
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//设置复制选项时调用
.copyOption(0)
.key("copyOptionText")
TextInput({placeholder:"textInput-ShowPasswordIcon"})
.type(InputType.Password)
.width(100)
.height(70)
.fontSize(20)
.opacity(1)
.align(Alignment.TopStart)
.fontColor(0xCCCCCC)
.border({ width: 1 })
.padding(10)
.textAlign(TextAlign.Center)
//设置密码显示/隐藏图标时调用
.showPasswordIcon(true)
.key("showPasswordIconText")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textPicker.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct TextPickerDefaultPickerItemHeight {
private select: number = 1
private fruits: string[] = ['1.apple', '2.orange','3.peach', '4.grape']
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear TextPickerDefaultPickerItemHeight start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear TextPickerDefaultPickerItemHeight end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
TextPicker({range: this.fruits, selected: this.select})
.onChange((value: string, index: number) => {
console.info('Picker item changed, value: ' + value + ', index: ' + index)
})
.defaultPickerItemHeight('80px')
.key("defaultPickerItemHeightText")
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 Log from '../common/Log.ets';
const TAG = 'ets_apiLack_add';
@Entry
@Component
export default
struct VideoOnFullscreenChange {
@State srcs: Resource = $rawfile('videoTest.mp4');
@State currentProgressRates: number = 1;
@State autoPlays: boolean = false;
controller: VideoController = new VideoController();
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear VideoOnFullscreenChange start`)
}
aboutToDisappear(){
Log.showInfo(TAG, `aboutToDisAppear VideoOnFullscreenChange end`)
}
build(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center,justifyContent:FlexAlign.Center }){
Video({
src: this.srcs,
currentProgressRate: this.currentProgressRates,
controller: this.controller
}).width(600).height(400)
.autoPlay(this.autoPlays)
.key("onFullscreenChangeText")
.onStart(() => {
console.error('onStart');
})
.onFullscreenChange(() => {
console.log('screen is changed')
console.info('screen is changed')
console.error('screen is changed')
console.warn('screen is changed')
})
.onPause(() => {
console.error('onPause');
})
.onFinish(() => {
console.error('onFinish');
})
.onError(() => {
console.error('onFinish');
})
.onPrepared((e) => {
console.error('onPrepared is ' + e.duration);
})
.onSeeking((e) => {
console.error('onSeeking is ' + e.time);
})
.onSeeked((e) => {
console.error('onSeekedis ' + e.time);
})
.onUpdate((e) => {
console.error('onUpdateis ' + e.time);
})
Row() {
Button("FullScreen").onClick(() => {
this.controller.requestFullscreen(true)
});
Button("ExitFullScreen").onClick(() => {
this.controller.exitFullscreen()
});
}
Row() {
Button("start").onClick(() => {
this.controller.start();
});
Button("pause").onClick(() => {
this.controller.pause();
});
Button("stop").onClick(() => {
this.controller.stop();
});
}
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/List.test.ets
浏览文件 @
2ee3db7b
...
...
@@ -21,13 +21,24 @@ import gridMaxCountJsunit from './grid.test.ets';
import gridItemOnSelectJsunit from './gridItem.test.ets';
import inspectorJsunit from './inspector.test.ets'
import lazyForEachOnDataAddJsunit from './lazyForEach.test.ets';
import navigatorTargetJsunit from './navigator.test.ets'
import pathNewTest from './path.test.ets';
import polygonNewJsunit from './polygon.test.ets';
import polyLineNeJsunit from './polyLine.test.ets';
import progressScaleCountJsunit from './progress.test.ets';
import rectNeJsunit from './rect.test.ets';
import scrollOnScrollBeginJsunit from './scroll.test.ets';
import searchOnCutJsunit from './search.test.ets'
import swiperCurveJsunit from './swiper.test.ets';
import tabsBarPositionJsunit from './tabs.test.ets';
import textMinFontSizeJsunit from './text.test.ets';
import textAreaOnCutJsunit from './textArea.test.ets';
import textInputOnEditChangeJsunit from './textInput.test.ets';
import textPickerDefaultPickerItemHeightJsunit from './textPicker.test.ets';
import videoOnFullscreenChangeJsunit from './video.test.ets';
export default function testsuite() {
lazyForEachOnDataAddJsunit()
alphabetIndexerOnSelectJsunit()
checkBoxGroupSelectAllJsunit()
circleNewJsunit()
...
...
@@ -35,10 +46,19 @@ export default function testsuite() {
gridMaxCountJsunit()
gridItemOnSelectJsunit()
inspectorJsunit()
lazyForEachOnDataAdd
Jsunit()
navigatorTarget
Jsunit()
pathNewTest()
polygonNewJsunit()
polyLineNeJsunit()
progressScaleCountJsunit()
rectNeJsunit()
scrollOnScrollBeginJsunit()
searchOnCutJsunit()
swiperCurveJsunit()
tabsBarPositionJsunit()
textMinFontSizeJsunit()
textAreaOnCutJsunit()
textInputOnEditChangeJsunit()
textPickerDefaultPickerItemHeightJsunit()
videoOnFullscreenChangeJsunit()
}
\ No newline at end of file
arkui/ace_ets_component_apilack/entry/src/main/ets/test/inspector.test.ets
浏览文件 @
2ee3db7b
...
...
@@ -144,6 +144,11 @@ export default function inspectorJsunit() {
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testInspectorTestAdd0005
* @tc.desic aceTestInspectorTestAdd0005
*/
it('testInspectorTestAdd0005', 0, async function (done) {
console.info('testInspectorTestAdd0005 START');
try {
...
...
@@ -164,9 +169,9 @@ export default function inspectorJsunit() {
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_000
4
* @tc.name testInspectorTestAdd000
4
* @tc.desic aceTestInspectorTestAdd000
4
* @tc.number SUB_ACE_BASIC_ETS_API_000
6
* @tc.name testInspectorTestAdd000
6
* @tc.desic aceTestInspectorTestAdd000
6
*/
it('testInspectorTestAdd0006', 0, async function (done) {
var innerEvent3 = {
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/test/lazyForEach.test.ets
浏览文件 @
2ee3db7b
...
...
@@ -55,7 +55,7 @@ export default function lazyForEachOnDataAddJsunit() {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0001 START');
var innerEvent1 = {
eventId:
1
01,
eventId:
2
01,
priority: events_emitter.EventPriority.LOW
}
var callback1 = (eventData) => {
...
...
@@ -87,7 +87,7 @@ export default function lazyForEachOnDataAddJsunit() {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0002 START');
var innerEvent2 = {
eventId:
1
02,
eventId:
2
02,
priority: events_emitter.EventPriority.LOW
}
var callback2 = (eventData) => {
...
...
@@ -119,7 +119,7 @@ export default function lazyForEachOnDataAddJsunit() {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0003 START');
var innerEvent3 = {
eventId:
1
03,
eventId:
2
03,
priority: events_emitter.EventPriority.LOW
}
var callback3 = (eventData) => {
...
...
@@ -151,7 +151,7 @@ export default function lazyForEachOnDataAddJsunit() {
console.info('lazyForEachOnDataAdd testlazyForEachOnDataAdd0004 START');
var innerEvent4 = {
eventId:
1
04,
eventId:
2
04,
priority: events_emitter.EventPriority.LOW
}
var callback4 = (eventData) => {
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/test/navigator.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 navigatorTargetJsunit() {
describe('navigatorTargetTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/navigator',
}
try {
router.clear();
let pages = router.getState();
console.info("get navigator state success " + JSON.stringify(pages));
if (!("navigator" == pages.name)) {
console.info("get navigator state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push navigator page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push navigator page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("navigatorTarget after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testnavigatorTarget0001
* @tc.desic acenavigatorTargetEtsTest0001
*/
it('testnavigatorTarget0001', 0, async function (done) {
console.info('navigatorTarget testnavigatorTarget0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Navigator');
console.info("[testnavigatorTarget0001] component strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Navigator');
expect(obj.$attrs.target).assertEqual("pages/index");
console.info("[testnavigatorTarget0001] target value :" + obj.$attrs.target);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/progress.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 progressStyleJsunit() {
describe('progressStyleTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/progress',
}
try {
router.clear();
let pages = router.getState();
console.info("get progress state success " + JSON.stringify(pages));
if (!("progress" == pages.name)) {
console.info("get progress state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push progress page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push progress page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("progressStyle after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testprogressStyle0001
* @tc.desic aceprogressStyleEtsTest0001
*/
it('testprogressStyle0001', 0, async function (done) {
console.info('progressStyle testprogressStyle0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testprogressStyle0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testprogressStyle0002
* @tc.desic aceprogressStyleEtsTest0002
*/
it('testprogressStyle0002', 0, async function (done) {
console.info('progressStyle testprogressStyle0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0002] component color strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.color).assertEqual("#FF008000");
console.info("[testprogressStyle0002] color value :" + obj.$attrs.color);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testprogressStyle0003
* @tc.desic aceprogressStyleEtsTest0003
*/
it('testprogressStyle0003', 0, async function (done) {
console.info('progressStyle testprogressStyle0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0003] component value strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.value).assertEqual("50.000000");
console.info("[testprogressStyle0003] value value :" + obj.$attrs.value);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testprogressStyle0004
* @tc.desic aceprogressStyleEtsTest0004
*/
it('testprogressStyle0004', 0, async function (done) {
console.info('progressStyle testprogressStyle0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0004] component style strokeWidth strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.style.strokeWidth).assertEqual("20.00vp");
console.info("[testprogressStyle0004] style strokeWidth value :" + obj.$attrs.style.strokeWidth);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testprogressStyle0005
* @tc.desic aceprogressStyleEtsTest0005
*/
it('testprogressStyle0005', 0, async function (done) {
console.info('progressStyle testprogressStyle0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0005] component style scaleCount strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.style.scaleCount).assertEqual("30");
console.info("[testprogressStyle0005] style scaleCount value :" + obj.$attrs.style.scaleCount);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testprogressStyle0006
* @tc.desic aceprogressStyleEtsTest0006
*/
it('testprogressStyle0006', 0, async function (done) {
console.info('progressStyle testprogressStyle0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Progress');
console.info("[testprogressStyle0006] component style scaleWidth strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Progress');
expect(obj.$attrs.style.scaleWidth).assertEqual("20.00vp");
console.info("[testprogressStyle0006] style scaleWidth value :" + obj.$attrs.style.scaleWidth);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/search.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 searchOnCutJsunit() {
describe('searchOnCutTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/search',
}
try {
router.clear();
let pages = router.getState();
console.info("get search state success " + JSON.stringify(pages));
if (!("search" == pages.name)) {
console.info("get search state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push search page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push search page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("searchOnCut after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testsearchOnCut0001
* @tc.desic acesearchOnCutEtsTest0001
*/
it('testsearchOnCut0001', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("320.00vp");
console.info("[testsearchOnCut0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testsearchOnCut0002
* @tc.desic acesearchOnCutEtsTest0002
*/
it('testsearchOnCut0002', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testsearchOnCut0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testsearchOnCut0003
* @tc.desic acesearchOnCutEtsTest0003
*/
it('testsearchOnCut0003', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testsearchOnCut0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testsearchOnCut0004
* @tc.desic acesearchOnCutEtsTest0004
*/
it('testsearchOnCut0004', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testsearchOnCut0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testsearchOnCut0005
* @tc.desic acesearchOnCutEtsTest0005
*/
it('testsearchOnCut0005', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testsearchOnCut0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testsearchOnCut0006
* @tc.desic acesearchOnCutEtsTest0006
*/
it('testsearchOnCut0006', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testsearchOnCut0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testsearchOnCut0007
* @tc.desic acesearchOnCutEtsTest0007
*/
it('testsearchOnCut0007', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testsearchOnCut0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testsearchOnCut0009
* @tc.desic acesearchOnCutEtsTest0009
*/
it('testsearchOnCut0009', 0, async function (done) {
console.info('searchOnCut testsearchOnCut009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testsearchOnCut0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testsearchOnCut0010
* @tc.desic acesearchOnCutEtsTest0010
*/
it('testsearchOnCut0010', 0, async function (done) {
console.info('searchOnCut testsearchOnCut0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testsearchOnCut0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testsearchOnCut0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/swiper.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 swiperCurveJsunit() {
describe('swiperCurveTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/swiper',
}
try {
router.clear();
let pages = router.getState();
console.info("get swiper state success " + JSON.stringify(pages));
if (!("swiper" == pages.name)) {
console.info("get swiper state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push swiper page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push swiper page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("swiperCurve after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testswiperCurve0001
* @tc.desic aceswiperCurveEtsTest0001
*/
it('testswiperCurve0001', 0, async function (done) {
console.info('swiperCurve testswiperCurve0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testswiperCurve0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testswiperCurve0002
* @tc.desic aceswiperCurveEtsTest0002
*/
it('testswiperCurve0002', 0, async function (done) {
console.info('swiperCurve testswiperCurve0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testswiperCurve0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testswiperCurve0003
* @tc.desic aceswiperCurveEtsTest0003
*/
it('testswiperCurve0003', 0, async function (done) {
console.info('swiperCurve testswiperCurve0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testswiperCurve0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testswiperCurve0004
* @tc.desic aceswiperCurveEtsTest0004
*/
it('testswiperCurve0004', 0, async function (done) {
console.info('swiperCurve testswiperCurve0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testswiperCurve0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testswiperCurve0005
* @tc.desic aceswiperCurveEtsTest0005
*/
it('testswiperCurve0005', 0, async function (done) {
console.info('swiperCurve testswiperCurve0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testswiperCurve0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testswiperCurve0006
* @tc.desic aceswiperCurveEtsTest0006
*/
it('testswiperCurve0006', 0, async function (done) {
console.info('swiperCurve testswiperCurve0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testswiperCurve0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testswiperCurve0007
* @tc.desic aceswiperCurveEtsTest0007
*/
it('testswiperCurve0007', 0, async function (done) {
console.info('swiperCurve testswiperCurve0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testswiperCurve0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testswiperCurve0009
* @tc.desic aceswiperCurveEtsTest0009
*/
it('testswiperCurve0009', 0, async function (done) {
console.info('swiperCurve testswiperCurve009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testswiperCurve0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testswiperCurve0010
* @tc.desic aceswiperCurveEtsTest0010
*/
it('testswiperCurve0010', 0, async function (done) {
console.info('swiperCurve testswiperCurve0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('curveText');
console.info("[testswiperCurve0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testswiperCurve0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/tabs.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 tabsBarPositionJsunit() {
describe('tabsBarPositionTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/tabs',
}
try {
router.clear();
let pages = router.getState();
console.info("get tabs state success " + JSON.stringify(pages));
if (!("tabs" == pages.name)) {
console.info("get tabs state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push tabs page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push tabs page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("tabsBarPosition after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtabsBarPosition0001
* @tc.desic acetabsBarPositionEtsTest0001
*/
it('testtabsBarPosition0001', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtabsBarPosition0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtabsBarPosition0002
* @tc.desic acetabsBarPositionEtsTest0002
*/
it('testtabsBarPosition0002', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtabsBarPosition0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtabsBarPosition0003
* @tc.desic acetabsBarPositionEtsTest0003
*/
it('testtabsBarPosition0003', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testtabsBarPosition0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtabsBarPosition0004
* @tc.desic acetabsBarPositionEtsTest0004
*/
it('testtabsBarPosition0004', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtabsBarPosition0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtabsBarPosition0005
* @tc.desic acetabsBarPositionEtsTest0005
*/
it('testtabsBarPosition0005', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtabsBarPosition0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtabsBarPosition0006
* @tc.desic acetabsBarPositionEtsTest0006
*/
it('testtabsBarPosition0006', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtabsBarPosition0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtabsBarPosition0007
* @tc.desic acetabsBarPositionEtsTest0007
*/
it('testtabsBarPosition0007', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testtabsBarPosition0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtabsBarPosition0009
* @tc.desic acetabsBarPositionEtsTest0009
*/
it('testtabsBarPosition0009', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testtabsBarPosition0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtabsBarPosition0010
* @tc.desic acetabsBarPositionEtsTest0010
*/
it('testtabsBarPosition0010', 0, async function (done) {
console.info('tabsBarPosition testtabsBarPosition0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('barPositionText');
console.info("[testtabsBarPosition0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testtabsBarPosition0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/text.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 textMinFontSizeJsunit() {
describe('textMinFontSizeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/text',
}
try {
router.clear();
let pages = router.getState();
console.info("get text state success " + JSON.stringify(pages));
if (!("text" == pages.name)) {
console.info("get text state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push text page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push text page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textMinFontSize after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextMinFontSize0001
* @tc.desic acetextMinFontSizeEtsTest0001
*/
it('testtextMinFontSize0001', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtextMinFontSize0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextMinFontSize0002
* @tc.desic acetextMinFontSizeEtsTest0002
*/
it('testtextMinFontSize0002', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtextMinFontSize0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextMinFontSize0003
* @tc.desic acetextMinFontSizeEtsTest0003
*/
it('testtextMinFontSize0003', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontSize).assertEqual("30.00px");
console.info("[testtextMinFontSize0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextMinFontSize0004
* @tc.desic acetextMinFontSizeEtsTest0004
*/
it('testtextMinFontSize0004', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextMinFontSize0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextMinFontSize0005
* @tc.desic acetextMinFontSizeEtsTest0005
*/
it('testtextMinFontSize0005', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtextMinFontSize0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextMinFontSize0006
* @tc.desic acetextMinFontSizeEtsTest0006
*/
it('testtextMinFontSize0006', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtextMinFontSize0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextMinFontSize0007
* @tc.desic acetextMinFontSizeEtsTest0007
*/
it('testtextMinFontSize0007', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.lineHeight).assertEqual("25.00fp");
console.info("[testtextMinFontSize0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextMinFontSize0009
* @tc.desic acetextMinFontSizeEtsTest0009
*/
it('testtextMinFontSize0009', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.padding).assertEqual("10.00vp");
console.info("[testtextMinFontSize0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextMinFontSize0010
* @tc.desic acetextMinFontSizeEtsTest0010
*/
it('testtextMinFontSize0010', 0, async function (done) {
console.info('textMinFontSize testtextMinFontSize0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('minFontSizeText');
console.info("[testtextMinFontSize0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Left");
console.info("[testtextMinFontSize0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/textArea.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 textAreaOnCutJsunit() {
describe('textAreaOnCutTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/textArea',
}
try {
router.clear();
let pages = router.getState();
console.info("get textArea state success " + JSON.stringify(pages));
if (!("textArea" == pages.name)) {
console.info("get textArea state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push textArea page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push textArea page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textAreaOnCut after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextAreaOnCut0001
* @tc.desic acetextAreaOnCutEtsTest0001
*/
it('testtextAreaOnCut0001', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtextAreaOnCut0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextAreaOnCut0002
* @tc.desic acetextAreaOnCutEtsTest0002
*/
it('testtextAreaOnCut0002', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtextAreaOnCut0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextAreaOnCut0003
* @tc.desic acetextAreaOnCutEtsTest0003
*/
it('testtextAreaOnCut0003', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testtextAreaOnCut0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextAreaOnCut0004
* @tc.desic acetextAreaOnCutEtsTest0004
*/
it('testtextAreaOnCut0004', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextAreaOnCut0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextAreaOnCut0005
* @tc.desic acetextAreaOnCutEtsTest0005
*/
it('testtextAreaOnCut0005', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtextAreaOnCut0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextAreaOnCut0006
* @tc.desic acetextAreaOnCutEtsTest0006
*/
it('testtextAreaOnCut0006', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtextAreaOnCut0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextAreaOnCut0007
* @tc.desic acetextAreaOnCutEtsTest0007
*/
it('testtextAreaOnCut0007', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testtextAreaOnCut0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextAreaOnCut0009
* @tc.desic acetextAreaOnCutEtsTest0009
*/
it('testtextAreaOnCut0009', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testtextAreaOnCut0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextAreaOnCut0010
* @tc.desic acetextAreaOnCutEtsTest0010
*/
it('testtextAreaOnCut0010', 0, async function (done) {
console.info('textAreaOnCut testtextAreaOnCut0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onCutText');
console.info("[testtextAreaOnCut0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextArea');
expect(obj.$attrs.textAlign).assertEqual("TextAlign.Center");
console.info("[testtextAreaOnCut0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/textInput.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 textInputOnEditChangeJsunit() {
describe('textInputOnEditChangeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/textInput',
}
try {
router.clear();
let pages = router.getState();
console.info("get textInput state success " + JSON.stringify(pages));
if (!("textInput" == pages.name)) {
console.info("get textInput state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push textInput page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push textInput page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textInputOnEditChange after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextInputOnEditChange0001
* @tc.desic acetextInputOnEditChangeEtsTest0001
*/
it('testtextInputOnEditChange0001', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.width).assertEqual("100.00vp");
console.info("[testtextInputOnEditChange0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextInputOnEditChange0002
* @tc.desic acetextInputOnEditChangeEtsTest0002
*/
it('testtextInputOnEditChange0002', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.height).assertEqual("70.00vp");
console.info("[testtextInputOnEditChange0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextInputOnEditChange0003
* @tc.desic acetextInputOnEditChangeEtsTest0003
*/
it('testtextInputOnEditChange0003', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.fontSize).assertEqual("20.00fp");
console.info("[testtextInputOnEditChange0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextInputOnEditChange0004
* @tc.desic acetextInputOnEditChangeEtsTest0004
*/
it('testtextInputOnEditChange0004', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextInputOnEditChange0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextInputOnEditChange0005
* @tc.desic acetextInputOnEditChangeEtsTest0005
*/
it('testtextInputOnEditChange0005', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.align).assertEqual("Alignment.TopStart");
console.info("[testtextInputOnEditChange0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextInputOnEditChange0006
* @tc.desic acetextInputOnEditChangeEtsTest0006
*/
it('testtextInputOnEditChange0006', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.fontColor).assertEqual("#FFCCCCCC");
console.info("[testtextInputOnEditChange0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextInputOnEditChange0007
* @tc.desic acetextInputOnEditChangeEtsTest0007
*/
it('testtextInputOnEditChange0007', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testtextInputOnEditChange0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextInputOnEditChange0009
* @tc.desic acetextInputOnEditChangeEtsTest0009
*/
it('testtextInputOnEditChange0009', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testtextInputOnEditChange0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextInputOnEditChange0010
* @tc.desic acetextInputOnEditChangeEtsTest0010
*/
it('testtextInputOnEditChange0010', 0, async function (done) {
console.info('textInputOnEditChange testtextInputOnEditChange0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onEditChangeText');
console.info("[testtextInputOnEditChange0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.textAlign).assertEqual(undefined);
console.info("[testtextInputOnEditChange0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/textPicker.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 textPickerDefaultPickerItemHeightJsunit() {
describe('textPickerDefaultPickerItemHeightTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/textPicker',
}
try {
router.clear();
let pages = router.getState();
console.info("get textPicker state success " + JSON.stringify(pages));
if (!("textPicker" == pages.name)) {
console.info("get textPicker state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push textPicker page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push textPicker page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("textPickerDefaultPickerItemHeight after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testtextPickerDefaultPickerItemHeight0001
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0001
*/
it('testtextPickerDefaultPickerItemHeight0001', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.width).assertEqual("-");
console.info("[testtextPickerDefaultPickerItemHeight0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testtextPickerDefaultPickerItemHeight0002
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0002
*/
it('testtextPickerDefaultPickerItemHeight0002', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.height).assertEqual("-");
console.info("[testtextPickerDefaultPickerItemHeight0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testtextPickerDefaultPickerItemHeight0003
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0003
*/
it('testtextPickerDefaultPickerItemHeight0003', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.fontSize).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testtextPickerDefaultPickerItemHeight0004
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0004
*/
it('testtextPickerDefaultPickerItemHeight0004', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testtextPickerDefaultPickerItemHeight0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testtextPickerDefaultPickerItemHeight0005
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0005
*/
it('testtextPickerDefaultPickerItemHeight0005', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.align).assertEqual("Alignment.Center");
console.info("[testtextPickerDefaultPickerItemHeight0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testtextPickerDefaultPickerItemHeight0006
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0006
*/
it('testtextPickerDefaultPickerItemHeight0006', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.fontColor).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testtextPickerDefaultPickerItemHeight0007
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0007
*/
it('testtextPickerDefaultPickerItemHeight0007', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testtextPickerDefaultPickerItemHeight0009
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0009
*/
it('testtextPickerDefaultPickerItemHeight0009', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testtextPickerDefaultPickerItemHeight0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testtextPickerDefaultPickerItemHeight0010
* @tc.desic acetextPickerDefaultPickerItemHeightEtsTest0010
*/
it('testtextPickerDefaultPickerItemHeight0010', 0, async function (done) {
console.info('textPickerDefaultPickerItemHeight testtextPickerDefaultPickerItemHeight0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('defaultPickerItemHeightText');
console.info("[testtextPickerDefaultPickerItemHeight0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextPicker');
expect(obj.$attrs.textAlign).assertEqual(undefined);
console.info("[testtextPickerDefaultPickerItemHeight0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets
0 → 100644
浏览文件 @
2ee3db7b
/**
* 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 videoOnFullscreenChangeJsunit() {
describe('videoOnFullscreenChangeTest', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/video',
}
try {
router.clear();
let pages = router.getState();
console.info("get video state success " + JSON.stringify(pages));
if (!("video" == pages.name)) {
console.info("get video state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push video page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push video page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("videoOnFullscreenChange after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testvideoOnFullscreenChange0001
* @tc.desic acevideoOnFullscreenChangeEtsTest0001
*/
it('testvideoOnFullscreenChange0001', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.width).assertEqual("600.00vp");
console.info("[testvideoOnFullscreenChange0001] width value :" + obj.$attrs.width);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testvideoOnFullscreenChange0002
* @tc.desic acevideoOnFullscreenChangeEtsTest0002
*/
it('testvideoOnFullscreenChange0002', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.height).assertEqual("400.00vp");
console.info("[testvideoOnFullscreenChange0002] height value :" + obj.$attrs.height);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0003
* @tc.name testvideoOnFullscreenChange0003
* @tc.desic acevideoOnFullscreenChangeEtsTest0003
*/
it('testvideoOnFullscreenChange0003', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0003] component fontSize strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.fontSize).assertEqual(undefined);
console.info("[testvideoOnFullscreenChange0003] fontSize value :" + obj.$attrs.fontSize);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testvideoOnFullscreenChange0004
* @tc.desic acevideoOnFullscreenChangeEtsTest0004
*/
it('testvideoOnFullscreenChange0004', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0004] component opacity strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.opacity).assertEqual(1);
console.info("[testvideoOnFullscreenChange0004] opacity value :" + obj.$attrs.opacity);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0005
* @tc.name testvideoOnFullscreenChange0005
* @tc.desic acevideoOnFullscreenChangeEtsTest0005
*/
it('testvideoOnFullscreenChange0005', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0005 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.align).assertEqual("Alignment.Center");
console.info("[testvideoOnFullscreenChange0005] align value :" + obj.$attrs.align);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0006
* @tc.name testvideoOnFullscreenChange0006
* @tc.desic acevideoOnFullscreenChangeEtsTest0006
*/
it('testvideoOnFullscreenChange0006', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0006 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0006] component fontColor strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.fontColor).assertEqual(undefined);
console.info("[testvideoOnFullscreenChange0006] fontColor value :" + obj.$attrs.fontColor);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0007
* @tc.name testvideoOnFullscreenChange0007
* @tc.desic acevideoOnFullscreenChangeEtsTest0007
*/
it('testvideoOnFullscreenChange0007', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0007 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0007] component lineHeight strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.lineHeight).assertEqual(undefined);
console.info("[testvideoOnFullscreenChange0007] lineHeight value :" + obj.$attrs.lineHeight);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testvideoOnFullscreenChange0009
* @tc.desic acevideoOnFullscreenChangeEtsTest0009
*/
it('testvideoOnFullscreenChange0009', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange009 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0009] component padding strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.padding).assertEqual("0.00px");
console.info("[testvideoOnFullscreenChange0009] padding value :" + obj.$attrs.padding);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0010
* @tc.name testvideoOnFullscreenChange0010
* @tc.desic acevideoOnFullscreenChangeEtsTest0010
*/
it('testvideoOnFullscreenChange0010', 0, async function (done) {
console.info('videoOnFullscreenChange testvideoOnFullscreenChange0010 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('onFullscreenChangeText');
console.info("[testvideoOnFullscreenChange0010] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Video');
expect(obj.$attrs.textAlign).assertEqual(undefined);
console.info("[testvideoOnFullscreenChange0010] textAlign value :" + obj.$attrs.textAlign);
done();
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录