未验证 提交 f8631e14 编写于 作者: O openharmony_ci 提交者: Gitee

!8733 适配Three和UI测试套测试用例

Merge pull request !8733 from 王旭鹏/master
......@@ -41,7 +41,7 @@ struct ShapeExample {
this.strokeLineJoin = eventData.data.strokeLineJoin;
}
if (eventData.data.strokeMiterLimit != null) {
this.strokeMiterLimit = parseInt(eventData.data.strokeMiterLimit);
this.strokeMiterLimit = eventData.data.strokeMiterLimit;
}
if (eventData.data.strokeOpacity != null) {
this.strokeOpacity = parseInt(eventData.data.strokeOpacity);
......
......@@ -400,7 +400,59 @@ export default function shapeJsunit() {
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
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();
});
......@@ -410,7 +462,7 @@ export default function shapeJsunit() {
try {
var eventData = {
data: {
"strokeMiterLimit": 'aaa11111',
"strokeMiterLimit": '11111',
}
}
var innerEvent = {
......@@ -426,7 +478,7 @@ export default function shapeJsunit() {
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
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();
});
......@@ -478,7 +530,7 @@ export default function shapeJsunit() {
var strJson = getInspectorByKey('shape');
var obj = JSON.parse(strJson);
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();
});
......
......@@ -29,6 +29,7 @@ struct SliderExample {
@State inSetValueTwo: number = 40
@State vOutSetValueOne: number = 40
@State vInSetValueOne: number = 40
@State vInSetValueOne1: number = 40
@State vOutSetValueTwo: number = 40
@State vInSetValueTwo: number = 40
@State blockColor: string = "#191970"
......@@ -205,7 +206,7 @@ struct SliderExample {
Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT')
Row() {
Slider({
value: this.vInSetValueOne,
value: this.vInSetValueOne1,
style: this.style,
direction: this.directionT,
reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true
......@@ -214,7 +215,7 @@ struct SliderExample {
step:this.step
}).showTips(true)
.onChange((value: number, mode: SliderChangeMode) => {
this.vInSetValueOne = value
this.vInSetValueOne1 = value
console.info('value:' + value + 'm`ode:' + mode.toString())
}).key('sliderConstructor')
......
......@@ -103,7 +103,7 @@ struct StepperExample {
// 第三个步骤页
StepperItem() {
Column() {
Text('Page Three')
Text('Page Three').key('pageThree')
.itemTextStyle()
Button('change status:' + this.thirdState)
.backgroundColor('#007dFF')
......@@ -116,7 +116,7 @@ struct StepperExample {
// 第四个步骤页
StepperItem() {
Column() {
Text('Page Four')
Text('Page Four').key('pageFour')
.itemTextStyle()
}.itemStyle()
}
......
......@@ -61,7 +61,7 @@ export default function GridJsunit() {
console.info("[GridJsunit_0100] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off');
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');
done();
});
......@@ -95,7 +95,7 @@ export default function GridJsunit() {
let obj2 = JSON.parse(strJson2);
console.info("[GridJsunit_0200] component obj2 is: " + JSON.stringify(obj2));
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');
done();
});
......@@ -123,14 +123,14 @@ export default function GridJsunit() {
console.info("[GridJsunit_0300] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.columnsGap).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);
let strJson2 = getInspectorByKey('grid2');
let obj2 = JSON.parse(strJson2);
console.info("[GridJsunit_0300] component obj2 is: " + JSON.stringify(obj2));
expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off');
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');
done();
});
......@@ -224,10 +224,10 @@ export default function GridJsunit() {
globalThis.value.message.notify({name:'rowsTemplate',value:''})
await CommonFunc.sleep(1000);
let gridItem1 = CommonFunc.getComponentRect('0');
let bottom = gridItem1.bottom
let left1 = gridItem1.left
let gridItem2 = CommonFunc.getComponentRect('4');
let top = gridItem2.top
expect(bottom).assertEqual(top);
let left2 = gridItem2.left
expect(left1).assertEqual(left2);
console.info('[GridJsunit_0700] END');
done();
});
......@@ -241,10 +241,10 @@ export default function GridJsunit() {
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let gridItem1 = CommonFunc.getComponentRect('0');
let right = gridItem1.right
let top1 = gridItem1.top
let gridItem2 = CommonFunc.getComponentRect('4');
let left = gridItem2.left
expect(right).assertEqual(left);
let top2 = gridItem2.top
expect(top1).assertEqual(parseInt(top2));
console.info('[GridJsunit_0800] END');
done();
});
......
......@@ -267,7 +267,7 @@ export default function TextInputJsunit() {
console.info("[TextInputJsunit_0500] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
expect(obj.$attrs.placeholder).assertEqual('');
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.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF00007B');
......
......@@ -204,7 +204,7 @@ export default function sliderJsunit() {
let strJson1 = getInspectorByKey('modeT');
let obj1 = JSON.parse(strJson1);
console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('mode');
expect(obj1.$attrs.content).assertEqual('2');
done();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册