Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c4dd162e
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c4dd162e
编写于
4月 13, 2023
作者:
W
wmlih
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:add testcase Abnormal protection
Signed-off-by:
N
wmlih
<
wmlih@isoftstone.com
>
上级
e0ec19de
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
699 addition
and
569 deletion
+699
-569
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/Wrap/Wrap/Flex_Wrap_Visibility.test.ets
...ain/ets/test/Flex/Wrap/Wrap/Flex_Wrap_Visibility.test.ets
+103
-76
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets
...und/Flex_AlignContent_SpaceAround_TextVisibility.test.ets
+81
-63
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets
...en/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets
+66
-48
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets
...x/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets
+54
-47
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddVisibility.test.ets
.../justifyContent/Center/AlignCenter_AddVisibility.test.ets
+95
-80
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets
...t/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets
+91
-76
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets
...ntent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets
+118
-103
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddVisibility.test.ets
...ex/justifyContent/Start/AlignStart_AddVisibility.test.ets
+91
-76
未找到文件。
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/Wrap/Wrap/Flex_Wrap_Visibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -51,32 +51,41 @@ export default function flex_Wrap_VisibilityTest() {
*/
it('testWrapWrapTextVisibilityNoneOverflow', 0, async function (done) {
console.info('[testWrapWrapTextVisibilityNoneOverflow] START');
globalThis.value.message.notify({name:'firstTextWidth', value:250});
globalThis.value.message.notify({name:'secondTextWidth', value:350});
globalThis.value.message.notify({name:'thirdTextWidth', value:350});
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
let secondText = CommonFunc.getComponentRect('Wrap_Text_Visibility2');
let thirdText = CommonFunc.getComponentRect('Wrap_Text_Visibility3');
let flexContainer = CommonFunc.getComponentRect('Flex_Wrap_Visibility_Container01');
let flexContainerStrJson = getInspectorByKey('Flex_Wrap_Visibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(secondText.top).assertEqual(flexContainer.top);
expect(secondText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(150));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(200));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(vp2px(350));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(Math.round(secondText.right - secondText.left));
expect(thirdText.top).assertEqual(secondText.bottom);
expect(thirdText.left).assertEqual(secondText.left);
expect(Math.round(thirdText.bottom - flexContainer.bottom)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'firstTextWidth', value:250});
globalThis.value.message.notify({name:'secondTextWidth', value:350});
globalThis.value.message.notify({name:'thirdTextWidth', value:350});
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
let secondText = CommonFunc.getComponentRect('Wrap_Text_Visibility2');
let thirdText = CommonFunc.getComponentRect('Wrap_Text_Visibility3');
let flexContainer = CommonFunc.getComponentRect('Flex_Wrap_Visibility_Container01');
let flexContainerStrJson = getInspectorByKey('Flex_Wrap_Visibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
let firstTextStrJson = getInspectorByKey('Wrap_Text_Visibility1');
let firstTextObj = JSON.parse(firstTextStrJson);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.None");
expect(secondText.top).assertEqual(flexContainer.top);
expect(secondText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(150));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(200));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(vp2px(350));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(Math.round(secondText.right - secondText.left));
expect(thirdText.top).assertEqual(secondText.bottom);
expect(thirdText.left).assertEqual(secondText.left);
expect(Math.round(thirdText.bottom - flexContainer.bottom)).assertEqual(vp2px(150));
} catch (err) {
console.error('[testWrapWrapTextVisibilityNoneOverflow] failed');
expect().assertFail();
}
console.info('[testWrapWrapTextVisibilityNoneOverflow] END');
done();
});
...
...
@@ -88,31 +97,40 @@ export default function flex_Wrap_VisibilityTest() {
*/
it('testWrapWrapTextVisibilityNoneMeet', 0, async function (done) {
console.info('[testWrapWrapTextVisibilityNoneMeet] START');
globalThis.value.message.notify({name:'firstTextWidth', value:250});
globalThis.value.message.notify({name:'secondTextWidth', value:150});
globalThis.value.message.notify({name:'thirdTextWidth', value:150});
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
let secondText = CommonFunc.getComponentRect('Wrap_Text_Visibility2');
let thirdText = CommonFunc.getComponentRect('Wrap_Text_Visibility3');
let flexContainer = CommonFunc.getComponentRect('Flex_Wrap_Visibility_Container01');
let flexContainerStrJson = getInspectorByKey('Flex_Wrap_Visibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(secondText.right).assertEqual(thirdText.left);
expect(secondText.top).assertEqual(thirdText.top);
expect(flexContainer.top).assertEqual(thirdText.top);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(150));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(200));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(vp2px(150));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(Math.round(secondText.right - secondText.left));
expect(Math.round(flexContainer.right - thirdText.right)).assertEqual(vp2px(200));
expect(flexContainer.left).assertEqual(secondText.left);
try{
globalThis.value.message.notify({name:'firstTextWidth', value:250});
globalThis.value.message.notify({name:'secondTextWidth', value:150});
globalThis.value.message.notify({name:'thirdTextWidth', value:150});
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
let secondText = CommonFunc.getComponentRect('Wrap_Text_Visibility2');
let thirdText = CommonFunc.getComponentRect('Wrap_Text_Visibility3');
let flexContainer = CommonFunc.getComponentRect('Flex_Wrap_Visibility_Container01');
let flexContainerStrJson = getInspectorByKey('Flex_Wrap_Visibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
let firstTextStrJson = getInspectorByKey('Wrap_Text_Visibility1');
let firstTextObj = JSON.parse(firstTextStrJson);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.None");
expect(secondText.right).assertEqual(thirdText.left);
expect(secondText.top).assertEqual(thirdText.top);
expect(flexContainer.top).assertEqual(thirdText.top);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(150));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(200));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(vp2px(150));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(Math.round(secondText.right - secondText.left));
expect(Math.round(flexContainer.right - thirdText.right)).assertEqual(vp2px(200));
expect(flexContainer.left).assertEqual(secondText.left);
} catch (err) {
console.error('[testWrapWrapTextVisibilityNoneMeet] failed');
expect().assertFail();
}
console.info('[testWrapWrapTextVisibilityNoneMeet] END');
done();
});
...
...
@@ -124,31 +142,40 @@ export default function flex_Wrap_VisibilityTest() {
*/
it('testWrapWrapTextVisibilityHidden', 0, async function (done) {
console.info('[testWrapWrapTextVisibilityHidden] START');
globalThis.value.message.notify({name:'firstTextWidth', value:150});
globalThis.value.message.notify({name:'secondTextWidth', value:150});
globalThis.value.message.notify({name:'thirdTextWidth', value:150});
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let secondText = CommonFunc.getComponentRect('Wrap_Text_Visibility2');
let thirdText = CommonFunc.getComponentRect('Wrap_Text_Visibility3');
let flexContainer = CommonFunc.getComponentRect('Flex_Wrap_Visibility_Container01');
let flexContainerStrJson = getInspectorByKey('Flex_Wrap_Visibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(secondText.right).assertEqual(thirdText.left)
expect(secondText.top).assertEqual(thirdText.top);
expect(flexContainer.top).assertEqual(thirdText.top);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(150));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(200));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(vp2px(150));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(Math.round(secondText.right - secondText.left));
expect(Math.round(flexContainer.right - thirdText.right)).assertEqual(vp2px(50));
expect(Math.round(secondText.left - flexContainer.left)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'firstTextWidth', value:150});
globalThis.value.message.notify({name:'secondTextWidth', value:150});
globalThis.value.message.notify({name:'thirdTextWidth', value:150});
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let secondText = CommonFunc.getComponentRect('Wrap_Text_Visibility2');
let thirdText = CommonFunc.getComponentRect('Wrap_Text_Visibility3');
let flexContainer = CommonFunc.getComponentRect('Flex_Wrap_Visibility_Container01');
let flexContainerStrJson = getInspectorByKey('Flex_Wrap_Visibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
let firstTextStrJson = getInspectorByKey('Wrap_Text_Visibility1');
let firstTextObj = JSON.parse(firstTextStrJson);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.Hidden");
expect(secondText.right).assertEqual(thirdText.left)
expect(secondText.top).assertEqual(thirdText.top);
expect(flexContainer.top).assertEqual(thirdText.top);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(150));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(200));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(vp2px(150));
expect(Math.round(thirdText.right - thirdText.left)).assertEqual(Math.round(secondText.right - secondText.left));
expect(Math.round(flexContainer.right - thirdText.right)).assertEqual(vp2px(50));
expect(Math.round(secondText.left - flexContainer.left)).assertEqual(vp2px(150));
} catch (err) {
console.error('[testWrapWrapTextVisibilityHidden] failed');
expect().assertFail();
}
console.info('[testWrapWrapTextVisibilityHidden] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceAround/Flex_AlignContent_SpaceAround_TextVisibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -16,7 +16,6 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../../MainAbility/common/Common';
import {MessageManager,Callback} from '../../../../MainAbility/common/MessageManager';
export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
describe('Flex_AlignContent_SpaceAround_TextVisibilityTest', function () {
beforeEach(async function (done) {
...
...
@@ -46,82 +45,101 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300
* @tc.name
alignContent_SpaceAround_TextVisibility
* @tc.name
testFlexAlignContentSpaceAroundTextVisibilityHidden
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the
child components when the visibility of parent component was changed
* of the
subcomponents when the visibility of first subcomponent set to Hidden
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
it('testFlexAlignContentSpaceAroundTextVisibilityHidden', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextVisibilityHidden] START');
try {
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
let firstTextStrJson = getInspectorByKey('AlignContent_SpaceAround_TextVisibility01');
let firstTextObj = JSON.parse(firstTextStrJson);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.Hidden");
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round((secondText.top - flexContainer.top)*100)/100)
.assertEqual(Math.round((distanceBefore * 1.5 + vp2px(50))*100)/100); //text1占位
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round((secondText.top - flexContainer.top)*100)/100)
.assertEqual(Math.round((distanceBefore * 1.5 + vp2px(50))*100)/100);
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
expect(Math.round((thirdText.top - secondText.bottom)*10)/10).assertEqual(Math.round(distanceBefore*10)/10); //子组件距离不变
expect(Math.round((flexContainer.bottom -fourthText.bottom)*100)/100)
.assertEqual(Math.round((distanceBefore / 2)*100)/100); //行首距离为子组件距离一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1300] END');
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round((thirdText.top - secondText.bottom)*10)/10).assertEqual(Math.round(distanceBefore*10)/10);
expect(Math.round((flexContainer.bottom -fourthText.bottom)*100)/100)
.assertEqual(Math.round((distanceBefore / 2)*100)/100);
} catch (err) {
console.error('[testFlexAlignContentSpaceAroundTextVisibilityHidden] failed');
expect().assertFail();
}
console.info('[testFlexAlignContentSpaceAroundTextVisibilityHidden] END');
done();
});
/**
* @tc.number SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400
* @tc.name
alignContent_SpaceAround_TextVisibility
* @tc.name
testFlexAlignContentSpaceAroundTextVisibilityNone
* @tc.desc The size of the parent component in the cross direction meets the layout
* of the
child components when the visibility of parent component was changed
* of the
subcomponents when the visibility of first subcomponent set to None
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let distanceBefore = Math.round(secondText.top - firstText.bottom);
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
it('testFlexAlignContentSpaceAroundTextVisibilityNone', 0, async function (done) {
console.info('[testFlexAlignContentSpaceAroundTextVisibilityNone] START');
try {
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let distanceBefore = Math.round(secondText.top - firstText.bottom);
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceAround_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceAround_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceAround');
let firstTextStrJson = getInspectorByKey('AlignContent_SpaceAround_TextVisibility01');
let firstTextObj = JSON.parse(firstTextStrJson);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.None");
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100));
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(distanceBefore); //行距大于设置前
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom));
expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(distanceBefore); //行距大于设置前
expect(Math.round(secondText.top - flexContainer.top))
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom)); //text1不参与占位
expect(Math.round(secondText.top - flexContainer.top))
.assertEqual(Math.round((thirdText.top - secondText.bottom) / 2)); //行首行尾间距为子组件间距一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] END');
expect(Math.round(secondText.top - flexContainer.top))
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
expect(Math.round(secondText.top - flexContainer.top))
.assertEqual(Math.round((thirdText.top - secondText.bottom) / 2));
} catch (err) {
console.error('[testFlexAlignContentSpaceAroundTextVisibilityNone] failed');
expect().assertFail();
}
console.info('[testFlexAlignContentSpaceAroundTextVisibilityNone] END');
done();
});
})
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignContent/SpaceBeTween/Flex_AlignContent_SpaceBetween_TextVisibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -52,33 +52,42 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() {
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1300', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1300] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween');
try {
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween');
let firstTextStrJson = getInspectorByKey('AlignContent_SpaceBetween_TextVisibility01');
let firstTextObj = JSON.parse(firstTextStrJson);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.Hidden");
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100));
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50));
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.top - flexContainer.top)).assertEqual(Math.round(distanceBefore + vp2px(50))); //text1占位
expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.top - flexContainer.top)).assertEqual(Math.round(distanceBefore + vp2px(50))); //text1占位
expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(distanceBefore));
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(distanceBefore));
} catch (err) {
console.error('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1400] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1300] END');
done();
});
...
...
@@ -90,33 +99,42 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() {
*/
it('SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1400', 0, async function (done) {
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1400] START');
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween');
try{
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(3000);
secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let thirdText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility03');
let fourthText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility04');
let flexContainer = CommonFunc.getComponentRect('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerStrJson = getInspectorByKey('FlexAlign_SpaceBetween_TextVisibility_Container01');
let flexContainerObj = JSON.parse(flexContainerStrJson);
expect(flexContainerObj.$type).assertEqual('Flex');
expect(flexContainerObj.$attrs.constructor.wrap).assertEqual('FlexWrap.Wrap');
expect(flexContainerObj.$attrs.constructor.alignContent).assertEqual('FlexAlign.SpaceBetween');
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)
);
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)
);
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
let firstTextStrJson = getInspectorByKey('AlignContent_SpaceBetween_TextVisibility01'
);
let firstTextObj = JSON.parse(firstTextStrJson
);
expect(firstTextObj.$attrs.visibility).assertEqual("Visibility.None");
expect(secondText.left).assertEqual(thirdText.left
);
expect(thirdText.left).assertEqual(fourthText.left
);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(Math.round(secondText.bottom - secondText.top)).assertEqual(vp2px(100)
);
expect(Math.round(thirdText.bottom - thirdText.top)).assertEqual(vp2px(50)
);
expect(Math.round(fourthText.bottom - fourthText.top)).assertEqual(vp2px(100)); //三个子组件的高度分别为100、50、100
expect(secondText.top).assertEqual(flexContainer.top); //text1不参与占位
expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(Math.round(distanceBefore)); //行距大于设置前
expect(secondText.left).assertEqual(thirdText.left);
expect(thirdText.left).assertEqual(fourthText.left);
expect(fourthText.left).assertEqual(flexContainer.left);
expect(secondText.top).assertEqual(flexContainer.top); //text1不参与占位
expect(fourthText.bottom).assertEqual(flexContainer.bottom); //行首行尾贴边
expect(Math.round(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
expect(Math.round(thirdText.top - secondText.bottom)).assertLarger(Math.round(distanceBefore)); //行距大于设置前
} catch (err) {
console.error('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1400] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEBETWEEN_1400] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexVisibilityJsunit.test.ets
浏览文件 @
c4dd162e
...
...
@@ -52,33 +52,35 @@ export default function flexVisibility_AutoJsunit() {
*/
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.None})
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexVisible'
);
let obj1 = JSON.parse(strJson1
);
setTimeout(() =>{
try{
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');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
})
let textVisible01 = CommonFunc.getComponentRect('textVisible01')
let textVisible02 = CommonFunc.getComponentRect('textVisible02')
let textVisible03 = CommonFunc.getComponentRect('textVisible03')
let flexVisible = CommonFunc.getComponentRect('flexVisible')
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let textVisible01 = CommonFunc.getComponentRect('textVisible01')
let textVisible02 = CommonFunc.getComponentRect('textVisible02')
let textVisible03 = CommonFunc.getComponentRect('textVisible03')
let flexVisible = CommonFunc.getComponentRect('flexVisible')
expect(textVisible01.left).assertEqual(textVisible01.right)
expect(textVisible01.right).assertEqual(flexVisible.left)
expect(textVisible02.top).assertEqual(textVisible03.top)
expect(textVisible03.top).assertEqual(flexVisible.top)
expect(Math.round(textVisible02.bottom - textVisible02.top)).assertEqual(vp2px(100))
expect(Math.round(textVisible03.bottom - textVisible03.top)).assertEqual(vp2px(150))
expect(Math.round(textVisible02.right - textVisible02.left)).assertEqual(vp2px(150))
expect(Math.round(textVisible03.right - textVisible03.left)).assertEqual(vp2px(150))
expect(obj1.$attrs.visibility).assertEqual("Visibility.Visible");
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
expect(textVisible01.left).assertEqual(textVisible01.right)
expect(textVisible01.right).assertEqual(flexVisible.left)
expect(textVisible02.top).assertEqual(textVisible03.top)
expect(textVisible03.top).assertEqual(flexVisible.top)
expect(Math.round(textVisible02.bottom - textVisible02.top)).assertEqual(vp2px(100))
expect(Math.round(textVisible03.bottom - textVisible03.top)).assertEqual(vp2px(150))
expect(Math.round(textVisible02.right - textVisible02.left)).assertEqual(vp2px(150))
expect(Math.round(textVisible03.right - textVisible03.left)).assertEqual(vp2px(150))
expect(obj1.$attrs.visibility).assertEqual("Visibility.Visible");
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
} catch (err) {
console.error('[SUB_ACE_FLEXALIGNITEMS_AUTO_1100] failed');
expect().assertFail();
}
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 END');
done();
});
...
...
@@ -90,32 +92,37 @@ export default function flexVisibility_AutoJsunit() {
*/
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1200', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 START');
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexVisible');
let obj1 = JSON.parse(strJson1);
setTimeout(() =>{
try{
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');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
})
let textVisible01 = CommonFunc.getComponentRect('textVisible01');
let textVisible02 = CommonFunc.getComponentRect('textVisible02');
let textVisible03 = CommonFunc.getComponentRect('textVisible03');
let flexVisible = CommonFunc.getComponentRect('flexVisible');
expect(textVisible01.left).assertEqual(flexVisible.left)
expect(textVisible01.right).assertEqual(textVisible02.left)
expect(textVisible02.top).assertEqual(textVisible03.top)
expect(textVisible03.top).assertEqual(flexVisible.top)
expect(Math.round(textVisible01.bottom - textVisible01.top)).assertEqual(vp2px(50))
expect(Math.round(textVisible02.bottom - textVisible02.top)).assertEqual(vp2px(100))
expect(Math.round(textVisible03.bottom - textVisible03.top)).assertEqual(vp2px(150))
expect(Math.round(textVisible01.right - textVisible01.left)).assertEqual(vp2px(150))
expect(Math.round(textVisible02.right - textVisible02.left)).assertEqual(vp2px(150))
expect(Math.round(textVisible03.right - textVisible03.left)).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let textVisible01 = CommonFunc.getComponentRect('textVisible01');
let textVisible02 = CommonFunc.getComponentRect('textVisible02');
let textVisible03 = CommonFunc.getComponentRect('textVisible03');
let flexVisible = CommonFunc.getComponentRect('flexVisible');
expect(textVisible01.left).assertEqual(flexVisible.left)
expect(textVisible01.right).assertEqual(textVisible02.left)
expect(textVisible02.top).assertEqual(textVisible03.top)
expect(textVisible03.top).assertEqual(flexVisible.top)
expect(Math.round(textVisible01.bottom - textVisible01.top)).assertEqual(vp2px(50))
expect(Math.round(textVisible02.bottom - textVisible02.top)).assertEqual(vp2px(100))
expect(Math.round(textVisible03.bottom - textVisible03.top)).assertEqual(vp2px(150))
expect(Math.round(textVisible01.right - textVisible01.left)).assertEqual(vp2px(150))
expect(Math.round(textVisible02.right - textVisible02.left)).assertEqual(vp2px(150))
expect(Math.round(textVisible03.right - textVisible03.left)).assertEqual(vp2px(150))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto')
} catch (err) {
console.error('[SUB_ACE_FLEXALIGNITEMS_AUTO_1200] failed');
expect().assertFail();
}
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddVisibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -52,28 +52,33 @@ export default function AlignCenter_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1000] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Center_AddVisibility_011');
let obj2 = JSON.parse(strJson2)
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let Center_AddVisibility_012 = CommonFunc.getComponentRect('Center_AddVisibility_012');
let Center_AddVisibility_013 = CommonFunc.getComponentRect('Center_AddVisibility_013');
let Center_AddVisibility_01 = CommonFunc.getComponentRect('Center_AddVisibility_01');
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top);
expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left);
expect(Math.round(Center_AddVisibility_012.left - Center_AddVisibility_01.left)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_01.right - Center_AddVisibility_013.right)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150));
try {
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Center_AddVisibility_011');
let obj2 = JSON.parse(strJson2)
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let Center_AddVisibility_012 = CommonFunc.getComponentRect('Center_AddVisibility_012');
let Center_AddVisibility_013 = CommonFunc.getComponentRect('Center_AddVisibility_013');
let Center_AddVisibility_01 = CommonFunc.getComponentRect('Center_AddVisibility_01');
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top);
expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left);
expect(Math.round(Center_AddVisibility_012.left - Center_AddVisibility_01.left)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_01.right - Center_AddVisibility_013.right)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1000] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1000] END');
done();
});
...
...
@@ -85,35 +90,40 @@ export default function AlignCenter_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1100] START');
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Center_AddVisibility_011');
let obj2 = JSON.parse(strJson2)
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let Center_AddVisibility_011 = CommonFunc.getComponentRect('Center_AddVisibility_011');
let Center_AddVisibility_012 = CommonFunc.getComponentRect('Center_AddVisibility_012');
let Center_AddVisibility_013 = CommonFunc.getComponentRect('Center_AddVisibility_013');
let Center_AddVisibility_01 = CommonFunc.getComponentRect('Center_AddVisibility_01');
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_011.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top);
expect(Center_AddVisibility_011.right).assertEqual(Center_AddVisibility_012.left);
expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left);
expect(Math.round((Center_AddVisibility_011.left - Center_AddVisibility_01.left)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round((Center_AddVisibility_01.right - Center_AddVisibility_013.right)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round(Center_AddVisibility_011.right - Center_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Center_AddVisibility_011');
let obj2 = JSON.parse(strJson2)
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let Center_AddVisibility_011 = CommonFunc.getComponentRect('Center_AddVisibility_011');
let Center_AddVisibility_012 = CommonFunc.getComponentRect('Center_AddVisibility_012');
let Center_AddVisibility_013 = CommonFunc.getComponentRect('Center_AddVisibility_013');
let Center_AddVisibility_01 = CommonFunc.getComponentRect('Center_AddVisibility_01');
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_011.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top);
expect(Center_AddVisibility_011.right).assertEqual(Center_AddVisibility_012.left);
expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left);
expect(Math.round((Center_AddVisibility_011.left - Center_AddVisibility_01.left)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round((Center_AddVisibility_01.right - Center_AddVisibility_013.right)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round(Center_AddVisibility_011.right - Center_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1100] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1100] END');
done();
});
...
...
@@ -125,35 +135,40 @@ export default function AlignCenter_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1700', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1700] START');
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Center_AddVisibility_011');
let obj2 = JSON.parse(strJson2)
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let Center_AddVisibility_011 = CommonFunc.getComponentRect('Center_AddVisibility_011');
let Center_AddVisibility_012 = CommonFunc.getComponentRect('Center_AddVisibility_012');
let Center_AddVisibility_013 = CommonFunc.getComponentRect('Center_AddVisibility_013');
let Center_AddVisibility_01 = CommonFunc.getComponentRect('Center_AddVisibility_01');
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_011.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top);
expect(Center_AddVisibility_011.right).assertEqual(Center_AddVisibility_012.left);
expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left);
expect(Math.round((Center_AddVisibility_011.left - Center_AddVisibility_01.left)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round((Center_AddVisibility_01.right - Center_AddVisibility_013.right)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round(Center_AddVisibility_011.right - Center_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Center_AddVisibility_011');
let obj2 = JSON.parse(strJson2)
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Center');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let Center_AddVisibility_011 = CommonFunc.getComponentRect('Center_AddVisibility_011');
let Center_AddVisibility_012 = CommonFunc.getComponentRect('Center_AddVisibility_012');
let Center_AddVisibility_013 = CommonFunc.getComponentRect('Center_AddVisibility_013');
let Center_AddVisibility_01 = CommonFunc.getComponentRect('Center_AddVisibility_01');
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_013.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_011.top);
expect(Center_AddVisibility_012.top).assertEqual(Center_AddVisibility_01.top);
expect(Center_AddVisibility_011.right).assertEqual(Center_AddVisibility_012.left);
expect(Center_AddVisibility_012.right).assertEqual(Center_AddVisibility_013.left);
expect(Math.round((Center_AddVisibility_011.left - Center_AddVisibility_01.left)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round((Center_AddVisibility_01.right - Center_AddVisibility_013.right)*10)/10)
.assertEqual(Math.round(vp2px(25)*10)/10);
expect(Math.round(Center_AddVisibility_011.right - Center_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_012.right - Center_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_013.right - Center_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Center_AddVisibility_011.bottom - Center_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Center_AddVisibility_012.bottom - Center_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Center_AddVisibility_013.bottom - Center_AddVisibility_013.top)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1700] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1700] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddVisibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -52,28 +52,33 @@ export default function AlignEnd_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_012.right).assertEqual(End_AddVisibility_013.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(Math.round(End_AddVisibility_012.left - End_AddVisibility_01.left)).assertEqual(vp2px(200));
expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_012.right).assertEqual(End_AddVisibility_013.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(Math.round(End_AddVisibility_012.left - End_AddVisibility_01.left)).assertEqual(vp2px(200));
expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1000] END');
done();
});
...
...
@@ -85,33 +90,38 @@ export default function AlignEnd_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let End_AddVisibility_011 = CommonFunc.getComponentRect('End_AddVisibility_011');
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_011.top).assertEqual(End_AddVisibility_012.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right);
expect(Math.round(End_AddVisibility_011.left - End_AddVisibility_01.left)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_011.right - End_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_011.bottom - End_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let End_AddVisibility_011 = CommonFunc.getComponentRect('End_AddVisibility_011');
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_011.top).assertEqual(End_AddVisibility_012.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right);
expect(Math.round(End_AddVisibility_011.left - End_AddVisibility_01.left)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_011.right - End_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_011.bottom - End_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1100] END');
done();
});
...
...
@@ -123,33 +133,38 @@ export default function AlignEnd_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1700', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1700] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Visible})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let End_AddVisibility_011 = CommonFunc.getComponentRect('End_AddVisibility_011');
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_011.top).assertEqual(End_AddVisibility_012.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right);
expect(Math.round(End_AddVisibility_011.left - End_AddVisibility_01.left)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_011.right - End_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_011.bottom - End_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Visible})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('End_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.End');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let End_AddVisibility_011 = CommonFunc.getComponentRect('End_AddVisibility_011');
let End_AddVisibility_012 = CommonFunc.getComponentRect('End_AddVisibility_012');
let End_AddVisibility_013 = CommonFunc.getComponentRect('End_AddVisibility_013');
let End_AddVisibility_01 = CommonFunc.getComponentRect('End_AddVisibility_01');
expect(End_AddVisibility_011.top).assertEqual(End_AddVisibility_012.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_013.top);
expect(End_AddVisibility_012.top).assertEqual(End_AddVisibility_01.top);
expect(End_AddVisibility_011.right).assertEqual(End_AddVisibility_012.left);
expect(End_AddVisibility_013.right).assertEqual(End_AddVisibility_01.right);
expect(End_AddVisibility_013.left).assertEqual(End_AddVisibility_012.right);
expect(Math.round(End_AddVisibility_011.left - End_AddVisibility_01.left)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_011.right - End_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_012.right - End_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_013.right - End_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(End_AddVisibility_011.bottom - End_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(End_AddVisibility_012.bottom - End_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(End_AddVisibility_013.bottom - End_AddVisibility_013.top)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1700] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1700] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddVisibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -52,35 +52,40 @@ export default function AlignSpaceEvenly_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1000] START');
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('SpaceEvenly_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceEvenly');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let SpaceEvenly_AddVisibility_012 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_012');
let SpaceEvenly_AddVisibility_013 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_013');
let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01');
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top);
expect(Math.round(SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_01.left))
.assertEqual(Math.round(vp2px(200/3)));
expect(Math.round(SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right))
.assertEqual(Math.round(vp2px(200/3)));
expect(Math.round(SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right))
.assertEqual(Math.round(vp2px(200/3)));
expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left ))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top))
.assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top))
.assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('SpaceEvenly_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceEvenly');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let SpaceEvenly_AddVisibility_012 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_012');
let SpaceEvenly_AddVisibility_013 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_013');
let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01');
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top);
expect(Math.round(SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_01.left))
.assertEqual(Math.round(vp2px(200/3)));
expect(Math.round(SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right))
.assertEqual(Math.round(vp2px(200/3)));
expect(Math.round(SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right))
.assertEqual(Math.round(vp2px(200/3)));
expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left ))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top))
.assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top))
.assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1000] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1000] END');
done();
});
...
...
@@ -92,43 +97,48 @@ export default function AlignSpaceEvenly_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1100] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('SpaceEvenly_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceEvenly');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let SpaceEvenly_AddVisibility_011 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_011');
let SpaceEvenly_AddVisibility_012 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_012');
let SpaceEvenly_AddVisibility_013 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_013');
let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01');
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_011.top);
expect(Math.round((SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top))
.assertEqual(vp2px(50));
expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top))
.assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top))
.assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('SpaceEvenly_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceEvenly');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let SpaceEvenly_AddVisibility_011 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_011');
let SpaceEvenly_AddVisibility_012 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_012');
let SpaceEvenly_AddVisibility_013 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_013');
let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01');
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_011.top);
expect(Math.round((SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top))
.assertEqual(vp2px(50));
expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top))
.assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top))
.assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1100] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1100] END');
done();
});
...
...
@@ -140,43 +150,48 @@ export default function AlignSpaceEvenly_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1700', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1700] START');
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('SpaceEvenly_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceEvenly');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let SpaceEvenly_AddVisibility_011 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_011');
let SpaceEvenly_AddVisibility_012 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_012');
let SpaceEvenly_AddVisibility_013 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_013');
let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01');
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_011.top);
expect(Math.round((SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top))
.assertEqual(vp2px(50));
expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top))
.assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top))
.assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('SpaceEvenly_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.SpaceEvenly');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let SpaceEvenly_AddVisibility_011 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_011');
let SpaceEvenly_AddVisibility_012 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_012');
let SpaceEvenly_AddVisibility_013 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_013');
let SpaceEvenly_AddVisibility_01 = CommonFunc.getComponentRect('SpaceEvenly_AddVisibility_01');
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_013.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_01.top);
expect(SpaceEvenly_AddVisibility_012.top).assertEqual(SpaceEvenly_AddVisibility_011.top);
expect(Math.round((SpaceEvenly_AddVisibility_011.left - SpaceEvenly_AddVisibility_01.left)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_01.right - SpaceEvenly_AddVisibility_013.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_012.left - SpaceEvenly_AddVisibility_011.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round((SpaceEvenly_AddVisibility_013.left - SpaceEvenly_AddVisibility_012.right)*100)/100)
.assertEqual(Math.round(vp2px(12.5)*100)/100);
expect(Math.round(SpaceEvenly_AddVisibility_011.right - SpaceEvenly_AddVisibility_011.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_012.right - SpaceEvenly_AddVisibility_012.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_013.right - SpaceEvenly_AddVisibility_013.left))
.assertEqual(vp2px(150));
expect(Math.round(SpaceEvenly_AddVisibility_011.bottom - SpaceEvenly_AddVisibility_011.top))
.assertEqual(vp2px(50));
expect(Math.round(SpaceEvenly_AddVisibility_012.bottom - SpaceEvenly_AddVisibility_012.top))
.assertEqual(vp2px(100));
expect(Math.round(SpaceEvenly_AddVisibility_013.bottom - SpaceEvenly_AddVisibility_013.top))
.assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1700] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1700] END');
done();
});
...
...
arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddVisibility.test.ets
浏览文件 @
c4dd162e
...
...
@@ -50,28 +50,33 @@ export default function AlignStart_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1000', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1000] START');
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Start_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let Start_AddVisibility_012 = CommonFunc.getComponentRect('Start_AddVisibility_012');
let Start_AddVisibility_013 = CommonFunc.getComponentRect('Start_AddVisibility_013');
let Start_AddVisibility_01 = CommonFunc.getComponentRect('Start_AddVisibility_01');
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_013.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top);
expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_01.left);
expect(Start_AddVisibility_012.right).assertEqual(Start_AddVisibility_013.left);
expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_01.right - Start_AddVisibility_013.right)).assertEqual(vp2px(200));
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Start_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let Start_AddVisibility_012 = CommonFunc.getComponentRect('Start_AddVisibility_012');
let Start_AddVisibility_013 = CommonFunc.getComponentRect('Start_AddVisibility_013');
let Start_AddVisibility_01 = CommonFunc.getComponentRect('Start_AddVisibility_01');
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_013.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top);
expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_01.left);
expect(Start_AddVisibility_012.right).assertEqual(Start_AddVisibility_013.left);
expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_01.right - Start_AddVisibility_013.right)).assertEqual(vp2px(200));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1000] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1000] END');
done();
});
...
...
@@ -83,33 +88,38 @@ export default function AlignStart_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1100', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1100] START');
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Start_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let Start_AddVisibility_011 = CommonFunc.getComponentRect('Start_AddVisibility_011');
let Start_AddVisibility_012 = CommonFunc.getComponentRect('Start_AddVisibility_012');
let Start_AddVisibility_013 = CommonFunc.getComponentRect('Start_AddVisibility_013');
let Start_AddVisibility_01 = CommonFunc.getComponentRect('Start_AddVisibility_01');
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_011.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_013.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top);
expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_011.right);
expect(Start_AddVisibility_013.left).assertEqual(Start_AddVisibility_012.right);
expect(Start_AddVisibility_01.left).assertEqual(Start_AddVisibility_011.left);
expect(Math.round(Start_AddVisibility_011.right - Start_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.left - Start_AddVisibility_01.left)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Start_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
let Start_AddVisibility_011 = CommonFunc.getComponentRect('Start_AddVisibility_011');
let Start_AddVisibility_012 = CommonFunc.getComponentRect('Start_AddVisibility_012');
let Start_AddVisibility_013 = CommonFunc.getComponentRect('Start_AddVisibility_013');
let Start_AddVisibility_01 = CommonFunc.getComponentRect('Start_AddVisibility_01');
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_011.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_013.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top);
expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_011.right);
expect(Start_AddVisibility_013.left).assertEqual(Start_AddVisibility_012.right);
expect(Start_AddVisibility_01.left).assertEqual(Start_AddVisibility_011.left);
expect(Math.round(Start_AddVisibility_011.right - Start_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.left - Start_AddVisibility_01.left)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1100] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1100] END');
done();
});
...
...
@@ -121,33 +131,38 @@ export default function AlignStart_AddVisibility() {
*/
it('SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1700', 0, async function (done) {
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1700] START');
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Start_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let Start_AddVisibility_011 = CommonFunc.getComponentRect('Start_AddVisibility_011');
let Start_AddVisibility_012 = CommonFunc.getComponentRect('Start_AddVisibility_012');
let Start_AddVisibility_013 = CommonFunc.getComponentRect('Start_AddVisibility_013');
let Start_AddVisibility_01 = CommonFunc.getComponentRect('Start_AddVisibility_01');
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_011.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_013.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top);
expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_011.right);
expect(Start_AddVisibility_013.left).assertEqual(Start_AddVisibility_012.right);
expect(Start_AddVisibility_01.left).assertEqual(Start_AddVisibility_011.left);
expect(Math.round(Start_AddVisibility_011.right - Start_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.left - Start_AddVisibility_01.left)).assertEqual(vp2px(150));
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
let obj = JSON.parse(strJson);
let strJson2 = getInspectorByKey('Start_AddVisibility_011');
let obj2 = JSON.parse(strJson2);
expect(obj.$type).assertEqual('Flex');
expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row');
expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start');
expect(obj2.$attrs.visibility).assertEqual("Visibility.Visible");
let Start_AddVisibility_011 = CommonFunc.getComponentRect('Start_AddVisibility_011');
let Start_AddVisibility_012 = CommonFunc.getComponentRect('Start_AddVisibility_012');
let Start_AddVisibility_013 = CommonFunc.getComponentRect('Start_AddVisibility_013');
let Start_AddVisibility_01 = CommonFunc.getComponentRect('Start_AddVisibility_01');
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_011.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_013.top);
expect(Start_AddVisibility_012.top).assertEqual(Start_AddVisibility_01.top);
expect(Start_AddVisibility_012.left).assertEqual(Start_AddVisibility_011.right);
expect(Start_AddVisibility_013.left).assertEqual(Start_AddVisibility_012.right);
expect(Start_AddVisibility_01.left).assertEqual(Start_AddVisibility_011.left);
expect(Math.round(Start_AddVisibility_011.right - Start_AddVisibility_011.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.right - Start_AddVisibility_012.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_013.right - Start_AddVisibility_013.left)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_011.bottom - Start_AddVisibility_011.top)).assertEqual(vp2px(50));
expect(Math.round(Start_AddVisibility_012.bottom - Start_AddVisibility_012.top)).assertEqual(vp2px(100));
expect(Math.round(Start_AddVisibility_013.bottom - Start_AddVisibility_013.top)).assertEqual(vp2px(150));
expect(Math.round(Start_AddVisibility_012.left - Start_AddVisibility_01.left)).assertEqual(vp2px(150));
} catch (err) {
console.error('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1700] failed');
expect().assertFail();
}
console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1700] END');
done();
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录