Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b4e4a9b4
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看板
提交
b4e4a9b4
编写于
2月 02, 2023
作者:
H
hekun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the compile issue
Signed-off-by:
N
hekun
<
hekun18@huawei.com
>
上级
5bbe80fb
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
110 addition
and
63 deletion
+110
-63
arkui/ace_ets_component_ui/AppScope/app.json
arkui/ace_ets_component_ui/AppScope/app.json
+3
-3
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/buttonExample.ets
...ui/entry/src/main/ets/MainAbility/pages/buttonExample.ets
+15
-0
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/checkBoxGroupUI.ets
.../entry/src/main/ets/MainAbility/pages/checkBoxGroupUI.ets
+7
-3
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/divider.ets
...onent_ui/entry/src/main/ets/MainAbility/pages/divider.ets
+4
-4
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/guage.ets
...mponent_ui/entry/src/main/ets/MainAbility/pages/guage.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
...component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/ButtonJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/ButtonJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/List.test.ets
...ce_ets_component_ui/entry/src/main/ets/test/List.test.ets
+1
-3
arkui/ace_ets_component_ui/entry/src/main/ets/test/checkBoxGroupUIJsunit.test.ets
...ui/entry/src/main/ets/test/checkBoxGroupUIJsunit.test.ets
+67
-43
arkui/ace_ets_component_ui/entry/src/main/ets/test/dataPickerJsunit.test.ets
...nent_ui/entry/src/main/ets/test/dataPickerJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/dividerJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/dividerJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/module.json
arkui/ace_ets_component_ui/entry/src/main/module.json
+6
-0
未找到文件。
arkui/ace_ets_component_ui/AppScope/app.json
浏览文件 @
b4e4a9b4
...
...
@@ -11,10 +11,10 @@
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"minAPIVersion"
:
10
,
"targetAPIVersion"
:
10
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"apiCompatibleVersion"
:
10
,
"singleUser"
:
false
}
}
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/buttonExample.ets
浏览文件 @
b4e4a9b4
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {MessageManager,Callback} from '../utils/MessageManager';
@Entry
@Component
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/checkBoxGroupUI.ets
浏览文件 @
b4e4a9b4
...
...
@@ -20,6 +20,7 @@ struct CheckboxExample {
@State selectAll:boolean = true;
@State selectedColor:string = "#007DFF";
@State message:string = "testclick";
@State message2:string = "testclick2";
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('Checkbox onPageShow')
...
...
@@ -54,15 +55,15 @@ struct CheckboxExample {
console.info("checkbox group content" + JSON.stringify(itemName))
console.info("checkbox group content" + JSON.stringify(itemName.status))
console.info("checkbox group content" + JSON.stringify(itemName.name))
this.message = JSON.stringify(itemName.name) + itemName.status;
this.message = JSON.stringify(itemName.name);
this.message2 = JSON.stringify(itemName.status);
}).key("allck")
Text('Select All').fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500)
Text(this.message).fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500).margin({left:20}).key('text1')
}
// 选项1
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {
Checkbox({ name: 'checkbox1', group: 'checkboxGroup' })
.selectedColor('#007D
F
F')
.selectedColor('#007D
E
F')
.select(false)
.onChange((value: boolean) => {
console.info('Checkbox1 change is' + value)
...
...
@@ -90,6 +91,9 @@ struct CheckboxExample {
Text('Checkbox3').fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500)
}.margin({ left: 36 })
Text(this.message).fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500).margin({left:20,top:20}).key('text1')
Text(this.message2).fontSize(14).lineHeight(20).fontColor('#182431').fontWeight(500).margin({left:20,top:20}).key('text2')
}
}
}
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/divider.ets
浏览文件 @
b4e4a9b4
...
...
@@ -20,7 +20,7 @@ struct DividerExample {
@State color:string = '#acbdef'
@State strokeWidth:number = 20
@State lineCapStyle:LineCapStyle = LineCapStyle.Butt
@State width:number = 0
@State width
K
:number = 0
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('divider onPageShow')
...
...
@@ -41,8 +41,8 @@ struct DividerExample {
if (message.name == 'lineCapStyle') {
this.lineCapStyle = message.value
}
if (message.name == 'width') {
this.width = message.value
if (message.name == 'width
K
') {
this.width
K
= message.value
}
}
...
...
@@ -84,7 +84,7 @@ struct DividerExample {
.fontColor('#007DFF')
.fontWeight(500)
.backgroundColor(Color.Transparent)
Divider().vertical(this.vertical).height(22).color(this.color).width(this.width).margin({ left: 8, right: 8 }).strokeWidth(this.strokeWidth).lineCap(this.lineCapStyle).key("divider")
Divider().vertical(this.vertical).height(22).color(this.color).width(this.width
K
).margin({ left: 8, right: 8 }).strokeWidth(this.strokeWidth).lineCap(this.lineCapStyle).key("divider")
Button('Button')
.width(136)
.height(22)
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/guage.ets
浏览文件 @
b4e4a9b4
...
...
@@ -20,7 +20,7 @@ import {MessageManager,Callback} from '../utils/MessageManager';
struct GaugeExample {
@State startAngle:number = 0;
@State endAngle:number = 0;
@State colors:Array<
ColorStop
> = [[0x317AF7, 0.1], [0x5BA854, 0.2], [0xE08C3A, 0.3], [0x9C554B, 0.4]]
@State colors:Array<
[number,number]
> = [[0x317AF7, 0.1], [0x5BA854, 0.2], [0xE08C3A, 0.3], [0x9C554B, 0.4]]
@State strokeWidth:number = 0;
@State value:number = 30;
@State min:number = 0;
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
浏览文件 @
b4e4a9b4
...
...
@@ -88,7 +88,7 @@ export default function blankJsunit() {
let obj = JSON.parse(strJson);
console.info("[blankJsunit_0300'] component obj is: " + obj.$attrs.min);
// return not the default value to confirm ?
expect(obj.$attrs.min).assertEqual('
-30.00vp
');
expect(obj.$attrs.min).assertEqual('
0.00px
');
done();
});
...
...
@@ -162,7 +162,7 @@ export default function blankJsunit() {
let strJson2 = getInspectorByKey('bl2');
let obj2 = JSON.parse(strJson2);
console.info("[blankJsunit_0300'] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.min).assertEqual('0.00
vp
');
expect(obj2.$attrs.min).assertEqual('0.00
px
');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/ButtonJsunit.test.ets
浏览文件 @
b4e4a9b4
...
...
@@ -63,7 +63,7 @@ export default function buttonJsunit() {
it('buttonJsunit_0200', 0, async function (done) {
console.info('buttonJsunitUITest_0200 START');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'stateEffect', value:false);
globalThis.value.message.notify({name:'stateEffect', value:false
}
);
await CommonFunc.sleep(200);
let strJson2 = getInspectorByKey('btok');
let obj2 = JSON.parse(strJson2);
...
...
@@ -76,7 +76,7 @@ export default function buttonJsunit() {
console.info('buttonJsunitUITest_0300 START');
await CommonFunc.sleep(1000);
// 动态修改Button组件的属性,设置为非法值
globalThis.value.message.notify({name:'bttype', value:'5');
globalThis.value.message.notify({name:'bttype', value:'5'
}
);
await CommonFunc.sleep(500);
let strJson = getInspectorByKey('btok');
let obj = JSON.parse(strJson);
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/List.test.ets
浏览文件 @
b4e4a9b4
...
...
@@ -27,7 +27,7 @@ import marqueeJsunit from './marqueeJsunit.test.ets';
export default function testsuite() {
blankJsunit();
buttonJsunit();
//
checkBoxGroupUIJsunit();
checkBoxGroupUIJsunit();
CheckBoxJsunit();
dataPickerJsunit();
datelPanelJsunit();
...
...
@@ -35,6 +35,4 @@ export default function testsuite() {
gaugeJsunit();
loadingProgressJsunit();
marqueeJsunit();
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/ets/test/checkBoxGroupUIJsunit.test.ets
浏览文件 @
b4e4a9b4
...
...
@@ -41,9 +41,7 @@ export default function checkBoxGroupUIJsunit() {
}
done();
});
// add default testcase
// add enum of resource color test case
it('checkBoxGroupUIJsunit_0100', 0, async function (done) {
console.info('checkBoxGroupUIJsunit_0100 START');
...
...
@@ -52,15 +50,14 @@ export default function checkBoxGroupUIJsunit() {
let strJson = getInspectorByKey('allck');
console.info("checkBoxGroupUIJsunit_0100 strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("checkBoxGroupUIJsunit_0100 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectAll).assertEqual('true');
console.info("checkBoxGroupUIJsunit_0100 component obj is: " + JSON.stringify(obj.$attrs.selectedColor));
expect(obj.$attrs.selectedColor).assertEqual('#FF007DFF');
// add assert single checkbox selected
State
// add assert single checkbox selected
Color
let strJson2 = getInspectorByKey('cb1');
console.info("checkBoxGroupUIJsunit_cb1_0100 strJson:" + strJson2);
let obj2 = JSON.parse(strJson2);
console.info("checkBoxGroupUIJsunit_cb1_0100 component obj2 is: " + JSON.stringify(obj));
expect(obj2.$attrs.select
).assertEqual('true
');
console.info("checkBoxGroupUIJsunit_cb1_0100 component obj2 is: " + JSON.stringify(obj
2.$attrs.selectedColor
));
expect(obj2.$attrs.select
edColor).assertEqual('#FF007DEF
');
done();
});
...
...
@@ -68,7 +65,6 @@ export default function checkBoxGroupUIJsunit() {
console.info('checkBoxGroupUIJsunit_0200 START');
await CommonFunc.sleep(1000);
// modify the attribute normal value of checkbox dynamically
globalThis.value.message.notify({name:'selectAll',value:'false'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'selectedColor',value:'#EEAAFF'})
await CommonFunc.sleep(2000);
...
...
@@ -76,14 +72,12 @@ export default function checkBoxGroupUIJsunit() {
let strJson = getInspectorByKey('allck');
let obj = JSON.parse(strJson);
console.info("[checkBoxGroupUIJsunit_0200'] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectAll).assertEqual('false');
expect(obj.$attrs.selectedColor).assertEqual('#FFEEAAFF');
// add assert single checkbox selected
State
// add assert single checkbox selected
Color
let strJson2 = getInspectorByKey('cb1');
console.info("checkBoxGroupUIJsunit_cb1_0200 strJson:" + strJson2);
let obj2 = JSON.parse(strJson2);
console.info("checkBoxGroupUIJsunit_cb1_0200 component obj2 is: " + JSON.stringify(obj));
expect(obj2.$attrs.select
).assertEqual('false
');
console.info("checkBoxGroupUIJsunit_cb1_0200 component obj2 is: " + JSON.stringify(obj
2.$attrs.selectedColor
));
expect(obj2.$attrs.select
edColor).assertEqual('#FF007DEF
');
done();
});
...
...
@@ -104,45 +98,75 @@ export default function checkBoxGroupUIJsunit() {
it('checkBoxGroupUIJsunit_0400', 0, async function (done) {
console.info('checkBoxGroupUIJsunit_0400 START');
await CommonFunc.sleep(1000);
// modify the selectedColor
globalThis.value.message.notify({name:'selectedColor',value:'rgb(238, 130, 238)'})
await CommonFunc.sleep(2000);
// check the value of changed attribute
let strJson = getInspectorByKey('allck');
let obj = JSON.parse(strJson);
console.info("[checkBoxGroupUIJsunit_0400 '] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectedColor).assertEqual('#FFEE82EE');
done();
});
it('checkBoxGroupUIJsunit_0500', 0, async function (done) {
console.info('checkBoxGroupUIJsunit_0500 START');
await CommonFunc.sleep(1000);
// modify the selectedColor
globalThis.value.message.notify({name:'selectedColor',value:Color.Green})
await CommonFunc.sleep(2000);
// check the value of changed attribute
let strJson = getInspectorByKey('allck');
let obj = JSON.parse(strJson);
console.info("[checkBoxGroupUIJsunit_0500 '] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectedColor).assertEqual('#FF008000');
done();
});
it('checkBoxGroupUIJsunit_0600', 0, async function (done) {
console.info('checkBoxGroupUIJsunit_0600 START');
await CommonFunc.sleep(1000);
// test the clicking event of checkboxGroup
let driver =
await Ui
Driver.create();
let driver = Driver.create();
await driver.delayMs(waitUiReadyMs);
let checkboxAll = await driver.findComponent(BY.key('allck'));
expect(checkboxAll != null).assertTrue();
// checkboxGroup click
await checkboxAll.click();
let checkGoup = await driver.findComponent(ON.id('allck'));
await checkGoup.click();
await driver.delayMs(waitUiReadyMs);
// check the click event by text message
let text1 = await driver.findComponent(BY.text('SelectStatus.All'));
let text1tt = await text1.getText();
expect(text1tt == 'SelectStatus.All').assertTrue();
await checkboxAll.click();
await checkGoup.click();
await driver.delayMs(waitUiReadyMs);
// add assert single checkbox selectedState
done();
// check the isSelect and name
let ttx = await driver.findComponent(ON.id('text1'));
let txt = await ttx.getText();
console.info("[checkBoxGroupUIJsunit_0600'] component obj is: " + txt);
expect(txt).assertEqual('["checkbox1","checkbox2","checkbox3"]');
let ttxx = await driver.findComponent(ON.id('text2'));
let txtt = await ttxx.getText();
console.info("[checkBoxGroupUIJsunit_0600'] component obj2 is: " + txtt);
expect(txtt).assertEqual('0');
await checkGoup.click();
await driver.delayMs(waitUiReadyMs);
done();
});
it('checkBoxGroupUIJsunit_0
5
00', 0, async function (done) {
console.info('checkBoxGroupUIJsunit_0
5
00 START');
it('checkBoxGroupUIJsunit_0
7
00', 0, async function (done) {
console.info('checkBoxGroupUIJsunit_0
7
00 START');
await CommonFunc.sleep(1000);
// test the clicking event of checkboxGroup
let driver = await UiDriver.create();
let driver = Driver.create();
await driver.delayMs(waitUiReadyMs);
let checkbox2 = await driver.findComponent(BY.key('cb2'));
expect(checkbox2 != null).assertTrue();
await checkbox2.click();
let checkGoup = await driver.findComponent(ON.id('cb2'));
await checkGoup.click();
await driver.delayMs(waitUiReadyMs);
// test CheckboxGroup atrribute
let strJson = getInspectorByKey('allck');
console.info("checkBoxGroupUIJsunit_0500 strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("checkBoxGroupUIJsunit_0500 component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectAll).assertEqual('true'); // false ?
expect(obj.$attrs.selectedColor).assertEqual('#007DFF');
//add the select state onchange event assert
done();
// check the isSelect and name
let ttx = await driver.findComponent(ON.id('text1'));
let txt = await ttx.getText();
console.info("[checkBoxGroupUIJsunit_0700'] component obj is: " + txt);
expect(txt).assertEqual('["checkbox2"]');
let ttxx = await driver.findComponent(ON.id('text2'));
let txtt = await ttxx.getText();
console.info("[checkBoxGroupUIJsunit_0700'] component obj2 is: " + txtt);
expect(txtt).assertEqual('1');
done();
});
// 1.first click 2.two click test the name and checkboxstate
})
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/ets/test/dataPickerJsunit.test.ets
浏览文件 @
b4e4a9b4
...
...
@@ -49,7 +49,7 @@ export default function dataPickerJsunit() {
let strJson = getInspectorByKey('dataPicker');
let obj = JSON.parse(strJson);
console.info("obj is: " + JSON.stringify(obj));
console.info("dataPickerJsunit_0100'] component obj is: " + obj.$attrs.options);
console.info("dataPickerJsunit_0100'] component obj is: " + obj.$attrs.options
+ "---" + obj.$attrs.startDate
);
console.info("dataPickerJsunit_0100'] component obj is: " + obj.$attrs.start + "--" + obj.$attrs.end + "--" + obj.$attrs.selected);
expect(obj.$attrs.lunar).assertEqual('false');
done();
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/dividerJsunit.test.ets
浏览文件 @
b4e4a9b4
...
...
@@ -116,7 +116,7 @@ export default function dividerJsunit() {
console.info('dividerJsunit_0500 START');
await CommonFunc.sleep(1000);
// test the common attribute
globalThis.value.message.notify({name:'width',value:'1.0'})
globalThis.value.message.notify({name:'width
K
',value:'1.0'})
await CommonFunc.sleep(2000);
// check the value of changed attribute
let strJson = getInspectorByKey('divider');
...
...
arkui/ace_ets_component_ui/entry/src/main/module.json
浏览文件 @
b4e4a9b4
...
...
@@ -14,6 +14,12 @@
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"metadata"
:
[
{
"name"
:
"ArkTSPartialUpdate"
,
"value"
:
"true"
}
],
"abilities"
:
[{
"name"
:
"com.example.myapplication.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录