Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9043229d
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看板
提交
9043229d
编写于
6月 26, 2023
作者:
S
sunjiakun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0626 datepicker
Signed-off-by:
N
sunjiakun
<
sunjiakun3@huawei.com
>
上级
5a44a48c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
84 addition
and
10 deletion
+84
-10
arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/pages/Index.ets
...onent_datepicker/src/main/ets/TestAbility/pages/Index.ets
+22
-0
arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/DatePicker.ets
...ets_component_datepicker/src/main/ets/test/DatePicker.ets
+62
-10
未找到文件。
arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/TestAbility/pages/Index.ets
浏览文件 @
9043229d
...
...
@@ -91,6 +91,28 @@ struct DatePickerExample {
.onChange((date: DatePickerResult) => {
console.info( 'select current date is: ' + JSON.stringify(date))
})
Button('Dialog')
.fontColor('black')
.fontSize(20)
.fontWeight(FontWeight.Bold)
.margin(10)
.backgroundColor('#0D9FFB')
.width('40%')
.height(40)
.key("Dialog")
.onClick(() => {
DatePickerDialog.show({
start: new Date('1970-1-1'),
end: new Date('2100-1-1'),
selected: this.selectedDate,
lunar:true,
showTime:true,
disappearTextStyle:this.disappearTextStyle,
textStyle: this.textStyle,
selectedTextStyle: this.selectedTextStyle,
})
})
}
}
}
\ No newline at end of file
arkui/ace_ets_components_ux/ace_ets_component_datepicker/src/main/ets/test/DatePicker.ets
浏览文件 @
9043229d
...
...
@@ -484,7 +484,7 @@ export default function datepicker() {
eventId: 185,
priority: events_emitter.EventPriority.LOW
}
console.info("[ArkUI_Stage_
tim
epicker_textStyle_0600] start to publish emit");
console.info("[ArkUI_Stage_
dat
epicker_textStyle_0600] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[ArkUI_Stage_datePicker_textStyle_0600] change component data error: " + err.message);
...
...
@@ -809,7 +809,7 @@ export default function datepicker() {
let strJsonDefault = getInspectorByKey('datePickerDefault');
let objDefault = JSON.parse(strJsonDefault);
console.info("[ArkUI_Stage_
tim
epicker_selectedTextStyle_0700] disappearColor:" + obj.$attrs.selectedTextStyle.color);
console.info("[ArkUI_Stage_
dat
epicker_selectedTextStyle_0700] disappearColor:" + obj.$attrs.selectedTextStyle.color);
expect(obj.$attrs.selectedTextStyle.color).assertEqual(objDefault.$attrs.selectedTextStyle.color);
expect(obj.$attrs.selectedTextStyle.font.size).assertEqual(objDefault.$attrs.selectedTextStyle.font.size);
expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Lighter');
...
...
@@ -817,11 +817,11 @@ export default function datepicker() {
});
/*
* @tc.number ArkUI_Stage_
tim
epicker_selectedTextStyle_0800
* @tc.number ArkUI_Stage_
dat
epicker_selectedTextStyle_0800
* @tc.name Tests the selectedTextStyle property of the picker component
* @tc.desc set selectedTextStyle then get the value
*/
it('ArkUI_Stage_
tim
epicker_selectedTextStyle_0800', 0, async function (done) {
it('ArkUI_Stage_
dat
epicker_selectedTextStyle_0800', 0, async function (done) {
let value = {color:'rgb(138,43,226)',font:{size:'20vp',weight:900}}
try {
var eventData = {
...
...
@@ -833,10 +833,10 @@ export default function datepicker() {
eventId: 185,
priority: events_emitter.EventPriority.LOW
}
console.info("[ArkUI_Stage_
tim
epicker_selectedTextStyle_0800] start to publish emit");
console.info("[ArkUI_Stage_
dat
epicker_selectedTextStyle_0800] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[ArkUI_Stage_
tim
epicker_selectedTextStyle_0800] change component data error: " + err.message);
console.log("[ArkUI_Stage_
dat
epicker_selectedTextStyle_0800] change component data error: " + err.message);
}
await Utils.sleep(3000);
let strJson = getInspectorByKey('datePicker');
...
...
@@ -848,11 +848,11 @@ export default function datepicker() {
});
/*
* @tc.number ArkUI_Stage_
tim
epicker_selectedTextStyle_0900
* @tc.number ArkUI_Stage_
dat
epicker_selectedTextStyle_0900
* @tc.name Tests the selectedTextStyle property of the picker component
* @tc.desc set selectedTextStyle then get the value
*/
it('ArkUI_Stage_
tim
epicker_selectedTextStyle_0900', 0, async function (done) {
it('ArkUI_Stage_
dat
epicker_selectedTextStyle_0900', 0, async function (done) {
let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}}
try {
var eventData = {
...
...
@@ -864,10 +864,10 @@ export default function datepicker() {
eventId: 185,
priority: events_emitter.EventPriority.LOW
}
console.info("[ArkUI_Stage_
tim
epicker_selectedTextStyle_0900] start to publish emit");
console.info("[ArkUI_Stage_
dat
epicker_selectedTextStyle_0900] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[ArkUI_Stage_
tim
epicker_selectedTextStyle_0900] change component data error: " + err.message);
console.log("[ArkUI_Stage_
dat
epicker_selectedTextStyle_0900] change component data error: " + err.message);
}
await Utils.sleep(3000);
let strJson = getInspectorByKey('datePicker');
...
...
@@ -877,6 +877,58 @@ export default function datepicker() {
expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal');
done();
});
/*
* @tc.number ArkUI_Stage_datepicker_selectedTextStyle_0900
* @tc.name Tests the selectedTextStyle property of the picker component
* @tc.desc set selectedTextStyle then get the value
*/
it('ArkUI_Stage_datepicker_selectedTextStyle_0900', 0, async function (done) {
let value = {color:'rgb(138,43,226)',font:{size:'15lpx',weight:90}}
try {
var eventData = {
data: {
"selectedTextStyle": JSON.stringify(value)
}
}
var innerEvent = {
eventId: 185,
priority: events_emitter.EventPriority.LOW
}
console.info("[ArkUI_Stage_datepicker_selectedTextStyle_0900] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[ArkUI_Stage_datepicker_selectedTextStyle_0900] change component data error: " + err.message);
}
await Utils.sleep(3000);
let strJson = getInspectorByKey('datePicker');
let obj = JSON.parse(strJson);
expect(obj.$attrs.selectedTextStyle.color).assertEqual('#FF8A2BE2');
expect(obj.$attrs.selectedTextStyle.font.size).assertEqual('15.00lpx');
expect(obj.$attrs.selectedTextStyle.font.weight).assertEqual('FontWeight.Normal');
done();
});
/*
* @tc.number ArkUI_Stage_datepicker_Dialog_0100
* @tc.name Tests the property of the Dialog
* @tc.desc get the property of the Dialog
*/
it('ArkUI_Stage_datepicker_dialog_0100', 0, async function (done) {
console.info('testDialog START');
await Utils.sleep(3000);
try {
var innerEvent = {
eventId: 185,
priority: events_emitter.EventPriority.LOW
}
console.info("[ArkUI_Stage_datepicker_dialog_0100] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[ArkUI_Stage_datepicker_dialog_0100] change component data error: " + err.message);
}
done();
});
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录