未验证 提交 6c7300dc 编写于 作者: O openharmony_ci 提交者: Gitee

!8443 test:add testcase Abnormal protection

Merge pull request !8443 from 李伟明/fix_issue
......@@ -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();
});
......
......@@ -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();
});
})
......
......@@ -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();
});
......
......@@ -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();
});
......
......@@ -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();
});
......
......@@ -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();
});
......
......@@ -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();
});
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册