提交 ec8b0dfc 编写于 作者: W wang-xupeng2

update UI and Three testcases

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 fac1d5f6
...@@ -41,7 +41,7 @@ struct ShapeExample { ...@@ -41,7 +41,7 @@ struct ShapeExample {
this.strokeLineJoin = eventData.data.strokeLineJoin; this.strokeLineJoin = eventData.data.strokeLineJoin;
} }
if (eventData.data.strokeMiterLimit != null) { if (eventData.data.strokeMiterLimit != null) {
this.strokeMiterLimit = parseInt(eventData.data.strokeMiterLimit); this.strokeMiterLimit = eventData.data.strokeMiterLimit;
} }
if (eventData.data.strokeOpacity != null) { if (eventData.data.strokeOpacity != null) {
this.strokeOpacity = parseInt(eventData.data.strokeOpacity); this.strokeOpacity = parseInt(eventData.data.strokeOpacity);
......
...@@ -400,7 +400,59 @@ export default function shapeJsunit() { ...@@ -400,7 +400,59 @@ export default function shapeJsunit() {
var strJson = getInspectorByKey('shape'); var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson); var obj = JSON.parse(strJson);
console.info("shapeTest_2100 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); console.info("shapeTest_2100 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000'); expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(4);
done();
});
it('shapeTest_3200', 0, async function (done) {
console.info('shapeTest_3200 START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"strokeMiterLimit": 1,
}
}
var innerEvent = {
eventId: 192,
priority: events_emitter.EventPriority.LOW
}
console.info("shapeTest_3200 start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("shapeTest_3200 change component color error: " + err.message);
}
await Utils.sleep(2000);
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
console.info("shapeTest_3200 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(1);
done();
});
it('shapeTest_3300', 0, async function (done) {
console.info('shapeTest_3300 START');
await Utils.sleep(1000);
try {
var eventData = {
data: {
"strokeMiterLimit": 0.5,
}
}
var innerEvent = {
eventId: 192,
priority: events_emitter.EventPriority.LOW
}
console.info("shapeTest_3300 start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("shapeTest_3300 change component color error: " + err.message);
}
await Utils.sleep(2000);
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
console.info("shapeTest_3300 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(1);
done(); done();
}); });
...@@ -410,7 +462,7 @@ export default function shapeJsunit() { ...@@ -410,7 +462,7 @@ export default function shapeJsunit() {
try { try {
var eventData = { var eventData = {
data: { data: {
"strokeMiterLimit": 'aaa11111', "strokeMiterLimit": '11111',
} }
} }
var innerEvent = { var innerEvent = {
...@@ -426,7 +478,7 @@ export default function shapeJsunit() { ...@@ -426,7 +478,7 @@ export default function shapeJsunit() {
var strJson = getInspectorByKey('shape'); var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson); var obj = JSON.parse(strJson);
console.info("shapeTest_2200 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); console.info("shapeTest_2200 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000'); expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(11111);
done(); done();
}); });
...@@ -478,7 +530,7 @@ export default function shapeJsunit() { ...@@ -478,7 +530,7 @@ export default function shapeJsunit() {
var strJson = getInspectorByKey('shape'); var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson); var obj = JSON.parse(strJson);
console.info("shapeTest_2000 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); console.info("shapeTest_2000 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit));
expect(obj.$attrs.strokeMiterLimit).assertEqual('5.000000'); expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000');
done(); done();
}); });
......
...@@ -29,6 +29,7 @@ struct SliderExample { ...@@ -29,6 +29,7 @@ struct SliderExample {
@State inSetValueTwo: number = 40 @State inSetValueTwo: number = 40
@State vOutSetValueOne: number = 40 @State vOutSetValueOne: number = 40
@State vInSetValueOne: number = 40 @State vInSetValueOne: number = 40
@State vInSetValueOne1: number = 40
@State vOutSetValueTwo: number = 40 @State vOutSetValueTwo: number = 40
@State vInSetValueTwo: number = 40 @State vInSetValueTwo: number = 40
@State blockColor: string = "#191970" @State blockColor: string = "#191970"
...@@ -205,7 +206,7 @@ struct SliderExample { ...@@ -205,7 +206,7 @@ struct SliderExample {
Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT') Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT')
Row() { Row() {
Slider({ Slider({
value: this.vInSetValueOne, value: this.vInSetValueOne1,
style: this.style, style: this.style,
direction: this.directionT, direction: this.directionT,
reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true
...@@ -214,7 +215,7 @@ struct SliderExample { ...@@ -214,7 +215,7 @@ struct SliderExample {
step:this.step step:this.step
}).showTips(true) }).showTips(true)
.onChange((value: number, mode: SliderChangeMode) => { .onChange((value: number, mode: SliderChangeMode) => {
this.vInSetValueOne = value this.vInSetValueOne1 = value
console.info('value:' + value + 'm`ode:' + mode.toString()) console.info('value:' + value + 'm`ode:' + mode.toString())
}).key('sliderConstructor') }).key('sliderConstructor')
......
...@@ -103,7 +103,7 @@ struct StepperExample { ...@@ -103,7 +103,7 @@ struct StepperExample {
// 第三个步骤页 // 第三个步骤页
StepperItem() { StepperItem() {
Column() { Column() {
Text('Page Three') Text('Page Three').key('pageThree')
.itemTextStyle() .itemTextStyle()
Button('change status:' + this.thirdState) Button('change status:' + this.thirdState)
.backgroundColor('#007dFF') .backgroundColor('#007dFF')
...@@ -116,7 +116,7 @@ struct StepperExample { ...@@ -116,7 +116,7 @@ struct StepperExample {
// 第四个步骤页 // 第四个步骤页
StepperItem() { StepperItem() {
Column() { Column() {
Text('Page Four') Text('Page Four').key('pageFour')
.itemTextStyle() .itemTextStyle()
}.itemStyle() }.itemStyle()
} }
......
...@@ -61,7 +61,7 @@ export default function GridJsunit() { ...@@ -61,7 +61,7 @@ export default function GridJsunit() {
console.info("[GridJsunit_0100] component obj2 is: " + JSON.stringify(obj2)); console.info("[GridJsunit_0100] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off'); expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off');
expect(obj2.$attrs.scrollBarColor).assertEqual('#FF808080'); expect(obj2.$attrs.scrollBarColor).assertEqual('#FF808080');
expect(obj2.$attrs.scrollBarWidth).assertEqual('20.00px'); expect(obj2.$attrs.scrollBarWidth).assertEqual('20.00vp');
console.info('[GridJsunit_0100] END'); console.info('[GridJsunit_0100] END');
done(); done();
}); });
...@@ -95,7 +95,7 @@ export default function GridJsunit() { ...@@ -95,7 +95,7 @@ export default function GridJsunit() {
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info("[GridJsunit_0200] component obj2 is: " + JSON.stringify(obj2)); console.info("[GridJsunit_0200] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.scrollBarColor).assertEqual('#FF000000'); expect(obj2.$attrs.scrollBarColor).assertEqual('#FF000000');
expect(obj2.$attrs.scrollBarWidth).assertEqual('30.00px'); expect(obj2.$attrs.scrollBarWidth).assertEqual('30.00vp');
console.info('[GridJsunit_0200] END'); console.info('[GridJsunit_0200] END');
done(); done();
}); });
...@@ -123,14 +123,14 @@ export default function GridJsunit() { ...@@ -123,14 +123,14 @@ export default function GridJsunit() {
console.info("[GridJsunit_0300] component obj is: " + JSON.stringify(obj)); console.info("[GridJsunit_0300] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.columnsGap).assertEqual('0.00vp'); expect(obj.$attrs.columnsGap).assertEqual('0.00vp');
expect(obj.$attrs.rowsGap).assertEqual('0.00vp'); expect(obj.$attrs.rowsGap).assertEqual('0.00vp');
expect(obj.$attrs.cachedCount).assertEqual(0); expect(obj.$attrs.cachedCount).assertEqual(1);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('grid2'); let strJson2 = getInspectorByKey('grid2');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info("[GridJsunit_0300] component obj2 is: " + JSON.stringify(obj2)); console.info("[GridJsunit_0300] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off'); expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off');
expect(obj2.$attrs.scrollBarColor).assertEqual('#FF000000'); expect(obj2.$attrs.scrollBarColor).assertEqual('#FF000000');
expect(obj2.$attrs.scrollBarWidth).assertEqual('-10.00px'); expect(obj2.$attrs.scrollBarWidth).assertEqual('4.00vp');
console.info('[GridJsunit_0300] END'); console.info('[GridJsunit_0300] END');
done(); done();
}); });
...@@ -224,10 +224,10 @@ export default function GridJsunit() { ...@@ -224,10 +224,10 @@ export default function GridJsunit() {
globalThis.value.message.notify({name:'rowsTemplate',value:''}) globalThis.value.message.notify({name:'rowsTemplate',value:''})
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let gridItem1 = CommonFunc.getComponentRect('0'); let gridItem1 = CommonFunc.getComponentRect('0');
let bottom = gridItem1.bottom let left1 = gridItem1.left
let gridItem2 = CommonFunc.getComponentRect('4'); let gridItem2 = CommonFunc.getComponentRect('4');
let top = gridItem2.top let left2 = gridItem2.left
expect(bottom).assertEqual(top); expect(left1).assertEqual(left2);
console.info('[GridJsunit_0700] END'); console.info('[GridJsunit_0700] END');
done(); done();
}); });
...@@ -241,10 +241,10 @@ export default function GridJsunit() { ...@@ -241,10 +241,10 @@ export default function GridJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let driver = await UiDriver.create() let driver = await UiDriver.create()
let gridItem1 = CommonFunc.getComponentRect('0'); let gridItem1 = CommonFunc.getComponentRect('0');
let right = gridItem1.right let top1 = gridItem1.top
let gridItem2 = CommonFunc.getComponentRect('4'); let gridItem2 = CommonFunc.getComponentRect('4');
let left = gridItem2.left let top2 = gridItem2.top
expect(right).assertEqual(left); expect(top1).assertEqual(parseInt(top2));
console.info('[GridJsunit_0800] END'); console.info('[GridJsunit_0800] END');
done(); done();
}); });
......
...@@ -267,7 +267,7 @@ export default function TextInputJsunit() { ...@@ -267,7 +267,7 @@ export default function TextInputJsunit() {
console.info("[TextInputJsunit_0500] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[TextInputJsunit_0500] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
expect(obj.$attrs.placeholder).assertEqual(''); expect(obj.$attrs.placeholder).assertEqual('');
expect(obj.$attrs.type).assertEqual('InputType.Normal'); expect(obj.$attrs.type).assertEqual('InputType.Normal');
expect(obj.$attrs.placeholderColor).assertEqual('#FF008000'); expect(obj.$attrs.placeholderColor).assertEqual('#FF000000');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"18.00fp","weight":"500","fontFamily":"sans-serif"}'); expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"18.00fp","weight":"500","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done'); expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF00007B'); expect(obj.$attrs.caretColor).assertEqual('#FF00007B');
......
...@@ -204,7 +204,7 @@ export default function sliderJsunit() { ...@@ -204,7 +204,7 @@ export default function sliderJsunit() {
let strJson1 = getInspectorByKey('modeT'); let strJson1 = getInspectorByKey('modeT');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1)); console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('mode'); expect(obj1.$attrs.content).assertEqual('2');
done(); done();
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册