Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
29e6098c
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看板
未验证
提交
29e6098c
编写于
9月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5695 ets attr api覆盖
Merge pull request !5695 from Nicklaus/master
上级
7c2aae58
05a336a2
变更
17
显示空白变更内容
内联
并排
Showing
17 changed file
with
836 addition
and
50 deletion
+836
-50
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets
...pilack/entry/src/main/ets/MainAbility/pages/textInput.ets
+2
-2
arkui/ace_ets_component_attrlack/entry/src/main/config.json
arkui/ace_ets_component_attrlack/entry/src/main/config.json
+5
-1
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/color.ets
...t_attrlack/entry/src/main/ets/MainAbility/pages/color.ets
+39
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/common.ets
..._attrlack/entry/src/main/ets/MainAbility/pages/common.ets
+59
-2
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets
...lack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets
+66
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets
.../entry/src/main/ets/MainAbility/pages/list_item_group.ets
+86
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/remoteWindow.ets
...ack/entry/src/main/ets/MainAbility/pages/remoteWindow.ets
+3
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/text_input.ets
...rlack/entry/src/main/ets/MainAbility/pages/text_input.ets
+33
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets
..._component_attrlack/entry/src/main/ets/test/List.test.ets
+10
-5
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/basic.test.ets
...component_attrlack/entry/src/main/ets/test/basic.test.ets
+81
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets
...component_attrlack/entry/src/main/ets/test/color.test.ets
+65
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets
...omponent_attrlack/entry/src/main/ets/test/common.test.ets
+114
-38
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/configuration.test.ets
...t_attrlack/entry/src/main/ets/test/configuration.test.ets
+52
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets
...ent_attrlack/entry/src/main/ets/test/hitTestMode.test.ets
+65
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets
...attrlack/entry/src/main/ets/test/list_item_group.test.ets
+115
-0
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets
...nt_attrlack/entry/src/main/ets/test/remoteWindow.test.ets
+17
-2
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets
...nent_attrlack/entry/src/main/ets/test/text_input.test.ets
+24
-0
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/textInput.ets
浏览文件 @
29e6098c
arkui/ace_ets_component_attrlack/entry/src/main/config.json
浏览文件 @
29e6098c
...
...
@@ -93,11 +93,13 @@
"pages/gridCol"
,
"pages/gridRow"
,
"pages/listtest"
,
"pages/list_item_group"
,
"pages/loadingProgress"
,
"pages/pluginComponent"
,
"pages/progress"
,
"pages/radio"
,
"pages/refresh"
,
"pages/remoteWindow"
,
"pages/router"
,
"pages/scroll_edge"
,
"pages/sidebar"
,
...
...
@@ -110,7 +112,9 @@
"pages/web"
,
"pages/copyOption"
,
"pages/responseType"
,
"pages/hoverEffect"
"pages/hoverEffect"
,
"pages/hitTestMode"
,
"pages/color"
],
"name"
:
".MainAbility"
,
"window"
:
{
...
...
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/color.ets
0 → 100644
浏览文件 @
29e6098c
/**
* 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 ColorEnum {
build() {
Column() {
Text('Transparent')
.fontColor(Color.Transparent)
.backgroundColor(Color.Yellow)
.fontSize(50)
.key('Transparent')
.onClick(() => {
let strJson = getInspectorByKey('Transparent');
let obj = JSON.parse(strJson);
console.info("testTransparent fontColor is" + obj.$attrs.fontColor);
})
}.width("100%").height("100%")
}
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/common.ets
浏览文件 @
29e6098c
...
...
@@ -14,7 +14,7 @@
*/
import Log from '../common/Log.ets';
import events_emitter from '@ohos.events.emitter';
const TAG = 'ets_apiLack_add';
@Entry
...
...
@@ -118,7 +118,26 @@ export default struct CommonColorMode {
.textOverflow({ overflow: TextOverflow.None })
.key("areaText")
.onClick((event) => {
Log.showInfo(TAG, 'area: ' + JSON.stringify(event.target.area))
Log.showInfo(TAG, 'JSON.stringify area : ' + JSON.stringify(event.target.area))
const area = JSON.stringify(event.target.area)
console.info("area value1 is: " + area)
console.info("area value3 is: " + JSON.parse(JSON.stringify(event.target.area))["width"])
let value = JSON.parse(JSON.stringify(event.target.area))["width"]
try {
var backData = {
data: {
"STATUS": value
}
}
let backEvent = {
eventId: 60312,
priority: events_emitter.EventPriority.LOW
}
console.info("areaValue start to emit action state")
events_emitter.emit(backEvent, backData)
} catch (err) {
console.info("areaValue emit action state err: " + JSON.stringify(err.message))
}
})
Text("common-Repeat")
.width(320)
...
...
@@ -263,6 +282,25 @@ export default struct CommonColorMode {
.key("touchesText")
.onTouch((event) => {
Log.showInfo(TAG, 'touches: ' + JSON.stringify(event.touches))
const touchesValue = JSON.stringify(event.touches)
console.info("touches value1 is: " + touchesValue)
console.info("touches value3 is: " + JSON.stringify(event.touches)[0]["type"])
let value = JSON.stringify(event.touches)[0]["type"]
try {
var backData1 = {
data: {
"STATUS": value
}
}
let backEvent1 = {
eventId: 60313,
priority: events_emitter.EventPriority.LOW
}
console.info("touchesValue start to emit action state")
events_emitter.emit(backEvent1, backData1)
} catch (err) {
console.info("touchesValue emit action state err: " + JSON.stringify(err.message))
}
})
Text("common-ChangedTouches")
...
...
@@ -280,6 +318,25 @@ export default struct CommonColorMode {
.key("changedTouchesText")
.onTouch((event) => {
Log.showInfo(TAG, 'changedTouches: ' + JSON.stringify(event.changedTouches))
const changedTouchesValue = JSON.stringify(event.changedTouches)
console.info("changedTouchesValue value1 is: " + changedTouchesValue)
console.info("changedTouchesValue value3 is: " + changedTouchesValue[0]["type"])
let value = changedTouchesValue[0]["type"]
try {
var backData2 = {
data: {
"STATUS": value
}
}
let backEvent2 = {
eventId: 60314,
priority: events_emitter.EventPriority.LOW
}
console.info("touchesValue start to emit action state")
events_emitter.emit(backEvent2, backData2)
} catch (err) {
console.info("touchesValue emit action state err: " + JSON.stringify(err.message))
}
})
Text("common-KeyCode")
...
...
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/hitTestMode.ets
0 → 100644
浏览文件 @
29e6098c
// @ts-nocheck
/**
* 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
struct HitTestMode {
build() {
Column() {
// outer stack 1
Stack() {
Button('outer button')
.onTouch((event) => {
console.info('HitTestMode outer button touched type: ' + event.type)
})
// inner stack
Stack() {
Button('inner button')
.key("innnerButton")
.onTouch((event) => {
console.info('HitTestMode inner button touched type: ' + event.type)
})
}
.key("Block")
.width("100%")
.height("100%")
.hitTestBehavior(HitTestMode.Block)
.onTouch((event) => {
console.info('HitTestMode inner stack touched type: ' + event.type)
})
Text('Transparent')
.key("Transparent")
.hitTestBehavior(HitTestMode.Transparent)
.width("100%")
.height("50%")
.onTouch((event) => {
console.info('HitTestMode text touched type: ' + event.type)
let strJson = getInspectorByKey('Transparent');
let obj = JSON.parse(strJson);
console.info("HitTestMode hitTestBehavior is " + obj.$attrs.hitTestBehavior);
let strJson2 = getInspectorByKey('Block');
let obj2 = JSON.parse(strJson2);
console.info("HitTestMode hitTestBehavior is " + obj2.$attrs.hitTestBehavior);
})
}.width(300).height(300).backgroundColor(Color.Gray)
}.width('100%').height('100%')
}
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/list_item_group.ets
0 → 100644
浏览文件 @
29e6098c
// @ts-nocheck
/**
* 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';
function itemHeadBuilder(text: string) {
@Builder function itemHead() {
Text(text)
.fontSize(20)
.backgroundColor(0xAABBCC)
.width("100%")
.padding(10)
}
return itemHead
}
function itemFootBuilder(num: number) {
@Builder function itemFoot() {
Text('共' + num + "节课")
.fontSize(16)
.backgroundColor(0xAABBCC)
.width("100%")
.padding(5)
}
return itemFoot
}
@Entry
@Component
struct ListItemGroupExample {
private timetable: any = [
{
title:'Mon',
projects:['语文', '数学', '英语']
},
{
title:'Tues',
projects:['物理', '化学', '生物']
},
{
title:'Wens',
projects:['历史', '地理', '政治']
},
{
title:'Thur',
projects:['美术', '音乐', '体育']
}
]
build() {
Column() {
List({ space: 20 }) {
ForEach(this.timetable, (item) => {
ListItemGroup({ header:itemHeadBuilder(item.title), footer:itemFootBuilder(item.projects.length) }) {
ForEach(item.projects, (project) => {
ListItem() {
Text(project)
.width("100%").height(100).fontSize(20)
.textAlign(TextAlign.Center).backgroundColor(0xFFFFFF)
}
}, item => item)
}
.key(item)
.borderRadius(20)
.divider({ strokeWidth: 1, color: Color.Blue}) // 每行之间的分界线
})
}
.width('90%')
.sticky(StickyStyle.Header | StickyStyle.Footer)
}.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 })
}
}
\ No newline at end of file
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/remoteWindow.ets
浏览文件 @
29e6098c
...
...
@@ -20,6 +20,8 @@ const TAG = 'ets_apiLack_add';
@Entry
@Component
export default struct FormComponentFormDimension {
@State target: WindowAnimationTarget = undefined // 通过windowAnimationManager获取
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear Dimension start`)
}
...
...
@@ -52,6 +54,7 @@ export default struct FormComponentFormDimension {
.position({ x: px2vp(this.target?.windowBounds.left), y: px2vp(this.target?.windowBounds.top) })
.width(px2vp(this.target?.windowBounds.width))
.height(px2vp(this.target?.windowBounds.height))
.key('remoteWindow')
}
.width('100%')
...
...
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/text_input.ets
浏览文件 @
29e6098c
...
...
@@ -21,6 +21,8 @@ const TAG = 'ets_apiLack_add';
@Component
export default struct Text_inputPhoneNumber {
@State text: string = ''
@State text1: string = 'PhoneNumber'
@State text2: string = 'Address'
aboutToAppear() {
Log.showInfo(TAG, `aboutToAppear Text_inputPhoneNumber start`)
...
...
@@ -49,6 +51,37 @@ export default struct Text_inputPhoneNumber {
this.text = value
})
Text(this.text1).width('90%')
TextInput({ placeholder: 'input your word' })
.key('textInput1')
.type(InputType.PhoneNumber)
.placeholderColor("rgb(0,0,225)")
.placeholderFont({ size: 30, weight: 100, family: 'cursive', style: FontStyle.Italic })
.caretColor(Color.Blue)
.height(50)
.fontSize(30)
.fontWeight(FontWeight.Bold)
.fontFamily("sans-serif")
.fontStyle(FontStyle.Normal)
.fontColor(Color.Red)
.style(TextInputStyle.Default)
Text(this.text2).width('90%')
TextInput({ placeholder: 'input your word' })
.key('textInput2')
.type(InputType.PhoneNumber)
.placeholderColor("rgb(0,0,225)")
.placeholderFont({ size: 30, weight: 100, family: 'cursive', style: FontStyle.Italic })
.caretColor(Color.Blue)
.height(50)
.fontSize(30)
.fontWeight(FontWeight.Bold)
.fontFamily("sans-serif")
.fontStyle(FontStyle.Normal)
.fontColor(Color.Red)
.style(TextInputStyle.Inline)
.margin(10)
}.width("100%").height("100%")
}
}
...
...
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/List.test.ets
浏览文件 @
29e6098c
...
...
@@ -23,14 +23,17 @@ import canvasActualBoundingBoxAscentJsunit from './canvas.test.ets';
import checkBoxGroupJsunit from './checkBox.test.ets';
import checkBoxGroupPartJsunit from './checkBoxGroup.test.ets';
import commonColorModeJsunit from './common.test.ets';
import configurationApiTest from './configuration.test.ets'
import datePickerLunarJsunit from './datePicker.test.ets';
import enumsCancelJsunit from './enums.test.ets';
import gestureParallelJsunit from './gesture.test.ets';
import listtestIdleJsunit from './listtest.test.ets';
import list_item_groupJsunit from './list_item_group.test.ets'
import loadingProgressCircularJsunit from './loadingProgress.test.ets';
import progressScaleCountJsunit from './progress.test.ets';
import radioGroupJsunit from './radio.test.ets';
import refreshDragJsunit from './refresh.test.ets';
import remoteWindowJsunit from './remoteWindow.test.ets'
import sidebarIconsJsunit from './sidebar.test.ets';
import sliderMovingJsunit from './slider.test.ets';
import stateManagementDARKJsunit from './stateManagement.test.ets';
...
...
@@ -42,12 +45,13 @@ import webEditTextJsunit from './web.test.ets';
import hoverEffectJsunit from './hoverEffect.test.ets';
import responseTypeJsunit from './responseType.test.ets';
import copyOptionJsunit from './copyOption.test.ets';
import hitTestModeJsunit from './hitTestMode.test.ets';
import colorEnumJsunit from './color.test.ets';
import basicJsunit from './basic.test.ets';
export default function testsuite() {
animatorOnframeJsunit()
curvesEaseOutJsunit()
routerStandardJsunit()
uiAppearanceALWAYS_DARKJsunit()
appVersionCodeJsunit()
alertDialogCenterStartJsunit()
canvasActualBoundingBoxAscentJsunit()
...
...
@@ -55,22 +59,23 @@ export default function testsuite() {
checkBoxGroupPartJsunit()
commonColorModeJsunit()
datePickerLunarJsunit()
enumsCancelJsunit()
gestureParallelJsunit()
listtestIdleJsunit()
loadingProgressCircularJsunit()
progressScaleCountJsunit()
radioGroupJsunit()
re
freshDrag
Jsunit()
re
moteWindow
Jsunit()
sidebarIconsJsunit()
sliderMovingJsunit()
stateManagementDARKJsunit()
stepperItemDisabledJsunit()
swiperMaskJsunit()
text_inputPhoneNumberJsunit()
unitsModuleNameJsunit()
webEditTextJsunit()
hoverEffectJsunit()
responseTypeJsunit()
copyOptionJsunit()
hitTestModeJsunit()
colorEnumJsunit()
basicJsunit()
}
\ No newline at end of file
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/basic.test.ets
0 → 100644
浏览文件 @
29e6098c
// @ts-nocheck
/**
* 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index";
import Utils from './Utils.ets'
export default function basicJsunit() {
describe('basicJsunit', function () {
let businessCallback: AsyncCallback<string, Array<number>> = (error, data) => {
console.info("businessCallback error data is" + JSON.stringify(error.data));
expect(JSON.stringify(error.data)).assertEqual("[1,2]");
}
function businessErrorTest(asyncCallback: AsyncCallback<string, Array<number>>): void {
let businessError: BusinessError<Array<number>> = {
code: 1,
data: [1,2]
};
businessCallback(businessError, "businessErrorCallback");
}
let asyncCallback: AsyncCallback<string, Array<number>> = (error, data) => {
console.info("asyncCallback error data is" + error.data);
expect(error.data).assertEqual(EdgeEffect.Fade);
}
function asyncCallbackTest(asyncCallback: AsyncCallback<string, EdgeEffect>): void {
let businessError: BusinessError<EdgeEffect> = {
code: 1,
data: EdgeEffect.Fade
};
asyncCallback(businessError, "asyncCallback");
}
beforeEach(async function (done) {
console.info("basicTest beforeEach start");
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("basicTest after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testAsyncCallbackE0001
* @tc.desic aceAsyncCallbackEEtsTest0001
*/
it('testAsyncCallbackE0001', 0, async function (done) {
console.info('basicTest testAsyncCallbackE0001 START');
await Utils.sleep(2000);
asyncCallbackTest(asyncCallback);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testBusinessError0002
* @tc.desic aceBusinessErrorEtsTest0001
*/
it('testBusinessError0002', 0, async function (done) {
console.info('basicTest testBusinessError0002 START');
await Utils.sleep(2000);
businessErrorTest(businessCallback);
done();
});
});
}
\ No newline at end of file
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/color.test.ets
0 → 100644
浏览文件 @
29e6098c
/**
* 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 colorEnumJsunit() {
describe('colorEnumJsunit', function () {
beforeEach(async function (done) {
console.info("color beforeEach start");
let options = {
uri: 'pages/color',
}
try {
router.clear();
let pages = router.getState();
console.info("get color state success " + JSON.stringify(pages));
if (!("color" == pages.name)) {
console.info("get color state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(1000);
console.info("push color page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push color page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("colorEnumTest after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testcolorTransparent0001
* @tc.desic acecolorTransparentEtsTest0001
*/
it('testcolorTransparent0001', 0, async function (done) {
console.info('colorEnumTest testcolorTransparent0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Transparent');
console.info("[testcolorTransparent0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
console.info("[testcolorTransparent0001] fontColor value :" + obj.$attrs.fontColor);
expect(obj.$attrs.fontColor).assertEqual("#FF000000");
done();
});
})
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/common.test.ets
浏览文件 @
29e6098c
...
...
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
...
...
@@ -47,124 +48,199 @@ export default function commonColorModeJsunit() {
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0011
* @tc.name test
c
ommonColorMode0011
* @tc.name test
C
ommonColorMode0011
* @tc.desic acecommonColorModeEtsTest0011
*/
it('test
c
ommonColorMode0011', 0, async function (done) {
console.info('commonColorMode test
c
ommonColorMode0011 START');
it('test
C
ommonColorMode0011', 0, async function (done) {
console.info('commonColorMode test
C
ommonColorMode0011 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('ThinText');
console.info("[test
c
ommonColorMode0011] component textAlign strJson:" + strJson);
console.info("[test
C
ommonColorMode0011] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined);
console.info("[test
c
ommonColorMode0011] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
console.info("[test
C
ommonColorMode0011] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0012
* @tc.name test
c
ommonColorMode0012
* @tc.name test
C
ommonColorMode0012
* @tc.desic acecommonColorModeEtsTest0012
*/
it('test
c
ommonColorMode0012', 0, async function (done) {
console.info('commonColorMode test
c
ommonColorMode0012 START');
it('test
C
ommonColorMode0012', 0, async function (done) {
console.info('commonColorMode test
C
ommonColorMode0012 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('ThickText');
console.info("[test
c
ommonColorMode0012] component textAlign strJson:" + strJson);
console.info("[test
C
ommonColorMode0012] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.backgroundBlurStyle).assertEqual(undefined);
console.info("[test
c
ommonColorMode0012] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
console.info("[test
C
ommonColorMode0012] backgroundBlurStyle value :" + obj.$attrs.backgroundBlurStyle);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00017
* @tc.name test
c
ommonMiddle0001
* @tc.name test
C
ommonMiddle0001
* @tc.desic acecommonMiddleEtsTest0001
*/
it('test
c
ommonMiddle0001', 0, async function (done) {
console.info('commonMiddle test
c
ommonMiddle0001 START');
it('test
C
ommonMiddle0001', 0, async function (done) {
console.info('commonMiddle test
C
ommonMiddle0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('middleText');
console.info("[test
c
ommonMiddle0001] component textAlign strJson:" + strJson);
console.info("[test
C
ommonMiddle0001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
console.info("[test
c
ommonMiddle0001] alignRules value :" + obj.$attrs.alignRules);
console.info("[test
C
ommonMiddle0001] alignRules value :" + obj.$attrs.alignRules);
expect(obj.$attrs.alignRules).assertEqual(undefined);
console.info("[test
c
ommonMiddle0001] alignRules value :" + obj.$attrs.alignRules);
console.info("[test
C
ommonMiddle0001] alignRules value :" + obj.$attrs.alignRules);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00018
* @tc.name test
c
ommonOutset0001
* @tc.name test
C
ommonOutset0001
* @tc.desic acecommonOutsetEtsTest0001
*/
it('test
c
ommonOutset0001', 0, async function (done) {
console.info('commonOutset test
c
ommonOutset0001 START');
it('test
C
ommonOutset0001', 0, async function (done) {
console.info('commonOutset test
C
ommonOutset0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('outsetText');
console.info("[test
c
ommonOutset0001] component textAlign strJson:" + strJson);
console.info("[test
C
ommonOutset0001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
console.info("[test
c
ommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
console.info("[test
C
ommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
expect(obj.$attrs.borderImage).assertEqual(undefined);
console.info("[test
c
ommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
console.info("[test
C
ommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00019
* @tc.name test
c
ommonRepeat0001
* @tc.name test
C
ommonRepeat0001
* @tc.desic acecommonRepeatEtsTest0001
*/
it('test
c
ommonRepeat0001', 0, async function (done) {
console.info('commonRepeat test
c
ommonRepeat0001 START');
it('test
C
ommonRepeat0001', 0, async function (done) {
console.info('commonRepeat test
C
ommonRepeat0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('RepeatText');
console.info("[test
c
ommonRepeat0001] component textAlign strJson:" + strJson);
console.info("[test
C
ommonRepeat0001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.borderImage).assertEqual(undefined);
console.info("[test
c
ommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
console.info("[test
C
ommonOutset0001] borderImage value :" + obj.$attrs.borderImage);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00020
* @tc.name test
c
ommonSpace0001
* @tc.name test
C
ommonSpace0001
* @tc.desic acecommonSpaceEtsTest0001
*/
it('test
c
ommonSpace0001', 0, async function (done) {
console.info('commonSpace test
c
ommonSpace0001 START');
it('test
C
ommonSpace0001', 0, async function (done) {
console.info('commonSpace test
C
ommonSpace0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('SpaceText');
console.info("[test
c
ommonSpace0001] component textAlign strJson:" + strJson);
console.info("[test
C
ommonSpace0001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
expect(obj.$attrs.borderImage).assertEqual(undefined);
console.info("[test
c
ommonSpace0001] borderImage value :" + obj.$attrs.borderImage);
console.info("[test
C
ommonSpace0001] borderImage value :" + obj.$attrs.borderImage);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00021
* @tc.name test
c
ommonSlice0001
* @tc.name test
C
ommonSlice0001
* @tc.desic acecommonSliceEtsTest0001
*/
it('test
c
ommonSlice0001', 0, async function (done) {
console.info('commonSlice test
c
ommonSlice0001 START');
it('test
C
ommonSlice0001', 0, async function (done) {
console.info('commonSlice test
C
ommonSlice0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('sliceText');
console.info("[test
c
ommonSlice0001] component textAlign strJson:" + strJson);
console.info("[test
C
ommonSlice0001] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Text');
console.info("[test
c
ommonSlice0001] borderImage value :" + obj.$attrs.borderImage);
console.info("[test
C
ommonSlice0001] borderImage value :" + obj.$attrs.borderImage);
expect(obj.$attrs.borderImage).assertEqual(undefined);
console.info("[test
c
ommonSlice0001] borderImage value :" + obj.$attrs.borderImage);
console.info("[test
C
ommonSlice0001] borderImage value :" + obj.$attrs.borderImage);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00022
* @tc.name testCommonArea0001
* @tc.desic acecommonAreaEtsTest0001
*/
it('testCommonArea0001', 0, async function (done) {
console.info('commonSlice testCommonArea0001 START');
await Utils.sleep(500);
try {
var innerEvent = {
eventId: 60312,
priority: events_emitter.EventPriority.LOW
}
var callback = (eventData) => {
console.info("testCommonArea0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.STATUS).assertEqual(320);
done();
}
console.info("testCommonArea0001 click result is: " + JSON.stringify(sendEventByKey('areaText', 10, "")));
events_emitter.on(innerEvent, callback);
} catch (err) {
console.info("testCommonArea0001 on click err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00023
* @tc.name testCommonTouches0001
* @tc.desic acecommonTouchesEtsTest0001
*/
it('testCommonTouches0001', 0, async function (done) {
console.info('commonSlice testCommonTouches0001 START');
await Utils.sleep(500);
try {
var innerEvent = {
eventId: 60313,
priority: events_emitter.EventPriority.LOW
}
var callback = (eventData) => {
console.info("testCommonTouches0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.STATUS).assertEqual(undefined);
done();
}
console.info("testCommonTouches0001 click result is: " + JSON.stringify(sendEventByKey('touchesText', 10, "")));
events_emitter.on(innerEvent, callback);
} catch (err) {
console.info("testCommonTouches0001 on click err : " + JSON.stringify(err));
}
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_00024
* @tc.name testCommonChangedTouches0001
* @tc.desic acecommonTouchesEtsTest0001
*/
it('testCommonChangedTouches0001', 0, async function (done) {
console.info('commonSlice testCommonChangedTouches0001 START');
await Utils.sleep(500);
try {
var innerEvent = {
eventId: 60314,
priority: events_emitter.EventPriority.LOW
}
var callback = (eventData) => {
console.info("testCommonChangedTouches0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.STATUS).assertEqual(undefined);
done();
}
console.info("changedTouches0001 click is: " + JSON.stringify(sendEventByKey('changedTouchesText', 10, "")));
events_emitter.on(innerEvent, callback);
} catch (err) {
console.info("testCommonChangedTouches0001 on click err : " + JSON.stringify(err));
}
});
})
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/configuration.test.ets
0 → 100644
浏览文件 @
29e6098c
// @ts-nocheck
/**
* 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 configuration from '@system.configuration';
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import events_emitter from '@ohos.events.emitter';
import Utils from './Utils.ets'
export default function configurationApiTest() {
describe('configurationApiTest', function () {
beforeEach(async function (done) {
await Utils.sleep(1000);
console.info("appVersionCode after each called");
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("appVersionCode after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name colorMode001
* @tc.desic aceColorMode001EtsTest0001
*/
it('colorMode001', 0, async function (done) {
console.info('colorMode001 test START');
const localeInfo = configuration.getLocale();
console.info("[configuration.getLocale] localeInfo: " + JSON.stringify(localeInfo));
console.info("[configuration.getLocale] colorMode: " + localeInfo.colorMode);
console.info("[configuration.getLocale] fontScale: " + localeInfo.fontScale);
expect(localeInfo.colorMode).assertEqual('COLOR_MODE_LIGHT');
expect(localeInfo.fontScale).assertEqual('ltr');
console.info('testConfigurationGetLocale END');
done();
});
})
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/hitTestMode.test.ets
0 → 100644
浏览文件 @
29e6098c
/**
* 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 hitTestModeJsunit() {
describe('hitTestModeJsunit', function () {
beforeEach(async function (done) {
console.info("hitTestMode beforeEach start");
let options = {
uri: 'pages/hitTestMode',
}
try {
router.clear();
let pages = router.getState();
console.info("get hitTestMode state success " + JSON.stringify(pages));
if (!("hitTestMode" == pages.name)) {
console.info("get hitTestMode state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push hitTestMode page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push hitTestMode page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("hitTestModeTest after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testhitTestMode0002
* @tc.desic acehitTestModelEtsTest0002
*/
it('testhitTestMode0002', 0, async function (done) {
console.info('hitTestMode testhitTestMode0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Block');
console.info("[testhitTestMode0002] component width strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Stack');
console.info("[testhitTestMode0002] hitTestBehavior value :" + obj.$attrs.hitTestBehavior);
expect(obj.$attrs.hitTestBehavior).assertEqual(undefined);
done();
});
})
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/list_item_group.test.ets
0 → 100644
浏览文件 @
29e6098c
/**
* 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 events_emitter from '@ohos.events.emitter';
import router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"
import Utils from './Utils.ets'
export default function list_item_groupJsunit() {
describe('list_item_groupJsunit', function () {
beforeAll(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'pages/list_item_group',
}
try {
router.clear();
let pages = router.getState();
console.info("get list_item_group state success " + JSON.stringify(pages));
if (!("list_item" == pages.name)) {
console.info("get list_item_group state success " + JSON.stringify(pages.name));
let result = await router.push(options);
await Utils.sleep(2000);
console.info("push list_item_group page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push list_item_group page error: " + err);
}
done()
});
afterEach(async function () {
await Utils.sleep(1000);
console.info("list_item_group after each called");
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0001
* @tc.name testlist_itemOnSelect0001
* @tc.desic acelist_itemOnSelectEtsTest0001
*/
it('testlist_item_group0001', 0, async function (done) {
console.info('testcase testlist_item_group0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Mon');
console.info("[testlist_item_group0001] component state strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('ListItemGroup');
console.info("[testlist_item_group0001] editable value :" + obj.$type);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testlist_itemOnSelect0002
* @tc.desic acelist_itemOnSelectEtsTest0002
*/
it('testlist_item_group0002', 0, async function (done) {
console.info('testcase testlist_item_group0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Tues');
console.info("[testlist_item_group0002] component border strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('ListItemGroup');
console.info("[testlist_item_group0002] selectable value :" + obj.$type);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0002
* @tc.name testlist_itemOnSelect0003
* @tc.desic acelist_itemOnSelectEtsTest0002
*/
it('testlist_item_group0003', 0, async function (done) {
console.info('testcase testlist_item_group0003 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Wens');
console.info("[testlist_item_group0003] component border strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('ListItemGroup');
expect(obj.$attrs.header).assertNotEqual(undefined);
console.info("[testlist_itemOnSelect0003] hear value :" + obj.$attrs.header);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0004
* @tc.name testlist_itemSwipeAction0004
* @tc.desic acelist_itemSwipeActionEtsTest0004
*/
it('testlist_item_group0004', 0, async function (done) {
console.info('testcase testlist_item_group0004 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('Thurs');
console.info("[testlist_item_group0004] component border strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('ListItemGroup');
expect(obj.$attrs.rooter).assertNotEqual(undefined);
console.info("[testlist_item_group0004] hear value :" + obj.$attrs.rooter);
done();
});
})
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/remoteWindow.test.ets
浏览文件 @
29e6098c
...
...
@@ -164,8 +164,6 @@ export default function remoteWindowJsunit() {
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0009
* @tc.name testRemoteWindow0009
...
...
@@ -216,5 +214,22 @@ export default function remoteWindowJsunit() {
console.info("[testRemoteWindow0011] indicatorStyle value :" + obj.$attrs.indicatorStyle);
done();
});
/*
* @tc.number SUB_ACE_BASIC_ETS_API_0012
* @tc.name testRemoteWindow0011
* @tc.desic aceRemoteWindowEtsTest0011
*/
it('testRemoteWindow0012', 0, async function (done) {
console.info('RemoteWindow testRemoteWindow0012 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('remoteWindow');
console.info("[testRemoteWindow0012] component textAlign strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$attrs.target).assertNotEqual(undefined);
expect(obj.$attrs.target.missionId).assertNotEqual(undefined);
console.info("[testRemoteWindow0012] missionId value :" + obj.$attrs.target.missionId);
done();
});
})
}
arkui/ace_ets_component_attrlack/entry/src/main/ets/test/text_input.test.ets
浏览文件 @
29e6098c
...
...
@@ -61,5 +61,29 @@ export default function text_inputPhoneNumberJsunit() {
console.info("[testtext_inputPhoneNumber0001] type value :" + obj.$attrs.type);
done();
});
it('testtextInputStyle0001', 0, async function (done) {
console.info('textInputStyle testtextInputStyle0001 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('textInput1');
console.info("[testtextInputStyle0001] strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.style).assertEqual('TextInputStyle.Default');
console.info("[testtextInputStyle0001] textInput1 InputStyle value :" + obj.$attrs.style);
done();
});
it('testtextInputStyle0002', 0, async function (done) {
console.info('textInputStyle testtextInputStyle0002 START');
await Utils.sleep(2000);
let strJson = getInspectorByKey('textInput2');
console.info("[testtextInputStyle0002] strJson:" + strJson);
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('TextInput');
expect(obj.$attrs.style).assertEqual('TextInputStyle.Inline');
console.info("[testtextInputStyle0002] textInput2 inputStyle value :" + obj.$attrs.style);
done();
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录