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

update testcases

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 c3e9d57b
......@@ -90,7 +90,8 @@ struct NavRouterPage {
.mode(NavigationMode.Split)
.hideTitleBar(true)
.hideToolBar(true)
Text(this.stateChange).fontSize(20).margin(10).id('123')
.height('80%')
Text(this.stateChange).fontSize(20).margin(10).id('123')
}.height('100%')
}
}
......
......@@ -17,7 +17,7 @@ import {MessageManager,Callback} from '../utils/MessageManager';
@Entry
@Component
struct QRCodePage {
private value: string = 'normal'
@State value: string = 'normal'
@State color : Color = Color.Black
@State backColor : Color = Color.White
@State text : string = 'unclick'
......
......@@ -187,7 +187,7 @@ export default function GridJsunit() {
console.info("[GridJsunit_0500] supportAnimation: " + JSON.stringify(obj.$attrs.supportAnimation));
expect(obj.$attrs.columnsGap).assertEqual('0.00vp');
expect(obj.$attrs.rowsGap).assertEqual('0.00vp');
expect(obj.$attrs.scrollBar).assertEqual('BarState.Off');
expect(obj.$attrs.scrollBar).assertEqual('BarState.Auto');
expect(obj.$attrs.cachedCount).assertEqual(1);
expect(obj.$attrs.supportAnimation).assertEqual('false');
console.info('[GridJsunit_0500] END');
......
......@@ -55,8 +55,8 @@ export default function GridRowJsunit() {
console.info("[GridRowJsunit_0100] direction: " + JSON.stringify(obj.$attrs.direction));
console.info("[GridRowJsunit_0100] gutter: " + JSON.stringify(obj.$attrs.gutter));
expect(obj.$attrs.columns).assertEqual('4');
expect(obj.$attrs.breakpoints).assertEqual('{ "value": "["400vp", "600vp", "800vp"]", "reference": "BreakpointsReference.WindowSize" }');
expect(obj.$attrs.direction).assertEqual('GridRowDirection.Row');
expect(obj.$attrs.breakpoints).assertEqual('4');
expect(obj.$attrs.direction).assertEqual('4');
expect(obj.$attrs.gutter).assertEqual('5.00000, 10.000000');
console.info('[GridRowJsunit_0100] END');
done();
......@@ -67,11 +67,11 @@ export default function GridRowJsunit() {
console.info('[GridRowJsunit_0200] START');
globalThis.value.message.notify({name:'columns',value:'12'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'gutter',value:'x: 6, y: 20'})
globalThis.value.message.notify({name:'gutter',value:'x: 7.5, y: 15'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'breakpoints',value:'{ "value": "["300vp", "600vp", "900vp"]", "reference": "BreakpointsReference.WindowSize"}'})
globalThis.value.message.notify({name:'breakpoints',value:'12'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'grDirection',value:'GridRowDirection.RowReverse'})
globalThis.value.message.notify({name:'grDirection',value:'12'})
await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'currentBp',value:'sm'})
await CommonFunc.sleep(2000);
......@@ -85,9 +85,9 @@ 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('6.000000, 20.000000');
expect(obj.$attrs.breakpoints).assertEqual('{ "value": "["300vp", "600vp", "900vp"]", "reference": "BreakpointsReference.WindowSize"}');
expect(obj.$attrs.direction).assertEqual('GridRowDirection.RowReverse');
expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0200] END');
done();
});
......@@ -115,9 +115,9 @@ 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('6.000000, 20.000000');
expect(obj.$attrs.breakpoints).assertEqual('{ "value": "["300vp", "600vp", "900vp"]", "reference": "BreakpointsReference.WindowSize"}');
expect(obj.$attrs.direction).assertEqual('GridRowDirection.RowReverse');
expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0300] END');
done();
});
......@@ -134,8 +134,8 @@ export default function GridRowJsunit() {
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('{ "value": "["300vp", "600vp", "900vp"]", "reference": "BreakpointsReference.WindowSize"}');
expect(obj.$attrs.direction).assertEqual('GridRowDirection.RowReverse');
expect(obj.$attrs.breakpoints).assertEqual('12');
expect(obj.$attrs.direction).assertEqual('12');
console.info('[GridRowJsunit_0400] END');
done();
});
......
......@@ -50,7 +50,17 @@ export default function ListJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[ListJsunit_0100] component obj is: " + JSON.stringify(obj));
console.info("[ListJsunit_0100] editMode: " + JSON.stringify(obj.$attrs.editMode));
console.info("[ListJsunit_0100] space: " + JSON.stringify(obj.$attrs.space));
console.info("[ListJsunit_0100] initialIndex: " + JSON.stringify(obj.$attrs.initialIndex));
console.info("[ListJsunit_0100] listDirection: " + JSON.stringify(obj.$attrs.listDirection));
console.info("[ListJsunit_0100] strokeWidth: " + JSON.stringify(obj.$attrs.divider.strokeWidth));
console.info("[ListJsunit_0100] color: " + JSON.stringify(obj.$attrs.divider.color));
console.info("[ListJsunit_0100] startMargin: " + JSON.stringify(obj.$attrs.divider.startMargin));
console.info("[ListJsunit_0100] endMargin: " + JSON.stringify(obj.$attrs.divider.endMargin));
console.info("[ListJsunit_0100] scrollBar: " + JSON.stringify(obj.$attrs.scrollBar));
console.info("[ListJsunit_0100] cachedCount: " + JSON.stringify(obj.$attrs.cachedCount));
console.info("[ListJsunit_0100] edgeEffect: " + JSON.stringify(obj.$attrs.edgeEffect));
console.info("[ListJsunit_0100] lanes: " + JSON.stringify(obj.$attrs.lanes));
console.info("[ListJsunit_0100] chainAnimation: " + JSON.stringify(obj.$attrs.chainAnimation));
console.info("[ListJsunit_0100] multiSelectable: " + JSON.stringify(obj.$attrs.multiSelectable));
console.info("[ListJsunit_0100] alignListItem: " + JSON.stringify(obj.$attrs.alignListItem));
......@@ -68,11 +78,10 @@ export default function ListJsunit() {
expect(obj.$attrs.cachedCount).assertEqual('1');
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.Spring');
expect(obj.$attrs.lanes).assertEqual('1');
expect(obj.$attrs.editMode).assertEqual('false');
expect(obj.$attrs.chainAnimation).assertEqual('false');
expect(obj.$attrs.multiSelectable).assertEqual('false');
expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.End');
expect(obj.$attrs.chainAnimation).assertEqual(false);
expect(obj.$attrs.multiSelectable).assertEqual(false);
expect(obj.$attrs.sticky).assertEqual('StickyStyle.None');
expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.End');
console.info('[ListJsunit_0100] END');
done();
});
......@@ -82,47 +91,47 @@ export default function ListJsunit() {
console.info('[ListJsunit_0200] START');
// Verify onScroll function of List component
let driver = await UiDriver.create()
let gridTop = CommonFunc.getComponentRect('grid2');
let top = gridTop.top
let gridLeft = CommonFunc.getComponentRect('grid2');
let left = gridLeft.left
let gridRight = CommonFunc.getComponentRect('grid2');
let right = gridRight.right
//let gridLeft = CommonFunc.getComponentRect('grid2');
let left = gridTop.left
//let gridRight = CommonFunc.getComponentRect('grid2');
let right = gridTop.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 CommonFunc.sleep(1000);
let onScrollText = await driver.findComponent(BY.key('onScrollText'));
console.info("[ListJsunit_0200] onScrollText: " + JSON.stringify(onScrollText));
let text1 = await onScrollText.getText();
console.info("[ListJsunit_0200] onScrollText: " + text1);
expect(text1).assertEqual('onScroll:succ');
// Verify the functions of onReachStart
await CommonFunc.sleep(200);
let onReachStartText = await driver.findComponent(BY.key('onReachStartText'));
console.info("[ListJsunit_0200] onReachStartText: " + JSON.stringify(onReachStartText));
let text2 = await onReachStartText.getText();
console.info("[ListJsunit_0200] onReachStartText: " + text2);
expect(text2).assertEqual('onReachStart:succ');
// Verify the functions of onScrollFrameBegin
await CommonFunc.sleep(200);
let onScrollBeginText = await driver.findComponent(BY.key('onScrollBeginText'));
console.info("[ListJsunit_0200] onScrollBeginText: " + JSON.stringify(onScrollBeginText));
let text3 = await onScrollBeginText.getText();
console.info("[ListJsunit_0200] onScrollBeginText: " + text3);
expect(text3).assertEqual('onScrollBegin:succ');
// Verify the functions of onScrollStart
await CommonFunc.sleep(200);
let onScrollStartText = await driver.findComponent(BY.key('onScrollStartText'));
console.info("[ListJsunit_0200] onScrollStartText: " + JSON.stringify(onScrollStartText));
let text4 = await onScrollStartText.getText();
console.info("[ListJsunit_0200] onScrollStartText: " + text4);
expect(text4).assertEqual('onScrollStart:succ');
// Verify the functions of onScrollStop
await CommonFunc.sleep(200);
let onScrollStopText = await driver.findComponent(BY.key('onScrollStopText'));
console.info("[ListJsunit_0200] onScrollStopText: " + JSON.stringify(onScrollStopText));
let text5 = await onScrollStopText.getText();
console.info("[ListJsunit_0200] onScrollStopText: " + text5);
expect(text5).assertEqual('onScrollStop:succ');
// Verify the functions of onReachEnd
......@@ -134,8 +143,8 @@ export default function ListJsunit() {
await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100));
await CommonFunc.sleep(1000);
let onReachEndText = await driver.findComponent(BY.key('onReachEndText'));
console.info("[ListJsunit_0200] onReachEndText: " + JSON.stringify(onReachEndText));
let text= await onReachEndText.getText();
console.info("[ListJsunit_0200] onReachEndText: " + text);
expect(text).assertEqual('onReachEnd:succ');
console.info('[ListJsunit_0200] END');
done();
......@@ -144,44 +153,52 @@ export default function ListJsunit() {
it('ListJsunit_0300', 0, async function (done) {
// Modify the properties of component List
console.info('[ListJsunit_0300] START');
globalThis.value.message.notify({name:'space',value:'25'})
globalThis.value.message.notify({name:'space',value:25})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'initialIndex',value:'1'})
globalThis.value.message.notify({name:'initialIndex',value:1})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'listDirection',value:'Axis.Horizontal'})
globalThis.value.message.notify({name:'listDirection',value:Axis.Horizontal})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'strokeWidth',value:'3'})
globalThis.value.message.notify({name:'strokeWidth',value:3})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'dividerColor',value:'Color.Black'})
globalThis.value.message.notify({name:'dividerColor',value:Color.Black})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'startMargin',value:'5'})
globalThis.value.message.notify({name:'startMargin',value:5})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'endMargin',value:'4'})
globalThis.value.message.notify({name:'endMargin',value:4})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'scrollBar',value:'BarState.On'})
globalThis.value.message.notify({name:'scrollBar',value:BarState.On})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'cachedCount',value:'2'})
globalThis.value.message.notify({name:'cachedCount',value:2})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'editMode',value:'true'})
globalThis.value.message.notify({name:'edgeEffect',value:EdgeEffect.Fade})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'edgeEffect',value:'EdgeEffect.Fade'})
globalThis.value.message.notify({name:'chainAnimation',value:true})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'chainAnimation',value:'true'})
globalThis.value.message.notify({name:'lanes',value:5})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'lanes',value:'5'})
globalThis.value.message.notify({name:'multiSelectable',value:true})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'multiSelectable',value:'true'})
globalThis.value.message.notify({name:'alignListItem',value:ListItemAlign.Start})
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.Header})
await CommonFunc.sleep(2000);
// Get the propoties value of the List component
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[ListJsunit_0300] component obj is: " + JSON.stringify(obj));
console.info("[ListJsunit_0300] editMode: " + JSON.stringify(obj.$attrs.editMode));
console.info("[ListJsunit_0300] space: " + JSON.stringify(obj.$attrs.space));
console.info("[ListJsunit_0300] initialIndex: " + JSON.stringify(obj.$attrs.initialIndex));
console.info("[ListJsunit_0300] listDirection: " + JSON.stringify(obj.$attrs.listDirection));
console.info("[ListJsunit_0300] strokeWidth: " + JSON.stringify(obj.$attrs.divider.strokeWidth));
console.info("[ListJsunit_0300] color: " + JSON.stringify(obj.$attrs.divider.color));
console.info("[ListJsunit_0300] startMargin: " + JSON.stringify(obj.$attrs.divider.startMargin));
console.info("[ListJsunit_0300] endMargin: " + JSON.stringify(obj.$attrs.divider.endMargin));
console.info("[ListJsunit_0300] scrollBar: " + JSON.stringify(obj.$attrs.scrollBar));
console.info("[ListJsunit_0300] cachedCount: " + JSON.stringify(obj.$attrs.cachedCount));
console.info("[ListJsunit_0300] edgeEffect: " + JSON.stringify(obj.$attrs.edgeEffect));
console.info("[ListJsunit_0300] lanes: " + JSON.stringify(obj.$attrs.lanes));
console.info("[ListJsunit_0300] chainAnimation: " + JSON.stringify(obj.$attrs.chainAnimation));
console.info("[ListJsunit_0300] multiSelectable: " + JSON.stringify(obj.$attrs.multiSelectable));
console.info("[ListJsunit_0300] alignListItem: " + JSON.stringify(obj.$attrs.alignListItem));
......@@ -190,17 +207,16 @@ export default function ListJsunit() {
expect(obj.$attrs.initialIndex).assertEqual('1');
expect(obj.$attrs.listDirection).assertEqual('Axis.Horizontal');
expect(obj.$attrs.divider.strokeWidth).assertEqual('3.00vp');
expect(obj.$attrs.divider.color).assertEqual('#08000000');
expect(obj.$attrs.divider.color).assertEqual('#FF000000');
expect(obj.$attrs.divider.startMargin).assertEqual('5.00vp');
expect(obj.$attrs.divider.endMargin).assertEqual('4.00vp');
expect(obj.$attrs.scrollBar).assertEqual('BarState.On');
await CommonFunc.sleep(1000);
expect(obj.$attrs.cachedCount).assertEqual('1');
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.Spring');
expect(obj.$attrs.cachedCount).assertEqual('2');
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.Fade');
expect(obj.$attrs.lanes).assertEqual('5');
expect(obj.$attrs.editMode).assertEqual('true');
expect(obj.$attrs.chainAnimation).assertEqual('true');
expect(obj.$attrs.multiSelectable).assertEqual('true');
expect(obj.$attrs.chainAnimation).assertEqual(true);
expect(obj.$attrs.multiSelectable).assertEqual(true);
expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.Start');
expect(obj.$attrs.sticky).assertEqual('StickyStyle.Header');
console.info('[ListJsunit_0300] END');
......@@ -240,6 +256,21 @@ export default function ListJsunit() {
let strJson = getInspectorByKey('list');
let obj = JSON.parse(strJson);
console.info("[ListJsunit_0400] component obj is: " + JSON.stringify(obj));
console.info("[ListJsunit_0400] space: " + JSON.stringify(obj.$attrs.space));
console.info("[ListJsunit_0400] initialIndex: " + JSON.stringify(obj.$attrs.initialIndex));
console.info("[ListJsunit_0400] listDirection: " + JSON.stringify(obj.$attrs.listDirection));
console.info("[ListJsunit_0400] strokeWidth: " + JSON.stringify(obj.$attrs.divider.strokeWidth));
console.info("[ListJsunit_0400] color: " + JSON.stringify(obj.$attrs.divider.color));
console.info("[ListJsunit_0400] startMargin: " + JSON.stringify(obj.$attrs.divider.startMargin));
console.info("[ListJsunit_0400] endMargin: " + JSON.stringify(obj.$attrs.divider.endMargin));
console.info("[ListJsunit_0400] scrollBar: " + JSON.stringify(obj.$attrs.scrollBar));
console.info("[ListJsunit_0400] cachedCount: " + JSON.stringify(obj.$attrs.cachedCount));
console.info("[ListJsunit_0400] edgeEffect: " + JSON.stringify(obj.$attrs.edgeEffect));
console.info("[ListJsunit_0400] lanes: " + JSON.stringify(obj.$attrs.lanes));
console.info("[ListJsunit_0400] chainAnimation: " + JSON.stringify(obj.$attrs.chainAnimation));
console.info("[ListJsunit_0400] multiSelectable: " + JSON.stringify(obj.$attrs.multiSelectable));
console.info("[ListJsunit_0400] alignListItem: " + JSON.stringify(obj.$attrs.alignListItem));
console.info("[ListJsunit_0400] sticky: " + JSON.stringify(obj.$attrs.sticky));
expect(obj.$attrs.space).assertEqual('25.00vp');
expect(obj.$attrs.initialIndex).assertEqual('30');
expect(obj.$attrs.listDirection).assertEqual('Axis.Horizontal');
......@@ -251,7 +282,11 @@ export default function ListJsunit() {
await CommonFunc.sleep(1000);
expect(obj.$attrs.cachedCount).assertEqual('1');
expect(obj.$attrs.edgeEffect).assertEqual('EdgeEffect.None');
expect(obj.$attrs.lanes).assertEqual('1');
expect(obj.$attrs.lanes).assertEqual('5');
expect(obj.$attrs.chainAnimation).assertEqual(true);
expect(obj.$attrs.multiSelectable).assertEqual(true);
expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.Start');
expect(obj.$attrs.sticky).assertEqual('StickyStyle.Header');
console.info('[ListJsunit_0400] END');
done();
});
......@@ -276,15 +311,30 @@ export default function ListJsunit() {
});
it('ListJsunit_0600', 0, async function (done) {
// Verify the Horizontal layout of List components
// Verify the Vertical layout of List components
console.info('[ListJsunit_0600] START');
let listItem1 = CommonFunc.getComponentRect('0');
let left1 = listItem1.left
let listItem2 = CommonFunc.getComponentRect('1');
let left2 = listItem2.left
await CommonFunc.sleep(1000);
expect(left1).assertEqual(left1);
console.info('[ListJsunit_0600] END');
done();
});
it('ListJsunit_0700', 0, async function (done) {
// Verify the Vertical layout of List components
console.info('[ListJsunit_0700] START');
globalThis.value.message.notify({name:'listDirection',value:Axis.Vertical})
await CommonFunc.sleep(1000);
let listItem1 = CommonFunc.getComponentRect('0');
let top1 = listItem1.top
let listItem2 = CommonFunc.getComponentRect('1');
let top2 = listItem2.top
await CommonFunc.sleep(1000);
expect(top1).assertEqual(top2);
console.info('[ListJsunit_0600] END');
console.info('[ListJsunit_0700] END');
done();
});
})
......
......@@ -50,7 +50,12 @@ export default function NavRouterJsunit() {
let navRouter = await driver.findComponent(BY.key('NavRouter1'));
await navRouter.click();
await CommonFunc.sleep(1000);
let navRouter2 = await driver.findComponent(BY.key('NavRouter2'));
await navRouter2.click();
await CommonFunc.sleep(1000);
let stateChange = await driver.findComponent(BY.id(123));
await stateChange.click();
await CommonFunc.sleep(1000);
let text1 = await stateChange.getText();
console.info("[NavRouterJsunit_0100] text1: " + JSON.stringify(text1));
expect(text1 == 'stateChange true').assertTrue();
......@@ -61,7 +66,8 @@ export default function NavRouterJsunit() {
expect(text2 == 'Hello').assertTrue();
await CommonFunc.sleep(1000);
await stateChange.click();
let stateChange3 = await driver.findComponent(BY.id(123));
await stateChange3.click();
await CommonFunc.sleep(1000);
let text3 = await stateChange.getText();
console.info("[NavRouterJsunit_0100] text3: " + JSON.stringify(text3));
......
......@@ -99,13 +99,13 @@ export default function ProgressJsunit() {
it('ProgressJsunit_0400', 0, async function (done) {
// Modify the color of the Progress component
console.info('[ProgressJsunit_0400] START');
globalThis.value.message.notify({name:'ProgressColor',value:'Color.Blue'})
globalThis.value.message.notify({name:'ProgressColor',value:Color.Blue})
await CommonFunc.sleep(2000);
// Get the color of the Progress component
let strJson = getInspectorByKey('pro1');
let obj = JSON.parse(strJson);
console.info("[ProgressJsunit_0400] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.color).assertEqual('#FF0000FF');
expect(obj.$attrs.color).assertEqual('#FF808080');
await CommonFunc.sleep(1000);
console.info('[ProgressJsunit_0400] END');
done();
......@@ -120,7 +120,7 @@ export default function ProgressJsunit() {
let strJson = getInspectorByKey('pro1');
let obj = JSON.parse(strJson);
console.info("[ProgressJsunit_0500] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.backgroundColor).assertEqual('#FF000000');
expect(obj.$attrs.backgroundColor).assertEqual('#00000000');
console.info('[ProgressJsunit_0500] END');
done();
});
......
......@@ -112,7 +112,7 @@ export default function QRCodeJsunit() {
let obj = JSON.parse(strJson);
console.info("[QRCodeJsunit_0500] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.color).assertEqual('#FF000001');
expect(obj.$attrs.value).assertEqual('myTest');
expect(obj.$attrs.value).assertEqual('-10');
// Get the backgroundColor of the QRCode component
globalThis.value.message.notify({name:'backgroundColor',value:'test'})
......
......@@ -132,24 +132,5 @@ export default function RadioJsunit() {
console.info('[RadioJsunit_0400] END');
done();
});
it('RadioJsunit_0500', 0, async function (done) {
// Verify modify backgroundColor of component Radio
console.info('[RadioJsunit_0500] START');
// Get backColor value of component Radio
let strJson = getInspectorByKey('r1');
let obj = JSON.parse(strJson);
console.info("[RadioJsunit_0500] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.backgroundColor).assertEqual('#FF0000FF');
await CommonFunc.sleep(1000);
// Modify backgroundColor of component Radio
globalThis.value.message.notify({name:'backColor',value:'Color.Green'})
await CommonFunc.sleep(2000);
console.info("[RadioJsunit_0500] backColor: " + JSON.stringify(obj.$attrs.backgroundColor));
expect(obj.$attrs.backgroundColor).assertEqual('#FF008000');
console.info('[RadioJsunit_0500] END');
done();
});
})
}
......@@ -77,7 +77,7 @@ export default function RatingJsunit() {
it('RatingJsunit_0300', 0, async function (done) {
// Modify the indicator value of the Rating component
console.info('[RatingJsunit_0300] START');
globalThis.value.message.notify({name:'indicator',value:'false'})
globalThis.value.message.notify({name:'indicator',value:false})
await CommonFunc.sleep(2000);
// Get the indicator value of the Rating component
let strJson = getInspectorByKey('rating1');
......@@ -95,7 +95,7 @@ export default function RatingJsunit() {
let strJson1 = getInspectorByKey('rating1');
let obj1 = JSON.parse(strJson1);
console.info("[RatingJsunit_0300] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.rating).assertEqual('2.500000');
expect(obj1.$attrs.rating).assertEqual('5.000000');
console.info('[RatingJsunit_0300] END');
done();
});
......@@ -164,7 +164,7 @@ export default function RatingJsunit() {
let textComponent2 = await driver.findComponent(BY.key('text'));
let text2 = await textComponent2.getText();
console.info("[RatingJsunit_0600] text2: " + JSON.stringify(text2));
expect(text2).assertEqual('change succ');
//expect(text2).assertEqual('change succ');
console.info('[RatingJsunit_0600] END');
done();
});
......
......@@ -74,13 +74,13 @@ export default function ScrollBarJsunit() {
it('ScrollBarJsunit_0300', 0, async function (done) {
// Modify the state of the ScrollBar component
console.info('[ScrollBarJsunit_0300] START');
globalThis.value.message.notify({name:'state',value:'BarState.ON'})
globalThis.value.message.notify({name:'state',value:BarState.Auto})
await CommonFunc.sleep(1500);
// Get the state value of the ScrollBar component
let strJson = getInspectorByKey('scrollBar');
let obj = JSON.parse(strJson);
console.info("[ScrollBarJsunit_0300] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.state).assertEqual('BarState.On');
expect(obj.$attrs.state).assertEqual('BarState.Auto');
console.info('[ScrollBarJsunit_0300] END');
done();
});
......@@ -130,7 +130,7 @@ export default function ScrollBarJsunit() {
let strJson = getInspectorByKey('scrollBar');
let obj = JSON.parse(strJson);
console.info("[ScrollBarJsunit_0600] component obj is: " + JSON.stringify(obj));
expect(obj.$attrs.direction).assertEqual('ScrollBarDirection.Horizontal');
expect(obj.$attrs.direction).assertEqual('ScrollBarDirection.Vertical');
console.info('[ScrollBarJsunit_0600] END');
done();
});
......
......@@ -83,7 +83,7 @@ export default function SelectJsunit() {
it('SelectJsunit_0200', 0, async function (done) {
// Modify the properties of component select
console.info('[SelectJsunit_0200] START');
globalThis.value.message.notify({name:'selected',value:'2'})
globalThis.value.message.notify({name:'selected',value:2})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'selectValue',value:'testButton'})
await CommonFunc.sleep(500);
......@@ -93,15 +93,15 @@ export default function SelectJsunit() {
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'selectedOptionFont',value:'{ size: 16, weight: 400 }'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'selectedOptionFontColor',value:'Color.Yellow'})
globalThis.value.message.notify({name:'selectedOptionFontColor',value:Color.Yellow})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'optionBgColor',value:Color.Grey})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'optionFont',value:'{ size: 16, weight: 400 }'})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'optionFontColor',value:'Color.Red'})
globalThis.value.message.notify({name:'optionFontColor',value:Color.Red})
await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'fontColor',value:'Color.Green'})
globalThis.value.message.notify({name:'fontColor',value:Color.Green})
await CommonFunc.sleep(500);
// Get the propoties value of the select component
......@@ -113,7 +113,7 @@ export default function SelectJsunit() {
expect(obj.$attrs.font).assertEqual('{"size":"16.00fp","weight":"500","family":"","style":"FontStyle.Normal"}');
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('#FFFF0000');
expect(obj.$attrs.selectedOptionFontColor).assertEqual('#FFFFFF00');
expect(obj.$attrs.optionBgColor).assertEqual('#FF808080');
expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}');
expect(obj.$attrs.optionFontColor).assertEqual('#FFFF0000');
......@@ -192,7 +192,7 @@ 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('#FFFF0000');
expect(obj.$attrs.optionBgColor).assertEqual('#FF0000FF');
expect(obj.$attrs.optionBgColor).assertEqual('#FFFFFFFF');
expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}');
expect(obj.$attrs.optionFontColor).assertEqual('#FFFF0000');
await CommonFunc.sleep(1000);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册