提交 924f0aee 编写于 作者: J jiyong

ACE2.0测试用例整改

Signed-off-by: Njiyong <jiyong@huawei.com>
上级 110bd90e
......@@ -27,25 +27,18 @@ struct flex {
}
build() {
Scroll() {
Column() {
Text("Flex").fontSize(16)
Column() {
Column({ space : 2 }) {
Text('direction:Column').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({
direction: FlexDirection.Column,
wrap: FlexWrap.NoWrap,
justifyContent: FlexAlign.Center,
alignContent: FlexAlign.Start,
alignItems: ItemAlign.Auto
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Column({ space: 5 }) {
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('Flex01').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex02').width('20%').height(50).backgroundColor(0xD2B48C)
Text('Flex03').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex04').width('20%').height(50).backgroundColor(0xD2B48C)
Text('1').width('100%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('100%').height(20).backgroundColor(0xD2B48C)
Text('3').width('100%').height(20).backgroundColor(0xF5DEB3)
}.width('100%').margin({ top: 5 })
}
.key('flex')
......@@ -54,24 +47,16 @@ struct flex {
.padding(10)
.backgroundColor(0xAFEEEE)
Text("Flex1").fontSize(16)
Text('direction:Row').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({
direction: FlexDirection.Row,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.Start,
alignContent: FlexAlign.Center,
alignItems: ItemAlign.Center
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Column({ space: 5 }) {
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('Flex10').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex12').width('20%').height(50).backgroundColor(0xD2B48C)
Text('Flex13').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex14').width('20%').height(50).backgroundColor(0xD2B48C)
}.width('100%').margin({ top: 5 })
Text('1').width('20%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('20%').height(20).backgroundColor(0xD2B48C)
Text('3').width('20%').height(20).backgroundColor(0xF5DEB3)
}
.key('flex1')
.height(70)
......@@ -79,106 +64,70 @@ struct flex {
.padding(10)
.backgroundColor(0xAFEEEE)
Text("Flex2").fontSize(16)
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({
direction: FlexDirection.RowReverse,
wrap: FlexWrap.WrapReverse,
wrap: FlexWrap.Wrap,
justifyContent: FlexAlign.End,
alignContent: FlexAlign.End,
alignItems: ItemAlign.Start
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Column({ space: 5 }) {
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('Flex21').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex22').width('20%').height(50).backgroundColor(0xD2B48C)
Text('Flex23').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex24').width('20%').height(50).backgroundColor(0xD2B48C)
}.width('100%').margin({ top: 5 })
Text('1').width('50%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('50%').height(20).backgroundColor(0xD2B48C)
Text('3').width('50%').height(20).backgroundColor(0xF5DEB3)
}
.key('flex2')
.height(70)
.height(90)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE)
Text("Flex3").fontSize(16)
Text('justifyContent:SpaceBetween').fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({
direction: FlexDirection.ColumnReverse,
wrap: FlexWrap.WrapReverse,
justifyContent: FlexAlign.SpaceBetween,
alignContent: FlexAlign.SpaceBetween,
alignItems: ItemAlign.Stretch
wrap: FlexWrap.Wrap,
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Column({ space: 5 }) {
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('Flex31').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex32').width('20%').height(50).backgroundColor(0xD2B48C)
Text('Flex33').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex34').width('20%').height(50).backgroundColor(0xD2B48C)
}.width('100%').margin({ top: 5 })
Text('1').width('100%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('100%').height(20).backgroundColor(0xD2B48C)
Text('3').width('100%').height(20).backgroundColor(0xF5DEB3)
}
.key('flex3')
.height(70)
.height(100)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE)
Text("Flex4").fontSize(16)
Text("justifyContent AND alignContent").fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({
direction: FlexDirection.ColumnReverse,
wrap: FlexWrap.WrapReverse,
justifyContent: FlexAlign.SpaceEvenly,
alignContent: FlexAlign.SpaceEvenly,
alignItems: ItemAlign.End
wrap: FlexWrap.Wrap,
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Column({ space: 5 }) {
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('Flex41').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex42').width('20%').height(50).backgroundColor(0xD2B48C)
Text('Flex43').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex44').width('20%').height(50).backgroundColor(0xD2B48C)
}.width('100%').margin({ top: 5 })
Text('1').width('50%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('50%').height(20).backgroundColor(0xD2B48C)
Text('3').width('50%').height(20).backgroundColor(0xF5DEB3)
}
.key('flex4')
.height(70)
.height(90)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE)
Text("Flex5").fontSize(16)
Text("justifyContent AND alignContent").fontSize(9).fontColor(0xCCCCCC).width('90%')
Flex({
direction: FlexDirection.ColumnReverse,
wrap: FlexWrap.WrapReverse,
justifyContent: FlexAlign.SpaceAround,
alignContent: FlexAlign.SpaceAround,
alignItems: ItemAlign.Baseline
wrap: FlexWrap.Wrap,
}) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Column({ space: 5 }) {
Text('direction:RowReverse').fontSize(9).fontColor(0xCCCCCC).width('90%')
Text('Flex51').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex52').width('20%').height(50).backgroundColor(0xD2B48C)
Text('Flex53').width('20%').height(50).backgroundColor(0xF5DEB3)
Text('Flex54').width('20%').height(50).backgroundColor(0xD2B48C)
}.width('100%').margin({ top: 5 })
Text('1').width('50%').height(20).backgroundColor(0xF5DEB3)
Text('2').width('50%').height(20).backgroundColor(0xD2B48C)
Text('3').width('50%').height(20).backgroundColor(0xF5DEB3)
}
.key('flex5')
.height(70)
.height(90)
.width('90%')
.padding(10)
.backgroundColor(0xAFEEEE)
}
}
}.width('100%').margin({ top: 5 })
}.width('100%')
}
}
......@@ -55,8 +55,10 @@ export default function tabJsunit() {
expect(obj.$type).assertEqual('Tabs')
expect(obj.$attrs.barPosition).assertEqual('BarPosition.Start')
expect(obj.$attrs.index).assertEqual('1')
expect(obj.$attrs.vertical).assertEqual("true")
expect(obj.$attrs.scrollable).assertEqual("true")
console.info('obj.$attrs.scrollable———>' + typeof(obj.$attrs.scrollable))
console.info('obj.$attrs.vertical———>' + typeof(obj.$attrs.vertical))
expect(obj.$attrs.scrollable).assertTrue()
expect(obj.$attrs.vertical).assertEqual('true')
expect(obj.$attrs.barMode).assertEqual('BarMode.Fixed')
expect(obj.$attrs.barWidth).assertEqual(70.000000.toFixed(6))
expect(obj.$attrs.barHeight).assertEqual(150.000000.toFixed(6))
......@@ -107,8 +109,8 @@ export default function tabJsunit() {
expect(obj.$type).assertEqual('Tabs')
expect(obj.$attrs.barPosition).assertEqual('BarPosition.End')
expect(obj.$attrs.barMode).assertEqual('BarMode.Scrollable')
expect(obj.$attrs.vertical).assertEqual("false")
expect(obj.$attrs.scrollable).assertEqual("false")
expect(obj.$attrs.scrollable).assertFalse()
expect(obj.$attrs.vertical).assertEqual('false')
console.info('++++++++++++++++ Tab TestCase 3 End ++++++++++++++++');
done();
});
......
......@@ -110,10 +110,11 @@ describe('basicabilityapi', function () {
*/
it('testRouterPush', 0, async function (done) {
console.info('testRouterPush START');
let options = {
uri : 'pages/routerPush/index'
}
let promise1 = new Promise((resolve, reject) => {
router.push({
uri: 'pages/routerPush/index'
});
router.push(options);
resolve();
});
let promise2 = new Promise((resolve, reject) => {
......@@ -172,21 +173,25 @@ describe('basicabilityapi', function () {
* @tc.desc Replace the current page with a page in the application, and destroy the replaced page.
*/
it('testRouterReplace', 0, async function (done) {
//测试框架不允许index页面直接替换,需要先跳转到其他页面再替换
console.info('testRouterReplace START');
let options = {
uri : 'pages/routerPush/index'
}
let promise1 = new Promise((resolve, reject) => {
router.push({
uri: 'pages/routerPush/index'
});
router.push(options);
resolve();
});
let repleasePage = {
uri : 'pages/routerReplace/index'
}
let promise2 = new Promise((resolve, reject) => {
setTimeout(() => {
router.replace({
uri: 'pages/routerReplace/index'
});
router.replace(repleasePage);
resolve();
}, 500);
});
//替换堆栈数量不会变
let promise3 = new Promise((resolve, reject) => {
setTimeout(() => {
let pages = router.getState();
......@@ -295,10 +300,11 @@ describe('basicabilityapi', function () {
let size = router.getLength();
console.info('[router.getLength] pages stack size = ' + size);
expect(size).assertEqual('1');
let options = {
uri : 'pages/routerPush/index'
}
let promise1 = new Promise((resolve, reject) => {
router.push({
uri: 'pages/routerPush/index'
});
router.push(options);
resolve();
});
let promise2 = new Promise((resolve, reject) => {
......@@ -422,7 +428,7 @@ describe('basicabilityapi', function () {
console.info('[settimeout] v2: ' + v2);
expect('test').assertEqual(v1);
expect('message').assertEqual(v2);
expect().assertTrue(end_time - start_time >= delay);
expect(end_time - start_time >= delay).assertTrue();
console.info('testSetTimeout END');
done();
}, delay, 'test', 'message');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册