提交 b5add9c8 编写于 作者: Z zhanghailin

FlexAlignItems xts code submit

Signed-off-by: Nzhanghailin <hlzhangai@isoftstone.com>
上级 47882658
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ace_ets_component_flex.iml" filepath="$PROJECT_DIR$/.idea/ace_ets_component_flex.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="98a575b8-e483-4702-831b-56d3abfcbebe" name="更改" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/../.." />
</component>
<component name="ProjectId" id="2Kzfea4W89Kgl9Wug3MiRPXuIsP" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="settings.editor.selected.configurable" value="vcs.Git" />
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用级" UseSingleDictionary="true" transferred="true" />
</project>
\ No newline at end of file
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Copyright (c) 2020-2030 iSoftStone Information Technology (Group) Co.,Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2020-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2020-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......@@ -15,7 +15,7 @@
import router from '@ohos.router';
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../../test/Flex/List.test'
import testsuite from '../../../test/List.test'
@Entry
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2020-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2020-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2020-2030 iSoftStone Information Technology (Group) Co.,Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
export default function flexAlignSelf_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexAlignSelf_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexSecond state success " + JSON.stringify(pages));
if (!("FlexSecond" == pages.name)) {
......@@ -46,14 +34,14 @@ export default function flexAlignSelf_AutoJsunit() {
console.info("push FlexSecond page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexSecond page error " + JSON.stringify(result));
console.error("push FlexSecond page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexSecond after each called");
});
......@@ -62,8 +50,8 @@ export default function flexAlignSelf_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexAlignSelf
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexAlignSelf001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexAlignSelf001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1200', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 START');
let strJson1 = getInspectorByKey('flexAlignSelf');
let obj1 = JSON.parse(strJson1);
let strJson2 = getInspectorByKey('textAlignSelf01');
......@@ -88,7 +76,7 @@ export default function flexAlignSelf_AutoJsunit() {
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
expect(obj2.$attrs.alignSelf).assertEqual("ItemAlign.End")
console.info('new ItemAlign_Auto_FlexAlignSelf001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 END');
done();
});
})
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flexBase_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexBase_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexBase state success " + JSON.stringify(pages));
if (!("FlexBase" == pages.name)) {
......@@ -46,13 +34,13 @@ export default function flexBase_AutoJsunit() {
console.info("push FlexBase page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexBase page error " + JSON.stringify(result));
console.error("push FlexBase page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexBase after each called");
});
......@@ -61,10 +49,11 @@ export default function flexBase_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexBase
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexBase001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexBase001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0100', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0100 START');
globalThis.value.message.notify({name:'height', value:200});
globalThis.value.message.notify({name:'width', value:500});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flex01');
let obj1 = JSON.parse(strJson1);
let textFlex01 = CommonFunc.getComponentRect('textFlex01');
......@@ -87,7 +76,7 @@ export default function flexBase_AutoJsunit() {
expect(textFlex03.right - textFlex03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexBase001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0100 END');
done();
});
......@@ -96,10 +85,11 @@ export default function flexBase_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexBase
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexBase002', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexBase002 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0200', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0200 START');
globalThis.value.message.notify({name:'height', value:140});
globalThis.value.message.notify({name:'width', value:420});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flex01');
let obj1 = JSON.parse(strJson1);
let textFlex01 = CommonFunc.getComponentRect('textFlex01');
......@@ -121,7 +111,7 @@ export default function flexBase_AutoJsunit() {
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexBase002 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0200 END');
done();
});
})
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flexExceed_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexExceed_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexExceed state success " + JSON.stringify(pages));
if (!("FlexExceed" == pages.name)) {
......@@ -46,13 +34,13 @@ export default function flexExceed_AutoJsunit() {
console.info("push FlexExceed page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexExceed page error " + JSON.stringify(result));
console.error("push FlexExceed page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexExceed after each called");
});
......@@ -61,10 +49,11 @@ export default function flexExceed_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexExceed
* @tc.desc aceEtsTest
*/
it('ItemAlign_Auto_FlexExceed001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexExceed001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0600', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0600 START');
globalThis.value.message.notify({name:'padding', value:10})
globalThis.value.message.notify({name:'margin', value:10})
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexExceed01');
let obj1 = JSON.parse(strJson1);
let textExceed01 = CommonFunc.getComponentRect('textExceed01');
......@@ -84,7 +73,7 @@ export default function flexExceed_AutoJsunit() {
expect(textExceed03.right - textExceed03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexExceed001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0600 END');
done();
});
......@@ -93,17 +82,17 @@ export default function flexExceed_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexExceed
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexExceed002', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexExceed002 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0700', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0700 START');
globalThis.value.message.notify({name:'padding', value:30});
globalThis.value.message.notify({name:'margin', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexExceed01');
let obj1 = JSON.parse(strJson1);
let textExceed01 = CommonFunc.getComponentRect('textExceed01');
let textExceed02 = CommonFunc.getComponentRect('textExceed02');
let textExceed03 = CommonFunc.getComponentRect('textExceed03');
let flexExceed01 = CommonFunc.getComponentRect('flexExceed01');
expect(textExceed01.top).assertEqual(textExceed02.top)
expect(textExceed02.top).assertEqual(textExceed03.top)
expect(textExceed01.top).assertLarger(flexExceed01.top)
......@@ -117,7 +106,7 @@ export default function flexExceed_AutoJsunit() {
expect(textExceed03.right - textExceed03.left).assertEqual(vp2px(440/3))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexExceed002 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0700 END');
done();
});
})
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flexHeightModify_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexHeightModify_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexHeightModify state success " + JSON.stringify(pages));
if (!("FlexHeightModify" == pages.name)) {
......@@ -46,13 +34,13 @@ export default function flexHeightModify_AutoJsunit() {
console.info("push FlexHeightModify page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexHeightModify page error " + JSON.stringify(result));
console.error("push FlexHeightModify page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexHeightModify after each called");
});
......@@ -61,9 +49,10 @@ export default function flexHeightModify_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexHeightModify
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexHeightModify001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexHeightModify001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0800', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0800 START');
globalThis.value.message.notify({name:'height', value:80})
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexHeightModify');
let obj1 = JSON.parse(strJson1);
let textHeightModify01 = CommonFunc.getComponentRect('textHeightModify01');
......@@ -86,7 +75,7 @@ export default function flexHeightModify_AutoJsunit() {
expect(textHeightModify03.right - textHeightModify03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexHeightModify001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0800 END');
done();
});
})
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
export default function flexMargin_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexMargin_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexMargin state success " + JSON.stringify(pages));
if (!("FlexMargin" == pages.name)) {
......@@ -46,13 +34,13 @@ export default function flexMargin_AutoJsunit() {
console.info("push FlexMargin page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexMargin page error " + JSON.stringify(result));
console.error("push FlexMargin page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexMargin after each called");
});
......@@ -61,8 +49,8 @@ export default function flexMargin_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexMargin
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexMargin001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexMargin001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0500', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0500 START');
let strJson1 = getInspectorByKey('flexMargin');
let obj1 = JSON.parse(strJson1);
let textFlexMargin01 = CommonFunc.getComponentRect('textFlexMargin01');
......@@ -82,7 +70,7 @@ export default function flexMargin_AutoJsunit() {
expect(textFlexMargin03.right - textFlexMargin03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexMargin001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0500 END');
done();
});
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
export default function flexOffset_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexOffset_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get flexOffsetTest state success " + JSON.stringify(pages));
if (!("flexOffsetTest" == pages.name)) {
......@@ -46,13 +34,13 @@ export default function flexOffset_AutoJsunit() {
console.info("push flexOffsetTest page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push flexOffsetTest page error " + JSON.stringify(result));
console.error("push flexOffsetTest page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("flexOffsetTest after each called");
});
......@@ -61,8 +49,8 @@ export default function flexOffset_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexOffset
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexOffset001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexOffset001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0900', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0900 START');
let strJson1 = getInspectorByKey('flexOffset');
let obj1 = JSON.parse(strJson1);
let textOffset01 = CommonFunc.getComponentRect('textOffset01');
......@@ -83,7 +71,7 @@ export default function flexOffset_AutoJsunit() {
expect(textOffset03.right - textOffset03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexOffset001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0900 END');
done();
});
})
......
......@@ -13,23 +13,12 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flexPadding_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +26,7 @@ export default function flexPadding_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexPadding state success " + JSON.stringify(pages));
if (!("FlexPadding" == pages.name)) {
......@@ -46,13 +35,13 @@ export default function flexPadding_AutoJsunit() {
console.info("push FlexPadding page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexPadding page error " + JSON.stringify(result));
console.error("push FlexPadding page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexPadding after each called");
});
......@@ -61,9 +50,10 @@ export default function flexPadding_AutoJsunit() {
* @tc.name ItemAlign_Auto_testFlexPadding
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_testFlexPadding001', 0, async function (done) {
console.info('new ItemAlign_Auto_testFlexPadding001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0300', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0300 START');
globalThis.value.message.notify({name:'padding', value:10})
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexPadding01');
let obj1 = JSON.parse(strJson1);
let textFlexPadding01 = CommonFunc.getComponentRect('textFlexPadding01')
......@@ -85,7 +75,7 @@ export default function flexPadding_AutoJsunit() {
expect(textFlexPadding03.right - textFlexPadding03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_testFlexPadding001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0300 END');
done();
});
......@@ -94,9 +84,10 @@ export default function flexPadding_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexPadding
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexPadding002', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexPadding002 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_0400', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0400 START');
globalThis.value.message.notify({name:'padding', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexPadding01');
let obj1 = JSON.parse(strJson1);
let textFlexPadding01 = CommonFunc.getComponentRect('textFlexPadding01');
......@@ -116,7 +107,7 @@ export default function flexPadding_AutoJsunit() {
expect(textFlexPadding03.right - textFlexPadding03.left).assertEqual(vp2px(440/3))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_FlexPadding002 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_0400 END');
done();
});
})
......
......@@ -13,23 +13,12 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flexTextMargin_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +26,7 @@ export default function flexTextMargin_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexTextMargin state success " + JSON.stringify(pages));
if (!("FlexTextMargin" == pages.name)) {
......@@ -46,13 +35,13 @@ export default function flexTextMargin_AutoJsunit() {
console.info("push FlexTextMargin page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexTextMargin page error " + JSON.stringify(result));
console.error("push FlexTextMargin page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexTextMargin after each called");
});
......@@ -61,9 +50,10 @@ export default function flexTextMargin_AutoJsunit() {
* @tc.name ItemAlign_Auto_TextMargin
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_TextMargin001', 0, async function (done) {
console.info('new ItemAlign_Auto_TextMargin001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1300', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1300 START');
globalThis.value.message.notify({name:'margin', value:10});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexTextMargin01');
let obj1 = JSON.parse(strJson1);
let textMargin01 = CommonFunc.getComponentRect('textMargin01');
......@@ -73,11 +63,9 @@ export default function flexTextMargin_AutoJsunit() {
expect(textMargin01.left - flexTextMargin01.left).assertEqual(vp2px(10))
expect(textMargin02.left).assertEqual(textMargin01.right)
expect(textMargin03.right).assertLess(flexTextMargin01.right)
expect(textMargin01.top).assertEqual(textMargin02.top)
expect(textMargin02.top).assertEqual(textMargin03.top)
expect(textMargin02.top).assertEqual(flexTextMargin01.top)
expect(textMargin01.bottom - textMargin01.top).assertEqual(vp2px(70))
expect(textMargin02.bottom - textMargin02.top).assertEqual(vp2px(100))
expect(textMargin03.bottom - textMargin03.top).assertEqual(vp2px(150))
......@@ -86,7 +74,7 @@ export default function flexTextMargin_AutoJsunit() {
expect(textMargin03.right - textMargin03.left).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_TextMargin001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1300 END');
done();
});
......@@ -95,9 +83,10 @@ export default function flexTextMargin_AutoJsunit() {
* @tc.name ItemAlign_Auto_TextMargin
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_TextMargin002', 0, async function (done) {
console.info('new ItemAlign_Auto_TextMargin002 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1400', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1400 START');
globalThis.value.message.notify({name:'margin', value:30});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexTextMargin01');
let obj1 = JSON.parse(strJson1);
let textMargin01 = CommonFunc.getComponentRect('textMargin01');
......@@ -110,7 +99,6 @@ export default function flexTextMargin_AutoJsunit() {
expect(textMargin01.top).assertEqual(textMargin02.top)
expect(textMargin02.top).assertEqual(textMargin03.top)
expect(textMargin02.top).assertEqual(flexTextMargin01.top)
expect(textMargin01.bottom - textMargin01.top).assertEqual(vp2px(50))
expect(textMargin02.bottom - textMargin02.top).assertEqual(vp2px(100))
expect(textMargin03.bottom - textMargin03.top).assertEqual(vp2px(150))
......@@ -119,7 +107,7 @@ export default function flexTextMargin_AutoJsunit() {
expect(textMargin03.right - textMargin03.left).assertLess(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
console.info('new ItemAlign_Auto_TextMargin002 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1400 END');
done();
});
})
......
......@@ -13,23 +13,11 @@
* limitations under the License.
*/
// @ts-nocheck
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium";
import router from '@system.router';
import CommonFunc from "../../../../MainAbility/common/Common";
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flexVisibility_AutoJsunit() {
function sleep(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time * 1000)
}).then(() => {
console.info(`sleep ${time} over...`)
})
}
describe('flexItemAlignAutoTest', function () {
beforeEach(async function (done) {
let options = {
......@@ -37,7 +25,7 @@ export default function flexVisibility_AutoJsunit() {
}
try {
router.clear();
await sleep(1);
await CommonFunc.sleep(1000);
let pages = router.getState();
console.info("get FlexVisibility state success " + JSON.stringify(pages));
if (!("FlexVisibility" == pages.name)) {
......@@ -46,14 +34,14 @@ export default function flexVisibility_AutoJsunit() {
console.info("push FlexVisibility page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push FlexVisibility page error " + JSON.stringify(result));
console.error("push FlexVisibility page error " + JSON.stringify(err));
}
await sleep(2)
await CommonFunc.sleep(2000);
done()
});
afterEach(async function () {
await sleep(1)
await CommonFunc.sleep(1000);
console.info("FlexVisibility after each called");
});
......@@ -62,9 +50,10 @@ export default function flexVisibility_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexVisibility
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexVisibility001', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexVisibility001 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1000', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1000 START');
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexVisible');
let obj1 = JSON.parse(strJson1);
let strJson2 = getInspectorByKey('textVisible01');
......@@ -88,7 +77,7 @@ export default function flexVisibility_AutoJsunit() {
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
console.info('new ItemAlign_Auto_FlexVisibility001 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1000 END');
done();
});
......@@ -97,9 +86,10 @@ export default function flexVisibility_AutoJsunit() {
* @tc.name ItemAlign_Auto_FlexVisibility
* @tc.desc aceFlexAlignItemTest
*/
it('ItemAlign_Auto_FlexVisibility002', 0, async function (done) {
console.info('new ItemAlign_Auto_FlexVisibility002 START');
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1100', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 START');
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexVisible');
let obj1 = JSON.parse(strJson1);
let strJson2 = getInspectorByKey('textVisible01');
......@@ -122,7 +112,7 @@ export default function flexVisibility_AutoJsunit() {
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
console.info('new ItemAlign_Auto_FlexVisibility002 END');
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 END');
done();
});
})
......
......@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import flexBase_AutoJsunit from './alignItems/ItemAlign_Auto/FlexBaseJsunit.test.ets';
import flexPadding_AutoJsunit from './alignItems/ItemAlign_Auto/FlexPaddingJsunit.test.ets';
import flexMargin_AutoJsunit from './alignItems/ItemAlign_Auto/FlexMarginJsunit.test.ets';
import flexExceed_AutoJsunit from './alignItems/ItemAlign_Auto/FlexExceedJsunit.test.ets';
import flexHeightModify_AutoJsunit from './alignItems/ItemAlign_Auto/FlexHeightModifyJsunit.test.ets';
import flexOffset_AutoJsunit from './alignItems/ItemAlign_Auto/FlexOffsetJsunit.test.ets';
import flexVisibility_AutoJsunit from './alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets';
import flexAlignSelf_AutoJsunit from './alignItems/ItemAlign_Auto/FlexAlignSelfJsunit.test.ets';
import flexTextMargin_AutoJsunit from './alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets';
import flexBase_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexBaseJsunit.test.ets';
import flexPadding_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexPaddingJsunit.test.ets';
import flexMargin_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexMarginJsunit.test.ets';
import flexExceed_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexExceedJsunit.test.ets';
import flexHeightModify_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexHeightModifyJsunit.test.ets';
import flexOffset_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexOffsetJsunit.test.ets';
import flexVisibility_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets';
import flexAlignSelf_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexAlignSelfJsunit.test.ets';
import flexTextMargin_AutoJsunit from './Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets';
export default function testsuite() {
flexBase_AutoJsunit()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册