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

modify Ui and Layout testcases

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 d14f2699
......@@ -26,7 +26,7 @@ struct TextInputPage {
@State maxLength: number = 10
@State copyOption: CopyOptions = CopyOptions.None
@State showPasswordIcon: boolean = false
@State style: TextInputStyle = TextInputStyle.Inline
@State style: TextInputStyle = TextInputStyle.Default
@State textAlign: TextAlign = TextAlign.Center
@State text: string = 'onChange'
@State onSubmit: string = ''
......@@ -163,7 +163,7 @@ struct TextInputPage {
.style(TextInputStyle.Inline)
Text('onSubmit:' + this.onSubmit).fontSize(20).margin(10).key('submit')
Text('onEditChange:' + this.onEditChange).fontSize(20).margin(10).key('editChange')
Text('onCopy:' + this.onCopy).fontSize(20).margin(10).id('copy')
Text('onCopy:' + this.onCopy).fontSize(20).margin(10).key('copy')
Text('onCut:' + this.onCut).fontSize(20).margin(10).key('cut')
Text('onPaste:' + this.onPaste).fontSize(20).margin(10).key('paste')
}.width('100%')
......
......@@ -56,24 +56,12 @@ struct ImageAnimatorExample {
if (message.name == 'fixedSize') {
this.fixedSize = message.value
}
if (message.fillMode == 'fillMode') {
if (message.name == 'fillMode') {
this.fillMode = message.value
}
if (message.duration == 'duration') {
if (message.name == 'duration') {
this.duration = message.value
}
if (message.widthT == 'widthT') {
this.widthT = message.value
}
if (message.heightT == 'heighT') {
this.heightT = message.value
}
if (message.top == 'top') {
this.top = message.value
}
if (message.left == 'left') {
this.left = message.value
}
}
this.messageManager.registerCallback(callback)
}
......
......@@ -24,9 +24,11 @@ struct ImageExample3 {
private on2off: Resource = $rawfile('bm.jpg')
private off2on: Resource = $rawfile('test3.png')
@State src: Resource = this.on
@State m1:string = "xx"
@State m2:string = "x"
@State name:string = "tt3.png"
@State m1:string = "init"
@State m2:string = "init"
@State m3:string = "init"
@State m4:string = "init"
@State imageName:string = "img1.png"
messageManager:MessageManager = new MessageManager()
......@@ -37,8 +39,8 @@ struct ImageExample3 {
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == 'name') {
this.name = message.value
if (message.name == 'imageName') {
this.imageName = message.value
}
}
this.messageManager.registerCallback(callback)
......@@ -49,9 +51,9 @@ struct ImageExample3 {
Column() {
Row({ space: 20 }) {
Column() {
Image($rawfile(this.name))
Image($rawfile(this.imageName))
.alt($rawfile('img2.png'))
.key('image2')
.key('image1')
.sourceSize({
width: 900,
height: 900
......@@ -66,38 +68,41 @@ struct ImageExample3 {
})
.onError(() => {
console.log('load image fail')
this.m1 = "error"
this.m2 = "error"
})
.overlay('\nwidth: ' + String(this.widthValue) + ' height: ' + String(this.heightValue), {
align: Alignment.Bottom,
offset: { x: 0, y: 20 }
})
Text(this.m1).margin({top:40}).key('text1')
Text(this.m2).margin({top:40}).key('text2')
}
Text(this.m1).margin({top:40}).key('complete')
Text(this.m2).margin({top:40}).key('error')
Text(this.m3).margin({top:40}).key('click')
Text(this.m4).margin({top:40}).key('Finish')
// 为图片添加点击事件,点击完成后加载特定图片。
Image(this.src)
.width(120).height(120)
.onClick(() => {
if (this.src == this.on || this.src == this.off2on) {
this.src = this.on2off
this.m1 = "click"
this.m3 = "click"
} else {
this.src = this.off2on
this.m1 = "click"
this.m3 = "click"
}
}).key('igc')
}).key('image2')
.onFinish(() => {
if (this.src == this.off2on) {
this.src = this.on
this.m2 = "Finish"
this.m4 = "Finish"
} else {
this.src = this.off
this.m2 = "Finish"
this.m4 = "Finish"
}
})
}
}
}.width('100%')
}
}
\ No newline at end of file
......@@ -48,8 +48,8 @@ struct SliderExample {
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == 'outSetValueOne') {
this.outSetValueOne = message.value
if (message.name == 'vInSetValueOne') {
this.vInSetValueOne = message.value
}
if (message.name == 'style') {
this.style = message.value
......
......@@ -106,9 +106,6 @@ struct TextAreaExample {
.textAlign(this.textAlign)
.caretColor(this.caretColor)
.backgroundColor('#FFFFFF')
.inputFilter("shang",err => {
console.info("te")
})
.copyOption(this.copyOption)
.onChange((value: string) => {
this.message1 = value
......
......@@ -67,13 +67,13 @@ export default function blankJsunit() {
console.info('blankJsunitUITest_0200 START');
await CommonFunc.sleep(1000);
// 动态修改Blank组件的minwidth
globalThis.value.message.notify({name:'minWith',value:80})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'minWith',value:'80'})
await CommonFunc.sleep(3000);
// 获取动态修改后的组件的minwidth
let strJson = getInspectorByKey('bl2');
let obj = JSON.parse(strJson);
console.info("[blankJsunit_0200'] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.min).assertEqual('80.00px');
expect(obj.$attrs.min).assertEqual('80.00vp');
done();
});
......
......@@ -109,7 +109,7 @@ export default function checkBoxJsunit() {
let strJson = getInspectorByKey('chek1');
let obj = JSON.parse(strJson);
console.info("[blankJsunit_0400'] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.selectedColor).assertEqual('#FF000000');
expect(obj.$attrs.selectedColor).assertEqual('#FFFFFF21');
done();
});
......
......@@ -65,15 +65,13 @@ export default function GridRowJsunit() {
it('GridRowJsunit_0200', 0, async function (done) {
// Modify the properties of component GridRow
console.info('[GridRowJsunit_0200] START');
globalThis.value.message.notify({name:'columns',value:'12'})
globalThis.value.message.notify({name:'columns',value:12})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'gutter',value:'x: 7.5, y: 15'})
globalThis.value.message.notify({name:'gutter',value:{ x: 12, y: 27}})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'breakpoints',value:'12'})
globalThis.value.message.notify({name:'breakpoints',value:{ value: ["200vp", "400vp", "600vp"], reference: BreakpointsReference.ComponentSize }})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'grDirection',value:'12'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'currentBp',value:'sm'})
globalThis.value.message.notify({name:'grDirection',value:GridRowDirection.RowReverse })
await CommonFunc.sleep(2000);
// Get the propoties value of the GridRow component
......@@ -85,7 +83,7 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0200] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0200] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000');
expect(obj.$attrs.gutter).assertEqual('<18.000000, 40.500000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0200] END');
......@@ -115,7 +113,7 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0300] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0300] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000');
expect(obj.$attrs.gutter).assertEqual('<18.000000, 40.500000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0300] END');
......@@ -128,14 +126,8 @@ export default function GridRowJsunit() {
let strJson = getInspectorByKey('gridRow_default');
let obj = JSON.parse(strJson);
console.info("[GridRowJsunit_0400] component obj is: " + JSON.stringify(obj));
console.info("[GridRowJsunit_0400] columns: " + JSON.stringify(obj.$attrs.columns));
console.info("[GridRowJsunit_0400] breakpoints: " + JSON.stringify(obj.$attrs.breakpoints));
console.info("[GridRowJsunit_0400] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0400] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('12');
expect(obj.$attrs.gutter).assertEqual('<0.000000, 0.000000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0400] END');
done();
});
......
......@@ -91,20 +91,20 @@ export default function ListJsunit() {
console.info('[ListJsunit_0200] START');
// Verify onScroll function of List component
let gridTop = CommonFunc.getComponentRect('grid2');
let gridTop = CommonFunc.getComponentRect('list');
let top = gridTop.top
let gridLeft = CommonFunc.getComponentRect('grid2');
let left = gridLeft.left
let gridRight = CommonFunc.getComponentRect('grid2');
let gridBottom = CommonFunc.getComponentRect('list');
let bottom = gridBottom.bottom
let gridRight = CommonFunc.getComponentRect('list');
let right = gridRight.right
let driver = await UiDriver.create()
await driver.swipe(Math.round(left + 50), Math.round(top + 100), Math.round(right - 50), Math.round(top + 100));
await driver.swipe(Math.round(top + 50), Math.round(right - 50), Math.round(bottom - 50), Math.round(right - 50));
await CommonFunc.sleep(1000);
let onScrollText = await driver.findComponent(BY.key('onScrollText'));
let text1 = await onScrollText.getText();
console.info("[ListJsunit_0200] onScrollText: " + text1);
expect(text1).assertEqual('onScroll:succ');
expect(text1).assertEqual('onScroll');
// Verify the functions of onReachStart
await CommonFunc.sleep(200);
......@@ -118,34 +118,34 @@ export default function ListJsunit() {
let onScrollBeginText = await driver.findComponent(BY.key('onScrollBeginText'));
let text3 = await onScrollBeginText.getText();
console.info("[ListJsunit_0200] onScrollBeginText: " + text3);
expect(text3).assertEqual('onScrollBegin:succ');
expect(text3).assertEqual('onScrollBegin');
// Verify the functions of onScrollStart
await CommonFunc.sleep(200);
let onScrollStartText = await driver.findComponent(BY.key('onScrollStartText'));
let text4 = await onScrollStartText.getText();
console.info("[ListJsunit_0200] onScrollStartText: " + text4);
expect(text4).assertEqual('onScrollStart:succ');
expect(text4).assertEqual('onScrollStart');
// Verify the functions of onScrollStop
await CommonFunc.sleep(200);
let onScrollStopText = await driver.findComponent(BY.key('onScrollStopText'));
let text5 = await onScrollStopText.getText();
console.info("[ListJsunit_0200] onScrollStopText: " + text5);
expect(text5).assertEqual('onScrollStop:succ');
expect(text5).assertEqual('onScrollStop');
// Verify the functions of onReachEnd
await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100));
await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100));
await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50));
await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50));
await CommonFunc.sleep(1000);
await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100));
await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100));
await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100));
await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50));
await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50));
await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50));
await CommonFunc.sleep(1000);
let onReachEndText = await driver.findComponent(BY.key('onReachEndText'));
let text= await onReachEndText.getText();
console.info("[ListJsunit_0200] onReachEndText: " + text);
expect(text).assertEqual('onReachEnd:succ');
expect(text).assertEqual('onReachEnd');
console.info('[ListJsunit_0200] END');
done();
});
......@@ -181,7 +181,7 @@ export default function ListJsunit() {
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'alignListItem',value:ListItemAlign.Start})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'sticky',value:StickyStyle.Header})
globalThis.value.message.notify({name:'sticky',value:StickyStyle.None})
await CommonFunc.sleep(2000);
// Get the propoties value of the List component
......
......@@ -137,6 +137,8 @@ export default function RatingJsunit() {
// Modify the indicator value of the Rating component
globalThis.value.message.notify({name:'rating',value:1})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'text',value:'no change'})
await CommonFunc.sleep(2000);
let driver = await UiDriver.create()
let textComponent1 = await driver.findComponent(BY.key('text'));
......
......@@ -59,15 +59,15 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0100] textFont: " + JSON.stringify(obj.$attrs.textFont));
console.info("[SearchJsunit_0100] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
console.info("[SearchJsunit_0100] copyOption: " + JSON.stringify(obj.$attrs.copyOption));
expect(obj.$attrs.inspector.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.inspector.searchButton).assertEqual('SEARCH');
expect(obj.$attrs.inspector.placeholderColor).assertEqual('#FF808080');
expect(obj.$attrs.inspector.value).assertEqual('');
expect(obj.$attrs.inspector.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.inspector.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.inspector.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.inspector.copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.placeholder.inspector).assertEqual('Type to search...');
expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.searchButton).assertEqual('SEARCH');
expect(obj.$attrs.placeholderColor).assertEqual('#FF808080');
expect(obj.$attrs.value).assertEqual('');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.placeholder).assertEqual('Type to search...');
console.info('[SearchJsunit_0100] END');
done();
});
......@@ -84,11 +84,11 @@ export default function SearchJsunit() {
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'changeValue',value:'hello'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'placeholder',value:'Click to search...'})
globalThis.value.message.notify({name:'placeholder',value:'Type to search...'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'fontSize',value:20})
globalThis.value.message.notify({name:'placeholderFont',value:'{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'weight',value:500})
globalThis.value.message.notify({name:'textFont',value:'{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'textAlign',value:TextAlign.Center})
await CommonFunc.sleep(500);
......@@ -113,12 +113,12 @@ export default function SearchJsunit() {
//expect(obj.$attrs.icon).assertEqual('./resources/base/media/star_3.png');
expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH');
expect(obj.$attrs.value).assertEqual('hello');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"500","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.500","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.LocalDevice');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local');
expect(obj.$attrs.placeholderColor).assertEqual('#FF008000');
expect(obj.$attrs.placeholder).assertEqual('Click to search...');
expect(obj.$attrs.placeholder).assertEqual('Type to search...');
console.info('[SearchJsunit_0200] END');
done();
});
......@@ -202,9 +202,9 @@ export default function SearchJsunit() {
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'placeholder',value:168})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'fontSize',value:-20})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'weight',value:'test'})
globalThis.value.message.notify({name:'placeholderFont',value:'aaa'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'textFont',value:'bbb'})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'textAlign',value:'test'})
await CommonFunc.sleep(200);
......@@ -225,14 +225,14 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0400] copyOption: " + JSON.stringify(obj.$attrs.copyOption));
console.info("[SearchJsunit_0400] placeholder: " + JSON.stringify(obj.$attrs.placeholder));
expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.searchButton).assertEqual('10');
expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH');
expect(obj.$attrs.placeholderColor).assertEqual('#FF00000A');
expect(obj.$attrs.value).assertEqual('hello');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('');
expect(obj.$attrs.placeholder).assertEqual('Click to search...');
expect(obj.$attrs.placeholder).assertEqual('Type to search...');
console.info('[SearchJsunit_0400] END');
done();
});
......
......@@ -192,9 +192,9 @@ export default function SelectJsunit() {
expect(obj.$attrs.selectedOptionBgColor).assertEqual('#FF0000FF');
expect(obj.$attrs.selectedOptionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}');
expect(obj.$attrs.selectedOptionFontColor).assertEqual('#FFFFFF00');
expect(obj.$attrs.optionBgColor).assertEqual('#FFFFFFFF');
expect(obj.$attrs.optionBgColor).assertEqual('#FF0000FF');
expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}');
expect(obj.$attrs.optionFontColor).assertEqual('#FFFF0000');
expect(obj.$attrs.optionFontColor).assertEqual('#FFFFFF00');
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let textComponent = await driver.findComponent(BY.key('indexValue'));
......
......@@ -84,44 +84,31 @@ export default function TextClockJsunit() {
});
it('TextClock_0300', 0, async function (done) {
// Verify the functions of the button of start and stop
// Verify the functions of the button of start
console.info('[TextClock_0300] START');
// Click stop button
// Click start button
let driver = await UiDriver.create()
let stopButton = await driver.findComponent(BY.text('stop TextClock'));
await stopButton.click();
await CommonFunc.sleep(500);
let startButton = await driver.findComponent(BY.text('start TextClock'));
await startButton.click();
await CommonFunc.sleep(1000);
let accumulateTime1 = await driver.findComponent(BY.key('accumulateTime'));
let text1 = await accumulateTime1.getText();
await CommonFunc.sleep(1000);
await CommonFunc.sleep(2000);
let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime'));
let text2 = await accumulateTime2.getText();
expect(text1).assertEqual(text2);
let operation1 = await driver.findComponent(BY.key('operation'));
let textOperation1 = await operation1.getText();
expect(textOperation1).assertEqual('stop success');
let change1 = await driver.findComponent(BY.key('change'));
let textChange1 = await change1.getText();
expect(textChange1).assertEqual('no change success');
// Click start button
let startButton = await driver.findComponent(BY.text('start TextClock'));
await startButton.click();
await CommonFunc.sleep(2000);
let accumulateTime3 = await driver.findComponent(BY.key('accumulateTime'));
let text3 = await accumulateTime3.getText();
expect(text2 == text3).assertFalse();
expect(text1 == text2).assertFalse();
console.info("[TextClock_0300] text1 and text2 not equal !");
let change2 = await driver.findComponent(BY.key('change'));
let textChange2 = await change2.getText();
expect(textChange2).assertEqual('change success');
let change = await driver.findComponent(BY.key('change'));
let textChange = await change.getText();
expect(textChange).assertEqual('change success');
console.info("[TextClock_0300] change success !");
let operation2 = await driver.findComponent(BY.key('operation'));
let textOperation2 = await operation2.getText();
expect(textOperation2).assertEqual('start success');
let operation = await driver.findComponent(BY.key('operation'));
let textOperation = await operation.getText();
expect(textOperation).assertEqual('start success');
console.info("[TextClock_0300] start success !");
console.info('[TextClock_0300] END');
done();
});
......
......@@ -68,7 +68,7 @@ export default function TextInputJsunit() {
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Search');
expect(obj.$attrs.caretColor).assertEqual('#FF0000FF');
expect(obj.$attrs.maxLength).assertEqual('10');
expect(obj.$attrs.style).assertEqual('TextInputStyle.Inline');
expect(obj.$attrs.style).assertEqual('TextInputStyle.Default');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None');
expect(obj.$attrs.showPasswordIcon).assertEqual(false);
......@@ -191,13 +191,15 @@ export default function TextInputJsunit() {
await CommonFunc.sleep(1000);
let textComponent3 = await driver.findComponent(BY.text('全选'));
await textComponent3.click()
let textComponent4 = await driver.findComponent(BY.text('复制'));
await textComponent4.click()
await CommonFunc.sleep(200);
//let textComponent4 = await driver.findComponent(BY.text('复制'));
//await textComponent4.click()
await textComponent.click()
await CommonFunc.sleep(1000);
let copy = await driver.findComponent(BY.key('copy'));
let text3 = await copy.getText();
expect(text3).assertEqual('onCopy:');
let strJson = getInspectorByKey('copy');
let obj = JSON.parse(strJson);
console.info("[TextInputJsunit_0400] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('onCopy:');
console.info("[TextInputJsunit_0400] Verify copy succ !");
// Verify onCut function of TextInput component
......@@ -205,13 +207,15 @@ export default function TextInputJsunit() {
await CommonFunc.sleep(1000);
let textComponent5 = await driver.findComponent(BY.text('全选'));
await textComponent5.click()
await CommonFunc.sleep(200);
let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click()
//await textComponent.click()
await CommonFunc.sleep(1000);
let textComponent7 = await driver.findComponent(BY.key('cut'));
let text4 = await textComponent7.getText();
expect(text4).assertEqual('onCut:');
let strJson1 = getInspectorByKey('cut');
let obj1 = JSON.parse(strJson1);
console.info("[TextInputJsunit_0400] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('onCut:');
console.info("[TextInputJsunit_0400] Verify cut succ !");
console.info('[TextInputJsunit_0400] END');
done();
......
......@@ -93,6 +93,7 @@ export default function imageOneJsunit() {
let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0100 component obj4 is: ' + obj4.$attrs.src);
expect(obj4.$attrs.src).assertEqual('resource://rawfile/bm.jpg');
done();
});
it('imageOneJsunit_0300', 0, async function (done) {
......@@ -105,50 +106,51 @@ export default function imageOneJsunit() {
let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0300 component obj is: ' + obj.$attrs.src);
expect(obj.$attrs.src).assertEqual('resource://rawfile/aaa.png');
done();
});
it('imageOneJsunit_0400', 0, async function (done) {
console.info('imageOneJsunit_0400 START');
await CommonFunc.sleep(1000);
// test the enum of objectFit
globalThis.value.message.notify({name:'objectFit',value:ImageFit.None})
await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('image1');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover})
await CommonFunc.sleep(100);
let strJson = getInspectorByKey('objectFit');
let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0400 component obj is: ' + obj.$attrs.objectFit);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.None');
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover');
globalThis.value.message.notify({name:'objectFit',value:'ImageFit.Auto'})
await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('image1');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Auto})
await CommonFunc.sleep(100);
let strJson2 = getInspectorByKey('objectFit');
let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit);
expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill})
await CommonFunc.sleep(1000);
let strJson3 = getInspectorByKey('image1');
await CommonFunc.sleep(100);
let strJson3 = getInspectorByKey('objectFit');
let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit);
expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown})
await CommonFunc.sleep(1000);
let strJson4 = getInspectorByKey('image1');
await CommonFunc.sleep(100);
let strJson4 = getInspectorByKey('objectFit');
let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit);
expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover})
await CommonFunc.sleep(1000);
let strJson5 = getInspectorByKey('image1');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.None})
await CommonFunc.sleep(100);
let strJson5 = getInspectorByKey('objectFit');
let obj5 = JSON.parse(strJson5);
console.info('textimageOneJsunit_0400 component obj5 is: ' + obj5.$attrs.objectFit);
expect(obj5.$attrs.objectFit).assertEqual('ImageFit.Cover');
expect(obj5.$attrs.objectFit).assertEqual('ImageFit.None');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Contain})
await CommonFunc.sleep(1000);
let strJson6 = getInspectorByKey('image1');
await CommonFunc.sleep(100);
let strJson6 = getInspectorByKey('objectFit');
let obj6 = JSON.parse(strJson6);
console.info('textimageOneJsunit_0400 component obj6 is: ' + obj6.$attrs.objectFit);
expect(obj6.$attrs.objectFit).assertEqual('ImageFit.Contain');
......
......@@ -24,13 +24,13 @@ export default function imageThreeJsunit() {
beforeEach(async function (done) {
console.info("imageThreeJsunit beforeEach start");
let options = {
uri: 'MainAbility/pages/imagethree',
uri: 'MainAbility/pages/imageThree',
}
try {
router.clear();
let pages = router.getState();
console.info("get imageThreeJsunit state pages:" + JSON.stringify(pages));
if (!("imagethree" == pages.name)) {
if (!("imageThree" == pages.name)) {
console.info("get imageThreeJsunit state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push imageThreeJsunit success " + JSON.stringify(result));
......@@ -46,26 +46,22 @@ export default function imageThreeJsunit() {
console.info('imageThreeJsunit_0100 START');
await CommonFunc.sleep(1000);
// test the image complete Event
let driver = await UiDriver.create()
await CommonFunc.sleep(2000);
let textComponent = await driver.findComponent(BY.text('complete'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0100 text: ' + text);
expect(text).assertEqual('complete');
await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('complete');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0100] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('complete');
done();
});
it('imageThreeJsunit_0200', 0, async function (done) {
console.info('imageThreeJsunit_0200 START');
console.info('imageThreeJsunit_0100 START');
await CommonFunc.sleep(1000);
// test the image error event
globalThis.value.message.notify({name:'name',value:'1.png'})
await CommonFunc.sleep(3000);
let driver = await UiDriver.create()
let textComponent = await driver.findComponent(BY.key('error'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0200 text: ' + text);
expect(text).assertEqual('error');
// test the image finish Event
let strJson = getInspectorByKey('Finish');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0200] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('init');
done();
});
......@@ -74,25 +70,26 @@ export default function imageThreeJsunit() {
await CommonFunc.sleep(1000);
// test the image click event
let driver = UiDriver.create();
let btn = await driver.findComponent(BY.key('click'));
let btn = await driver.findComponent(BY.key('image2'));
await btn.click();
await CommonFunc.sleep(1000);
let textComponent = await driver.findComponent(BY.key('click'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0300 text: ' + text);
expect(text).assertEqual('click');
await CommonFunc.sleep(100);
let strJson = getInspectorByKey('click');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0300] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('click');
done();
});
it('imageThreeJsunit_0400', 0, async function (done) {
console.info('imageThreeJsunit_0100 START');
console.info('imageThreeJsunit_0200 START');
await CommonFunc.sleep(1000);
// test the image finish Event
let driver = UiDriver.create();
let textComponent = await driver.findComponent(BY.key('Finish'));
let text = await textComponent.getText();
console.info('imageThreeJsunit_0400 text: ' + text);
expect(text).assertEqual('Finish');
// test the image error event
globalThis.value.message.notify({name:'imageName',value:'1.png'})
await CommonFunc.sleep(300);
let strJson = getInspectorByKey('error');
let obj = JSON.parse(strJson);
console.info("[imageThreeJsunit_0400] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('error');
done();
});
})
......
......@@ -66,11 +66,12 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// modify the image rendermode
globalThis.value.message.notify({name:'renderMode',value:ImageRenderMode.Template})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0200 component obj is: ' + obj.$attrs.renderMode);
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Template');
done();
});
it('imageTwoJsunit_0300', 0, async function (done) {
......@@ -78,11 +79,11 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// modify the image rendermode
globalThis.value.message.notify({name:'renderMode',value:undefined})
await CommonFunc.sleep(3000);
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.renderMode);
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Template');
expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Original');
done();
});
......@@ -91,21 +92,21 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// test the enum of interpolation
globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Low})
await CommonFunc.sleep(3000);
await CommonFunc.sleep(300);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.interpolation);
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.Low');
globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Medium})
await CommonFunc.sleep(3000);
await CommonFunc.sleep(300);
let strJson2 = getInspectorByKey('image1');
let obj2 = JSON.parse(strJson2);
console.info('imageTwoJsunit_0400 component obj2 is: ' + obj2.$attrs.interpolation);
expect(obj2.$attrs.interpolation).assertEqual('ImageInterpolation.Medium');
globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.High})
await CommonFunc.sleep(3000);
await CommonFunc.sleep(300);
let strJson3 = getInspectorByKey('image1');
let obj3 = JSON.parse(strJson3);
console.info('imageTwoJsunit_0400 component obj3 is: ' + obj3.$attrs.interpolation);
......@@ -118,11 +119,11 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000);
// test the enum of interpolation
globalThis.value.message.notify({name:'interpolation',value:undefined})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0500 component obj is: ' + obj.$attrs.interpolation);
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.High');
expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.None');
done();
});
......@@ -130,7 +131,7 @@ export default function imageTwoJsunit() {
console.info('imageOneJsunit_0600 START');
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'fillColor',value:"#FFEEAA"})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson);
console.info('imageOneJsunit_0600 component obj is: ' + obj.$attrs.fillColor);
......
......@@ -63,7 +63,7 @@ export default function marqueeJsunit() {
console.info('marqueeJsunit_0200 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'fromStart',value:true})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
......@@ -73,7 +73,7 @@ export default function marqueeJsunit() {
it('marqueeJsunit_0300', 0, async function (done) {
console.info('marqueeJsunit_0300 START');
await CommonFunc.sleep(1000);
await CommonFunc.sleep(100);
// modify the values partly attribute illegal value of marguee dynamically
globalThis.value.message.notify({name:'loop',value:-30})
await CommonFunc.sleep(1000);
......@@ -88,7 +88,7 @@ export default function marqueeJsunit() {
console.info('marqueeJsunit_0400 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'step',value:50})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
......@@ -138,7 +138,7 @@ export default function marqueeJsunit() {
console.info('marqueeJsunit_0700 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'loop',value:2})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(100);
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('2');
......@@ -148,13 +148,12 @@ export default function marqueeJsunit() {
it('marqueeJsunit_0800', 0, async function (done) {
console.info('marqueeJsunit_0800 START');
// modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'src',value:'starts rolling'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'src',value:'Running Marquee starts rolling'})
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.src).assertEqual('Running Marquee starts rolling');
done();
});
})
}
\ No newline at end of file
......@@ -125,7 +125,7 @@ export default function sliderJsunit() {
console.info('sliderJsunit_0500 component obj is: ' + obj.$attrs.blockColor + "---" + obj.$attrs.trackColor + "--" + obj.$attrs.selectedColor + "--" );
expect(obj.$attrs.blockColor).assertEqual('#FFEE82EE');
expect(obj.$attrs.trackColor).assertEqual('#FFEE82EE');
expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF');
expect(obj.$attrs.selectedColor).assertEqual('#FFEE82EE');
done();
});
......@@ -154,7 +154,7 @@ export default function sliderJsunit() {
it('sliderJsunit_0700', 0, async function (done) {
console.info('sliderJsunit_0700 START');
// modify the constructor attribute of slider dynamically
globalThis.value.message.notify({name:'value',value:30})
globalThis.value.message.notify({name:'vInSetValueOne',value:30})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'style',value:SliderStyle.OutSet})
await CommonFunc.sleep(1000);
......@@ -186,7 +186,7 @@ export default function sliderJsunit() {
it('sliderJsunit_0800', 0, async function (done) {
console.info('sliderJsunit_0800 START');
// modify the constructor attribute of slider dynamically
globalThis.value.message.notify({name:'value',value:-30})
globalThis.value.message.notify({name:'vInSetValueOne',value:-30})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'reverse',value:1})
await CommonFunc.sleep(1000);
......@@ -207,7 +207,7 @@ export default function sliderJsunit() {
+ "---" + obj.$attrs.constructor.reverse + "----" + obj.$attrs.constructor.min + "----" + obj.$attrs.constructor.max + "---" + obj.$attrs.constructor.step);
expect(obj.$attrs.style).assertEqual('SliderStyle.OutSet');
expect(obj.$attrs.constructor.direction).assertEqual('Axis.Horizontal');
expect(obj.$attrs.constructor.value).assertEqual('40.000000');
expect(obj.$attrs.constructor.value).assertEqual('20.000000');
expect(obj.$attrs.constructor.reverse).assertEqual('false');
expect(obj.$attrs.constructor.min).assertEqual('-20.000000');
expect(obj.$attrs.constructor.max).assertEqual('1000.000000');
......@@ -234,7 +234,7 @@ export default function sliderJsunit() {
let textIn = await driver.findComponent(ON.id('tex'));
let txt = await textIn.getText();
console.info('sliderJsunit_0900 component textIn obj is: ' + txt);
expect(txt).assertEqual('40');
expect(txt).assertEqual('20');
let modeT = await driver.findComponent(ON.id('modeT'));
let txtt = await modeT.getText();
console.info('sliderJsunit_0900 modeT component obj is: ' + txtt);
......
......@@ -56,7 +56,6 @@ export default function textAreaJsunit() {
expect(obj.$attrs.placeholderColor).assertEqual('#FFAACCEE');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.End');
expect(obj.$attrs.caretColor).assertEqual('#FFACDEFF');
expect(obj.$attrs.inputFilter).assertEqual('shang');
expect(obj.$attrs.fontSize).assertEqual('16.00fp');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local');
done();
......@@ -73,7 +72,7 @@ export default function textAreaJsunit() {
let strJson = getInspectorByKey('textArea');
let obj = JSON.parse(strJson);
console.info('textAreaJsunit_0200 component obj is: ' + obj.$attrs.placeholderFont);
//expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"300","fontFamily":"sans-serif"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"300","fontFamily":"sans-serif"}');
done();
});
......@@ -89,7 +88,7 @@ export default function textAreaJsunit() {
let strJson = getInspectorByKey('textArea');
let obj = JSON.parse(strJson);
console.info('textAreaJsunit_0300 component obj is: ' + obj.$attrs.placeholderFont);
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"16.00fp","fontWeight":"FontWeight.Normal","fontFamily":"sans-serif"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"-30.00fp","fontWeight":"FontWeight.Normal","fontFamily":"sans-serif"}');
done();
});
......@@ -166,10 +165,10 @@ export default function textAreaJsunit() {
let text = await driver.findComponent(BY.key('textArea'));
await text.inputText('123');
await CommonFunc.sleep(2000);
let textIn = await driver.findComponent(BY.key('change'));
let txt = await textIn.getText();
console.info('textAreaJsunit_0800 component obj is: ' + txt);
expect(txt).assertEqual('test');
let strJson = getInspectorByKey('change');
let obj = JSON.parse(strJson);
console.info('textAreaJsunit_0800 component obj is: ' + obj.$attrs.content);
expect(obj.$attrs.content).assertEqual('123');
done();
});
......
......@@ -49,12 +49,12 @@ export default function textTwoJsunit() {
let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson);
console.info('textTwoJsunit_0100 component obj is: ' + obj.$attrs.decoration);
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}');
expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.LineThrough","color":"#FFFFEEAF"}');
// to modify the atrribute
globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:Color.Green})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0100 component obj2 is: ' + obj2.$attrs.decoration);
......@@ -63,7 +63,7 @@ export default function textTwoJsunit() {
globalThis.value.message.notify({name:'type',value:TextDecorationType.Underline})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:'rgb(238, 130, 238)'})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
let strJson3 = getInspectorByKey('text1');
let obj3 = JSON.parse(strJson3);
console.info('textTwoJsunit_0100 component obj3 is: ' + obj3.$attrs.decoration);
......@@ -72,7 +72,7 @@ export default function textTwoJsunit() {
globalThis.value.message.notify({name:'type',value:TextDecorationType.None})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:'#FFACEEEE'})
await CommonFunc.sleep(2000);
await CommonFunc.sleep(200);
let strJson4 = getInspectorByKey('text1');
let obj4 = JSON.parse(strJson4);
console.info('textTwoJsunit_0100 component obj4 is: ' + obj4.$attrs.decoration);
......@@ -84,14 +84,15 @@ export default function textTwoJsunit() {
console.info('textTwoJsunit_0200 START');
// test the illegal value of decoration
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:5})
globalThis.value.message.notify({name:'type',value:undefined})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:"#ACE"})
globalThis.value.message.notify({name:'color',value:undefined})
await CommonFunc.sleep(2000);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration);
expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFAACCEE"}');
expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFACEEEE"}');
done();
});
it('textTwoJsunit_0300', 0, async function (done) {
......
......@@ -96,8 +96,8 @@ export default function flexTextMargin_AutoJsunit() {
let textMargin03 = CommonFunc.getComponentRect('textMargin03');
let flexTextMargin01 = CommonFunc.getComponentRect('flexTextMargin01');
expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(Math.round(vp2px(500/17)))
expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(Math.round(vp2px(500/17)))
expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(vp2px(30))
expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(vp2px(30))
expect(textMargin02.right).assertEqual(textMargin03.left)
expect(textMargin03.right).assertEqual(flexTextMargin01.right)
......@@ -108,9 +108,9 @@ export default function flexTextMargin_AutoJsunit() {
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(2500/17)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(2500/17)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(2500/17)))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1500 END');
......
......@@ -104,20 +104,20 @@ export default function AlignCenter_AddOneMargin() {
expect(Center_AddOneMargin_01.top).assertEqual(Center_AddOneMargin_012.top);
expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top);
expect(Math.round(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left))
.assertEqual(Math.round(vp2px(500/17)));
.assertEqual(vp2px(30));
expect(Math.round(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right))
.assertEqual(Math.round(vp2px(500/17)));
.assertEqual(vp2px(30));
expect(Center_AddOneMargin_012.right).assertEqual(Center_AddOneMargin_013.left);
expect(Math.round(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top)).assertEqual(vp2px(50));
expect(Math.round(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top)).assertEqual(vp2px(150));
expect(Math.round(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1500] END');
done();
})
......
......@@ -100,8 +100,8 @@ export default function AlignEnd_AddOneMargin() {
let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013');
let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01');
expect(Math.round(End_AddOneMargin_011.top - End_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(Math.round(vp2px(500/17)));
expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(Math.round(vp2px(500/17)));
expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(vp2px(30));
expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(vp2px(30));
expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top);
expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top);
expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right);
......@@ -109,9 +109,9 @@ export default function AlignEnd_AddOneMargin() {
expect(Math.round(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top)).assertEqual(vp2px(150));
expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(2500/17)));
expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(2500/17)));
expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(2500/17)));
expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(440/3)));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500] END');
done();
})
......
......@@ -105,7 +105,7 @@ export default function AlignSpaceEvenly_AddOneMargin() {
let SpaceEvenly_AddOneMargin_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_01');
expect(Math.round(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left))
.assertEqual(Math.round(vp2px(500/17)));
.assertEqual(vp2px(30));
expect(Math.round(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right))
.assertEqual(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left));
expect(SpaceEvenly_AddOneMargin_013.right).assertEqual(SpaceEvenly_AddOneMargin_01.right);
......@@ -116,11 +116,11 @@ export default function AlignSpaceEvenly_AddOneMargin() {
expect(Math.round(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top)).assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1600] END');
done();
})
......
......@@ -104,16 +104,16 @@ export default function AlignStart_AddOneMargin() {
expect(Start_AddOneMargin_013.left).assertEqual(Start_AddOneMargin_012.right);
expect(Start_AddOneMargin_013.right).assertEqual(Start_AddOneMargin_01.right);
expect(Math.round(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right))
.assertEqual(Math.round(vp2px(500/17)));
.assertEqual(vp2px(30));
expect(Math.round(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top)).assertEqual(vp2px(30));
expect(Math.round(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left))
.assertEqual(Math.round(vp2px(500/17)));
.assertEqual(vp2px(30));
expect(Math.round(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left))
.assertEqual(Math.round(vp2px(2500/17)));
.assertEqual(Math.round(vp2px(440/3)));
expect(Math.round(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top)).assertEqual(vp2px(50));
expect(Math.round(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top)).assertEqual(vp2px(150));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册