提交 c4dd162e 编写于 作者: W wmlih

test:add testcase Abnormal protection

Signed-off-by: Nwmlih <wmlih@isoftstone.com>
上级 e0ec19de
......@@ -51,6 +51,7 @@ export default function flex_Wrap_VisibilityTest() {
*/
it('testWrapWrapTextVisibilityNoneOverflow', 0, async function (done) {
console.info('[testWrapWrapTextVisibilityNoneOverflow] START');
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});
......@@ -64,6 +65,10 @@ export default function flex_Wrap_VisibilityTest() {
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);
......@@ -77,6 +82,10 @@ export default function flex_Wrap_VisibilityTest() {
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,6 +97,7 @@ export default function flex_Wrap_VisibilityTest() {
*/
it('testWrapWrapTextVisibilityNoneMeet', 0, async function (done) {
console.info('[testWrapWrapTextVisibilityNoneMeet] START');
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});
......@@ -101,6 +111,10 @@ export default function flex_Wrap_VisibilityTest() {
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);
......@@ -113,6 +127,10 @@ export default function flex_Wrap_VisibilityTest() {
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,6 +142,7 @@ export default function flex_Wrap_VisibilityTest() {
*/
it('testWrapWrapTextVisibilityHidden', 0, async function (done) {
console.info('[testWrapWrapTextVisibilityHidden] START');
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});
......@@ -137,6 +156,10 @@ export default function flex_Wrap_VisibilityTest() {
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);
......@@ -149,6 +172,10 @@ export default function flex_Wrap_VisibilityTest() {
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,12 +45,13 @@ 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');
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;
......@@ -66,31 +66,41 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
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)); //三个子组件的高度分别为100、50、100
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占位
.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(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');
.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');
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);
......@@ -106,22 +116,30 @@ export default function flex_AlignContent_SpaceAround_TextVisibilityTest() {
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(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(thirdText.top - secondText.bottom)).assertEqual(Math.round(fourthText.top - thirdText.bottom)); //剩余子组件行间距相等
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不参与占位
.assertEqual(Math.round(flexContainer.bottom - fourthText.bottom));
expect(Math.round(secondText.top - flexContainer.top))
.assertEqual(Math.round((thirdText.top - secondText.bottom) / 2)); //行首行尾间距为子组件间距一半
console.info('[SUB_ACE_FLEXALIGNCONTENT_SPACEAROUND_1400] END');
.assertEqual(Math.round((thirdText.top - secondText.bottom) / 2));
} catch (err) {
console.error('[testFlexAlignContentSpaceAroundTextVisibilityNone] failed');
expect().assertFail();
}
console.info('[testFlexAlignContentSpaceAroundTextVisibilityNone] END');
done();
});
})
......
......@@ -52,6 +52,7 @@ 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');
try {
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
......@@ -67,6 +68,10 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() {
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
......@@ -79,6 +84,10 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() {
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,6 +99,7 @@ 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');
try{
let firstText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility01');
let secondText = CommonFunc.getComponentRect('AlignContent_SpaceBetween_TextVisibility02');
let distanceBefore = secondText.top - firstText.bottom;
......@@ -105,6 +115,10 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() {
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.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
......@@ -117,6 +131,10 @@ export default function flex_AlignContent_SpaceBetween_TextVisibilityTest() {
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,15 +52,14 @@ export default function flexVisibility_AutoJsunit() {
*/
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1100', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1100 START');
try{
globalThis.value.message.notify({name:'visibility', value:Visibility.None})
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexVisible');
let obj1 = JSON.parse(strJson1);
setTimeout(() =>{
let strJson2 = getInspectorByKey('textVisible01');
let obj2 = JSON.parse(strJson2);
expect(obj2.$attrs.visibility).assertEqual("Visibility.Hidden");
})
expect(obj2.$attrs.visibility).assertEqual("Visibility.None");
let textVisible01 = CommonFunc.getComponentRect('textVisible01')
let textVisible02 = CommonFunc.getComponentRect('textVisible02')
let textVisible03 = CommonFunc.getComponentRect('textVisible03')
......@@ -78,7 +77,10 @@ export default function flexVisibility_AutoJsunit() {
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,15 +92,16 @@ export default function flexVisibility_AutoJsunit() {
*/
it('SUB_ACE_FLEXALIGNITEMS_AUTO_1200', 0, async function (done) {
console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1200 START');
try{
globalThis.value.message.notify({name:'visibility', value:Visibility.Hidden});
await CommonFunc.sleep(2000);
let strJson1 = getInspectorByKey('flexVisible');
let obj1 = JSON.parse(strJson1);
setTimeout(() =>{
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');
......@@ -116,6 +119,10 @@ export default function flexVisibility_AutoJsunit() {
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,6 +52,7 @@ 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');
try {
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
......@@ -74,6 +75,10 @@ export default function AlignCenter_AddVisibility() {
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,6 +90,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
......@@ -114,6 +120,10 @@ export default function AlignCenter_AddVisibility() {
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,6 +135,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Center_AddVisibility_01');
......@@ -154,6 +165,10 @@ export default function AlignCenter_AddVisibility() {
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,6 +52,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
......@@ -74,6 +75,10 @@ export default function AlignEnd_AddVisibility() {
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,6 +90,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
......@@ -112,6 +118,10 @@ export default function AlignEnd_AddVisibility() {
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,6 +133,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Visible})
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('End_AddVisibility_01');
......@@ -150,6 +161,10 @@ export default function AlignEnd_AddVisibility() {
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,6 +52,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
......@@ -81,6 +82,10 @@ export default function AlignSpaceEvenly_AddVisibility() {
.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,6 +97,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
......@@ -129,6 +135,10 @@ export default function AlignSpaceEvenly_AddVisibility() {
.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,6 +150,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility',value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('SpaceEvenly_AddVisibility_01');
......@@ -177,6 +188,10 @@ export default function AlignSpaceEvenly_AddVisibility() {
.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,6 +50,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.None});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
......@@ -72,6 +73,10 @@ export default function AlignStart_AddVisibility() {
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,6 +88,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Hidden});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
......@@ -110,6 +116,10 @@ export default function AlignStart_AddVisibility() {
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,6 +131,7 @@ 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');
try{
globalThis.value.message.notify({name:'OneVisibility', value:Visibility.Visible});
await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Start_AddVisibility_01');
......@@ -148,6 +159,10 @@ export default function AlignStart_AddVisibility() {
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.
先完成此消息的编辑!
想要评论请 注册