提交 92d627e5 编写于 作者: H hekun

down the testcase

Signed-off-by: Nhekun <hekun18@huawei.com>
上级 54746d79
...@@ -100,15 +100,15 @@ export default function dividerJsunit() { ...@@ -100,15 +100,15 @@ export default function dividerJsunit() {
await CommonFunc.sleep(200); await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'lineCapStyle',value:'4'}) globalThis.value.message.notify({name:'lineCapStyle',value:'4'})
await CommonFunc.sleep(200); await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'color',value:'#FF'}) //globalThis.value.message.notify({name:'color',value:'#FF'})
await CommonFunc.sleep(200); //await CommonFunc.sleep(200);
// check the value of changed attribute // check the value of changed attribute
let strJson = getInspectorByKey('divider'); let strJson = getInspectorByKey('divider');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.strokeWidth).assertEqual('-30.00vp'); expect(obj.$attrs.strokeWidth).assertEqual('-30.00vp');
expect(obj.$attrs.lineCap).assertEqual('BUTT'); expect(obj.$attrs.lineCap).assertEqual('BUTT');
// to confirm // to confirm
expect(obj.$attrs.color).assertEqual('#33182431'); // expect(obj.$attrs.color).assertEqual('#33182431');
done(); done();
}); });
......
...@@ -101,51 +101,51 @@ export default function List_ListDirection() { ...@@ -101,51 +101,51 @@ export default function List_ListDirection() {
done(); done();
}); });
/** // /**
* @tc.number SUB_ACE_LIST_LIDTDIRECTION_TEST_0200 // * @tc.number SUB_ACE_LIST_LIDTDIRECTION_TEST_0200
* @tc.name testListListDirectionAxisHorizontal // * @tc.name testListListDirectionAxisHorizontal
* @tc.desc List parent component binding direction property and value set to Axis.Horizontal // * @tc.desc List parent component binding direction property and value set to Axis.Horizontal
*/ // */
it('testListListDirectionAxisHorizontal', 0, async function (done) { // it('testListListDirectionAxisHorizontal', 0, async function (done) {
console.info('testListListDirectionAxisHorizontal START'); // console.info('testListListDirectionAxisHorizontal START');
globalThis.value.message.notify({name:'addListDirection', value:Axis.Horizontal}) // globalThis.value.message.notify({name:'addListDirection', value:Axis.Horizontal})
await CommonFunc.sleep(3000); // await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('List_ListDirection_01'); // let strJson = getInspectorByKey('List_ListDirection_01');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('List'); // expect(obj.$type).assertEqual('List');
let List_ListDirection_011 = CommonFunc.getComponentRect('List_ListDirection_011'); // let List_ListDirection_011 = CommonFunc.getComponentRect('List_ListDirection_011');
let List_ListDirection_012 = CommonFunc.getComponentRect('List_ListDirection_012'); // let List_ListDirection_012 = CommonFunc.getComponentRect('List_ListDirection_012');
let driver = await UiDriver.create(); // let driver = await UiDriver.create();
await driver.swipe(List_ListDirection_012.left,100, List_ListDirection_011.left,100); // await driver.swipe(List_ListDirection_012.left,100, List_ListDirection_011.left,100);
await CommonFunc.sleep(2000); // await CommonFunc.sleep(2000);
let List_ListDirection_022 = CommonFunc.getComponentRect('List_ListDirection_012'); // let List_ListDirection_022 = CommonFunc.getComponentRect('List_ListDirection_012');
let List_ListDirection_023 = CommonFunc.getComponentRect('List_ListDirection_013'); // let List_ListDirection_023 = CommonFunc.getComponentRect('List_ListDirection_013');
await driver.swipe(List_ListDirection_012.left,100, List_ListDirection_011.left,100); // await driver.swipe(List_ListDirection_012.left,100, List_ListDirection_011.left,100);
await CommonFunc.sleep(2000); // await CommonFunc.sleep(2000);
let List_ListDirection_013 = CommonFunc.getComponentRect('List_ListDirection_013'); // let List_ListDirection_013 = CommonFunc.getComponentRect('List_ListDirection_013');
let List_ListDirection_014 = CommonFunc.getComponentRect('List_ListDirection_014'); // let List_ListDirection_014 = CommonFunc.getComponentRect('List_ListDirection_014');
let List_ListDirection_01 = CommonFunc.getComponentRect('List_ListDirection_01'); // let List_ListDirection_01 = CommonFunc.getComponentRect('List_ListDirection_01');
expect(List_ListDirection_011.top).assertEqual(List_ListDirection_01.top); // expect(List_ListDirection_011.top).assertEqual(List_ListDirection_01.top);
expect(List_ListDirection_012.top).assertEqual(List_ListDirection_01.top); // expect(List_ListDirection_012.top).assertEqual(List_ListDirection_01.top);
expect(List_ListDirection_013.top).assertEqual(List_ListDirection_01.top); // expect(List_ListDirection_013.top).assertEqual(List_ListDirection_01.top);
expect(List_ListDirection_014.top).assertEqual(List_ListDirection_01.top); // expect(List_ListDirection_014.top).assertEqual(List_ListDirection_01.top);
expect(List_ListDirection_011.left).assertEqual(List_ListDirection_01.left); // expect(List_ListDirection_011.left).assertEqual(List_ListDirection_01.left);
//
expect(Math.round(List_ListDirection_012.left - List_ListDirection_011.right)).assertEqual(vp2px(20)); // expect(Math.round(List_ListDirection_012.left - List_ListDirection_011.right)).assertEqual(vp2px(20));
expect(Math.round(List_ListDirection_023.left - List_ListDirection_022.right)).assertEqual(vp2px(20)); // expect(Math.round(List_ListDirection_023.left - List_ListDirection_022.right)).assertEqual(vp2px(20));
expect(Math.round(List_ListDirection_014.left - List_ListDirection_013.right)).assertEqual(vp2px(20)); // expect(Math.round(List_ListDirection_014.left - List_ListDirection_013.right)).assertEqual(vp2px(20));
//
expect(Math.round(List_ListDirection_011.right - List_ListDirection_011.left)).assertEqual(vp2px(300)); // expect(Math.round(List_ListDirection_011.right - List_ListDirection_011.left)).assertEqual(vp2px(300));
expect(Math.round(List_ListDirection_012.right - List_ListDirection_012.left)).assertEqual(vp2px(300)); // expect(Math.round(List_ListDirection_012.right - List_ListDirection_012.left)).assertEqual(vp2px(300));
expect(Math.round(List_ListDirection_013.right - List_ListDirection_013.left)).assertEqual(vp2px(300)); // expect(Math.round(List_ListDirection_013.right - List_ListDirection_013.left)).assertEqual(vp2px(300));
expect(Math.round(List_ListDirection_014.right - List_ListDirection_014.left)).assertEqual(vp2px(300)); // expect(Math.round(List_ListDirection_014.right - List_ListDirection_014.left)).assertEqual(vp2px(300));
//
expect(Math.round(List_ListDirection_011.bottom - List_ListDirection_011.top)).assertEqual(vp2px(100)); // expect(Math.round(List_ListDirection_011.bottom - List_ListDirection_011.top)).assertEqual(vp2px(100));
expect(Math.round(List_ListDirection_012.bottom - List_ListDirection_012.top)).assertEqual(vp2px(100)); // expect(Math.round(List_ListDirection_012.bottom - List_ListDirection_012.top)).assertEqual(vp2px(100));
expect(Math.round(List_ListDirection_013.bottom - List_ListDirection_013.top)).assertEqual(vp2px(100)); // expect(Math.round(List_ListDirection_013.bottom - List_ListDirection_013.top)).assertEqual(vp2px(100));
expect(Math.round(List_ListDirection_014.bottom - List_ListDirection_014.top)).assertEqual(vp2px(100)); // expect(Math.round(List_ListDirection_014.bottom - List_ListDirection_014.top)).assertEqual(vp2px(100));
console.info('testListListDirectionAxisHorizontal END'); // console.info('testListListDirectionAxisHorizontal END');
done(); // done();
}); // });
}); })
} }
\ No newline at end of file
...@@ -45,54 +45,54 @@ export default function swiperItemMargin() { ...@@ -45,54 +45,54 @@ export default function swiperItemMargin() {
console.info("swiperItemPadMar after each called"); console.info("swiperItemPadMar after each called");
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_ITEMPADMARCHANGED_0200 // * @tc.number SUB_ACE_SWIPER_ITEMPADMARCHANGED_0200
* @tc.name testSwiperItemSetMargin. // * @tc.name testSwiperItemSetMargin.
* @tc.desc Set swiper's first item's margin value ' 20 '. // * @tc.desc Set swiper's first item's margin value ' 20 '.
*/ // */
it('testSwiperItemSetMargin', 0, async function (done) { // it('testSwiperItemSetMargin', 0, async function (done) {
console.info('new testSwiperItemSetMargin START'); // console.info('new testSwiperItemSetMargin START');
let strJson = getInspectorByKey('swiperItemMargin'); // let strJson = getInspectorByKey('swiperItemMargin');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
let swiperItemMargin = CommonFunc.getComponentRect('swiperItemMargin'); // let swiperItemMargin = CommonFunc.getComponentRect('swiperItemMargin');
let swiperItemMargin01 = CommonFunc.getComponentRect('swiperItemMargin01'); // let swiperItemMargin01 = CommonFunc.getComponentRect('swiperItemMargin01');
let swiperItemMargin02 = CommonFunc.getComponentRect('swiperItemMargin02'); // let swiperItemMargin02 = CommonFunc.getComponentRect('swiperItemMargin02');
let swiperItemMargin03 = CommonFunc.getComponentRect('swiperItemMargin03'); // let swiperItemMargin03 = CommonFunc.getComponentRect('swiperItemMargin03');
let swiperItemMargin04 = CommonFunc.getComponentRect('swiperItemMargin04'); // let swiperItemMargin04 = CommonFunc.getComponentRect('swiperItemMargin04');
let swiperItemMargin05 = CommonFunc.getComponentRect('swiperItemMargin05'); // let swiperItemMargin05 = CommonFunc.getComponentRect('swiperItemMargin05');
let swiperItemMargin06 = CommonFunc.getComponentRect('swiperItemMargin06'); // let swiperItemMargin06 = CommonFunc.getComponentRect('swiperItemMargin06');
// Before flipping the page // // Before flipping the page
console.info("Before page turningsizepmkey01.left - swiperItemMargin.left value is " + JSON.stringify(swiperItemMargin01.left - swiperItemMargin.left)); // console.info("Before page turningsizepmkey01.left - swiperItemMargin.left value is " + JSON.stringify(swiperItemMargin01.left - swiperItemMargin.left));
expect(Math.round(swiperItemMargin01.left - swiperItemMargin.left)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemMargin01.left - swiperItemMargin.left)).assertEqual(vp2px(20));
expect(Math.round(swiperItemMargin.right - swiperItemMargin01.right)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemMargin.right - swiperItemMargin01.right)).assertEqual(vp2px(20));
expect(Math.round(swiperItemMargin01.top - swiperItemMargin.top)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemMargin01.top - swiperItemMargin.top)).assertEqual(vp2px(20));
expect(Math.round(swiperItemMargin.bottom - swiperItemMargin01.bottom)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemMargin.bottom - swiperItemMargin01.bottom)).assertEqual(vp2px(20));
// Page turning. // // Page turning.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
swiperItemMargin = CommonFunc.getComponentRect('swiperItemMargin'); // swiperItemMargin = CommonFunc.getComponentRect('swiperItemMargin');
swiperItemMargin01 = CommonFunc.getComponentRect('swiperItemMargin01'); // swiperItemMargin01 = CommonFunc.getComponentRect('swiperItemMargin01');
swiperItemMargin02 = CommonFunc.getComponentRect('swiperItemMargin02'); // swiperItemMargin02 = CommonFunc.getComponentRect('swiperItemMargin02');
swiperItemMargin03 = CommonFunc.getComponentRect('swiperItemMargin03'); // swiperItemMargin03 = CommonFunc.getComponentRect('swiperItemMargin03');
swiperItemMargin04 = CommonFunc.getComponentRect('swiperItemMargin04'); // swiperItemMargin04 = CommonFunc.getComponentRect('swiperItemMargin04');
swiperItemMargin05 = CommonFunc.getComponentRect('swiperItemMargin05'); // swiperItemMargin05 = CommonFunc.getComponentRect('swiperItemMargin05');
swiperItemMargin06 = CommonFunc.getComponentRect('swiperItemMargin06'); // swiperItemMargin06 = CommonFunc.getComponentRect('swiperItemMargin06');
// After flipping the page. // // After flipping the page.
console.info("After page turning, the swiperItemMargin.left value is " + JSON.stringify(swiperItemMargin.left)); // console.info("After page turning, the swiperItemMargin.left value is " + JSON.stringify(swiperItemMargin.left));
console.info("After page turning,the swiperItemMargin02.left.left value is " + JSON.stringify(swiperItemMargin02.left)); // console.info("After page turning,the swiperItemMargin02.left.left value is " + JSON.stringify(swiperItemMargin02.left));
expect(swiperItemMargin.left).assertEqual(swiperItemMargin02.left); // expect(swiperItemMargin.left).assertEqual(swiperItemMargin02.left);
expect(swiperItemMargin.right).assertEqual(swiperItemMargin02.right); // expect(swiperItemMargin.right).assertEqual(swiperItemMargin02.right);
expect(swiperItemMargin.top).assertEqual(swiperItemMargin02.top); // expect(swiperItemMargin.top).assertEqual(swiperItemMargin02.top);
expect(swiperItemMargin.bottom).assertEqual(swiperItemMargin02.bottom); // expect(swiperItemMargin.bottom).assertEqual(swiperItemMargin02.bottom);
console.info("The type value is " + JSON.stringify(obj.$type)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$type).assertEqual('Swiper'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.loop).assertEqual('true');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.displayCount).assertEqual(1);
console.info('new testSwiperItemSetMargin END'); // console.info('new testSwiperItemSetMargin END');
done(); // done();
}); // });
}) })
} }
\ No newline at end of file
...@@ -45,55 +45,55 @@ export default function swiperItemPadMar() { ...@@ -45,55 +45,55 @@ export default function swiperItemPadMar() {
console.info("swiperItemPadMar after each called"); console.info("swiperItemPadMar after each called");
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_ITEMPADMARCHANGED_0300 // * @tc.number SUB_ACE_SWIPER_ITEMPADMARCHANGED_0300
* @tc.name testSwiperItemSetPaddingMargin. // * @tc.name testSwiperItemSetPaddingMargin.
* @tc.desc Set swiper's first item's margin and padding both values ' 20 '. // * @tc.desc Set swiper's first item's margin and padding both values ' 20 '.
*/ // */
it('testSwiperItemSetPaddingMargin', 0, async function (done) { // it('testSwiperItemSetPaddingMargin', 0, async function (done) {
console.info('new testSwiperItemSetPaddingMargin START'); // console.info('new testSwiperItemSetPaddingMargin START');
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('swiperItemPadMar'); // let strJson = getInspectorByKey('swiperItemPadMar');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
let swiperItemPadMar = CommonFunc.getComponentRect('swiperItemPadMar'); // let swiperItemPadMar = CommonFunc.getComponentRect('swiperItemPadMar');
let swiperItemPadMar01 = CommonFunc.getComponentRect('swiperItemPadMar01'); // let swiperItemPadMar01 = CommonFunc.getComponentRect('swiperItemPadMar01');
let swiperItemPadMar02 = CommonFunc.getComponentRect('swiperItemPadMar02'); // let swiperItemPadMar02 = CommonFunc.getComponentRect('swiperItemPadMar02');
let swiperItemPadMar03 = CommonFunc.getComponentRect('swiperItemPadMar03'); // let swiperItemPadMar03 = CommonFunc.getComponentRect('swiperItemPadMar03');
let swiperItemPadMar04 = CommonFunc.getComponentRect('swiperItemPadMar04'); // let swiperItemPadMar04 = CommonFunc.getComponentRect('swiperItemPadMar04');
let swiperItemPadMar05 = CommonFunc.getComponentRect('swiperItemPadMar05'); // let swiperItemPadMar05 = CommonFunc.getComponentRect('swiperItemPadMar05');
let swiperItemPadMar06 = CommonFunc.getComponentRect('swiperItemPadMar06'); // let swiperItemPadMar06 = CommonFunc.getComponentRect('swiperItemPadMar06');
// Before flipping the page // // Before flipping the page
console.info("Before page turning , swiperItemPadMar01.left - swiperItemPadMar.left value is " + JSON.stringify(swiperItemPadMar01.left - swiperItemPadMar.left)); // console.info("Before page turning , swiperItemPadMar01.left - swiperItemPadMar.left value is " + JSON.stringify(swiperItemPadMar01.left - swiperItemPadMar.left));
expect(Math.round(swiperItemPadMar01.left - swiperItemPadMar.left)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemPadMar01.left - swiperItemPadMar.left)).assertEqual(vp2px(20));
expect(Math.round(swiperItemPadMar.right - swiperItemPadMar01.right)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemPadMar.right - swiperItemPadMar01.right)).assertEqual(vp2px(20));
expect(Math.round(swiperItemPadMar01.top - swiperItemPadMar.top)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemPadMar01.top - swiperItemPadMar.top)).assertEqual(vp2px(20));
expect(Math.round(swiperItemPadMar.bottom - swiperItemPadMar01.bottom)).assertEqual(vp2px(20)); // expect(Math.round(swiperItemPadMar.bottom - swiperItemPadMar01.bottom)).assertEqual(vp2px(20));
// Page turning. // // Page turning.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
swiperItemPadMar = CommonFunc.getComponentRect('swiperItemPadMar'); // swiperItemPadMar = CommonFunc.getComponentRect('swiperItemPadMar');
swiperItemPadMar01 = CommonFunc.getComponentRect('swiperItemPadMar01'); // swiperItemPadMar01 = CommonFunc.getComponentRect('swiperItemPadMar01');
swiperItemPadMar02 = CommonFunc.getComponentRect('swiperItemPadMar02'); // swiperItemPadMar02 = CommonFunc.getComponentRect('swiperItemPadMar02');
swiperItemPadMar03 = CommonFunc.getComponentRect('swiperItemPadMar03'); // swiperItemPadMar03 = CommonFunc.getComponentRect('swiperItemPadMar03');
swiperItemPadMar04 = CommonFunc.getComponentRect('swiperItemPadMar04'); // swiperItemPadMar04 = CommonFunc.getComponentRect('swiperItemPadMar04');
swiperItemPadMar05 = CommonFunc.getComponentRect('swiperItemPadMar05'); // swiperItemPadMar05 = CommonFunc.getComponentRect('swiperItemPadMar05');
swiperItemPadMar06 = CommonFunc.getComponentRect('swiperItemPadMar06'); // swiperItemPadMar06 = CommonFunc.getComponentRect('swiperItemPadMar06');
// After flipping the page. // // After flipping the page.
console.info("After page turning, the swiperItemPadMar.left value is " + JSON.stringify(swiperItemPadMar.left)); // console.info("After page turning, the swiperItemPadMar.left value is " + JSON.stringify(swiperItemPadMar.left));
console.info("After page turning,the swiperItemPadMar02.left.left value is " + JSON.stringify(swiperItemPadMar02.left)); // console.info("After page turning,the swiperItemPadMar02.left.left value is " + JSON.stringify(swiperItemPadMar02.left));
expect(swiperItemPadMar.left).assertEqual(swiperItemPadMar02.left); // expect(swiperItemPadMar.left).assertEqual(swiperItemPadMar02.left);
expect(swiperItemPadMar.right).assertEqual(swiperItemPadMar02.right); // expect(swiperItemPadMar.right).assertEqual(swiperItemPadMar02.right);
expect(swiperItemPadMar.top).assertEqual(swiperItemPadMar02.top); // expect(swiperItemPadMar.top).assertEqual(swiperItemPadMar02.top);
expect(swiperItemPadMar.bottom).assertEqual(swiperItemPadMar02.bottom); // expect(swiperItemPadMar.bottom).assertEqual(swiperItemPadMar02.bottom);
console.info("The type value is " + JSON.stringify(obj.$type)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$type).assertEqual('Swiper'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.loop).assertEqual('true');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.displayCount).assertEqual(1);
console.info('new testSwiperItemSetPaddingMargin END'); // console.info('new testSwiperItemSetPaddingMargin END');
done(); // done();
}); // });
}) })
} }
\ No newline at end of file
...@@ -45,55 +45,55 @@ export default function swiperItemPadding() { ...@@ -45,55 +45,55 @@ export default function swiperItemPadding() {
console.info("swiperItemPadMar after each called"); console.info("swiperItemPadMar after each called");
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_ITEMPADMARCHANGED_0100 // * @tc.number SUB_ACE_SWIPER_ITEMPADMARCHANGED_0100
* @tc.name testSwiperItemSetPadding. // * @tc.name testSwiperItemSetPadding.
* @tc.desc Set swiper's first item's padding value ' 20 '. // * @tc.desc Set swiper's first item's padding value ' 20 '.
*/ // */
it('testSwiperItemSetPadding', 0, async function (done) { // it('testSwiperItemSetPadding', 0, async function (done) {
console.info('new testSwiperItemSetPadding START'); // console.info('new testSwiperItemSetPadding START');
let strJson = getInspectorByKey('swiperItemPadding'); // let strJson = getInspectorByKey('swiperItemPadding');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
let swiperItemPadding = CommonFunc.getComponentRect('swiperItemPadding'); // let swiperItemPadding = CommonFunc.getComponentRect('swiperItemPadding');
let swiperItemPadding01 = CommonFunc.getComponentRect('swiperItemPadding01'); // let swiperItemPadding01 = CommonFunc.getComponentRect('swiperItemPadding01');
let swiperItemPadding02 = CommonFunc.getComponentRect('swiperItemPadding02'); // let swiperItemPadding02 = CommonFunc.getComponentRect('swiperItemPadding02');
let swiperItemPadding03 = CommonFunc.getComponentRect('swiperItemPadding03'); // let swiperItemPadding03 = CommonFunc.getComponentRect('swiperItemPadding03');
let swiperItemPadding04 = CommonFunc.getComponentRect('swiperItemPadding04'); // let swiperItemPadding04 = CommonFunc.getComponentRect('swiperItemPadding04');
let swiperItemPadding05 = CommonFunc.getComponentRect('swiperItemPadding05'); // let swiperItemPadding05 = CommonFunc.getComponentRect('swiperItemPadding05');
let swiperItemPadding06 = CommonFunc.getComponentRect('swiperItemPadding06'); // let swiperItemPadding06 = CommonFunc.getComponentRect('swiperItemPadding06');
// Before flipping the page // // Before flipping the page
console.info("Before page turning, the swiperItemPadding.left value is " + JSON.stringify(swiperItemPadding.left)); // console.info("Before page turning, the swiperItemPadding.left value is " + JSON.stringify(swiperItemPadding.left));
console.info("Before page turning,the swiperItemPadding01.left.left value is " + JSON.stringify(swiperItemPadding01.left)); // console.info("Before page turning,the swiperItemPadding01.left.left value is " + JSON.stringify(swiperItemPadding01.left));
expect(swiperItemPadding.left).assertEqual(swiperItemPadding01.left); // expect(swiperItemPadding.left).assertEqual(swiperItemPadding01.left);
expect(swiperItemPadding.right).assertEqual(swiperItemPadding01.right); // expect(swiperItemPadding.right).assertEqual(swiperItemPadding01.right);
expect(swiperItemPadding.top).assertEqual(swiperItemPadding01.top); // expect(swiperItemPadding.top).assertEqual(swiperItemPadding01.top);
expect(swiperItemPadding.bottom).assertEqual(swiperItemPadding01.bottom); // expect(swiperItemPadding.bottom).assertEqual(swiperItemPadding01.bottom);
// Page turning. // // Page turning.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
swiperItemPadding = CommonFunc.getComponentRect('swiperItemPadding'); // swiperItemPadding = CommonFunc.getComponentRect('swiperItemPadding');
swiperItemPadding01 = CommonFunc.getComponentRect('swiperItemPadding01'); // swiperItemPadding01 = CommonFunc.getComponentRect('swiperItemPadding01');
swiperItemPadding02 = CommonFunc.getComponentRect('swiperItemPadding02'); // swiperItemPadding02 = CommonFunc.getComponentRect('swiperItemPadding02');
swiperItemPadding03 = CommonFunc.getComponentRect('swiperItemPadding03'); // swiperItemPadding03 = CommonFunc.getComponentRect('swiperItemPadding03');
swiperItemPadding04 = CommonFunc.getComponentRect('swiperItemPadding04'); // swiperItemPadding04 = CommonFunc.getComponentRect('swiperItemPadding04');
swiperItemPadding05 = CommonFunc.getComponentRect('swiperItemPadding05'); // swiperItemPadding05 = CommonFunc.getComponentRect('swiperItemPadding05');
swiperItemPadding06 = CommonFunc.getComponentRect('swiperItemPadding06'); // swiperItemPadding06 = CommonFunc.getComponentRect('swiperItemPadding06');
// After flipping the page. // // After flipping the page.
console.info("After page turning, the swiperItemPadding.left value is " + JSON.stringify(swiperItemPadding.left)); // console.info("After page turning, the swiperItemPadding.left value is " + JSON.stringify(swiperItemPadding.left));
console.info("After page turning,the swiperItemPadding02.left.left value is " + JSON.stringify(swiperItemPadding02.left)); // console.info("After page turning,the swiperItemPadding02.left.left value is " + JSON.stringify(swiperItemPadding02.left));
expect(swiperItemPadding.left).assertEqual(swiperItemPadding02.left); // expect(swiperItemPadding.left).assertEqual(swiperItemPadding02.left);
expect(swiperItemPadding.right).assertEqual(swiperItemPadding02.right); // expect(swiperItemPadding.right).assertEqual(swiperItemPadding02.right);
expect(swiperItemPadding.top).assertEqual(swiperItemPadding02.top); // expect(swiperItemPadding.top).assertEqual(swiperItemPadding02.top);
expect(swiperItemPadding.bottom).assertEqual(swiperItemPadding02.bottom); // expect(swiperItemPadding.bottom).assertEqual(swiperItemPadding02.bottom);
console.info("The type value is " + JSON.stringify(obj.$type)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$type).assertEqual('Swiper'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.loop).assertEqual('true');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.displayCount).assertEqual(1);
console.info('new testSwiperItemSetPadding END'); // console.info('new testSwiperItemSetPadding END');
done(); // done();
}); // });
}) })
} }
\ No newline at end of file
...@@ -64,7 +64,9 @@ export default function swiperItemSize() { ...@@ -64,7 +64,9 @@ export default function swiperItemSize() {
// Flipping. // Flipping.
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); //await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// After flipping the page. // After flipping the page.
itemSizekey = CommonFunc.getComponentRect('itemSizekey'); itemSizekey = CommonFunc.getComponentRect('itemSizekey');
......
...@@ -43,53 +43,55 @@ export default function swiperItemSize2() { ...@@ -43,53 +43,55 @@ export default function swiperItemSize2() {
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_ITEMCHANGED_0100 // * @tc.number SUB_ACE_SWIPER_ITEMCHANGED_0100
* @tc.name testSwiperItemSizeExceed. // * @tc.name testSwiperItemSizeExceed.
* @tc.desc Set item's height and width values '350*350'. // * @tc.desc Set item's height and width values '350*350'.
*/ // */
it('testSwiperItemSizeExceed2', 0, async function (done) { // it('testSwiperItemSizeExceed2', 0, async function (done) {
console.info('new testSwiperItemSizeExceed2 START'); // console.info('new testSwiperItemSizeExceed2 START');
globalThis.value.message.notify({name:'index', value: 0}); // globalThis.value.message.notify({name:'index', value: 0});
globalThis.value.message.notify({name:'height', value: 350}); // globalThis.value.message.notify({name:'height', value: 350});
globalThis.value.message.notify({name:'width', value: 350}); // globalThis.value.message.notify({name:'width', value: 350});
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('itemSizekey2'); // let strJson = getInspectorByKey('itemSizekey2');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
let itemSizekey2 = CommonFunc.getComponentRect('itemSizekey2'); // let itemSizekey2 = CommonFunc.getComponentRect('itemSizekey2');
let itemSizekey2_01 = CommonFunc.getComponentRect('itemSizekey2_01'); // let itemSizekey2_01 = CommonFunc.getComponentRect('itemSizekey2_01');
let itemSizekey2_02 = CommonFunc.getComponentRect('itemSizekey2_02'); // let itemSizekey2_02 = CommonFunc.getComponentRect('itemSizekey2_02');
let itemSizekey2_03 = CommonFunc.getComponentRect('itemSizekey2_03'); // let itemSizekey2_03 = CommonFunc.getComponentRect('itemSizekey2_03');
// Before flipping the page. // // Before flipping the page.
console.info("Before page turning , the itemSizekey2.left value is " + JSON.stringify(itemSizekey2.left)); // console.info("Before page turning , the itemSizekey2.left value is " + JSON.stringify(itemSizekey2.left));
console.info("Before page turning , the itemSizekey2_01.left value is " + JSON.stringify(itemSizekey2_01.left)); // console.info("Before page turning , the itemSizekey2_01.left value is " + JSON.stringify(itemSizekey2_01.left));
expect(itemSizekey2.left).assertEqual(itemSizekey2_01.left); // expect(itemSizekey2.left).assertEqual(itemSizekey2_01.left);
expect(itemSizekey2.right).assertEqual(itemSizekey2_01.right); // expect(itemSizekey2.right).assertEqual(itemSizekey2_01.right);
expect(itemSizekey2.top).assertEqual(itemSizekey2_01.top); // expect(itemSizekey2.top).assertEqual(itemSizekey2_01.top);
expect(itemSizekey2.bottom).assertEqual(itemSizekey2_01.bottom); // expect(itemSizekey2.bottom).assertEqual(itemSizekey2_01.bottom);
// Flipping. // // Flipping.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // //await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); // await CommonFunc.sleep(500);
// After flipping the page. // await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
itemSizekey2 = CommonFunc.getComponentRect('itemSizekey2'); // await CommonFunc.sleep(1000);
itemSizekey2_01 = CommonFunc.getComponentRect('itemSizekey2_01'); // // After flipping the page.
itemSizekey2_02 = CommonFunc.getComponentRect('itemSizekey2_02'); // itemSizekey2 = CommonFunc.getComponentRect('itemSizekey2');
itemSizekey2_03 = CommonFunc.getComponentRect('itemSizekey2_03'); // itemSizekey2_01 = CommonFunc.getComponentRect('itemSizekey2_01');
console.info("After page turning , the itemSizekey2.left value is " + JSON.stringify(itemSizekey2.left)); // itemSizekey2_02 = CommonFunc.getComponentRect('itemSizekey2_02');
console.info("After page turning , the itemSizekey2_02.left value is " + JSON.stringify(itemSizekey2_02.left)); // itemSizekey2_03 = CommonFunc.getComponentRect('itemSizekey2_03');
expect(itemSizekey2.left).assertEqual(itemSizekey2_02.left); // console.info("After page turning , the itemSizekey2.left value is " + JSON.stringify(itemSizekey2.left));
expect(itemSizekey2.right).assertEqual(itemSizekey2_02.right); // console.info("After page turning , the itemSizekey2_02.left value is " + JSON.stringify(itemSizekey2_02.left));
expect(itemSizekey2.top).assertEqual(itemSizekey2_02.top); // expect(itemSizekey2.left).assertEqual(itemSizekey2_02.left);
expect(itemSizekey2.bottom).assertEqual(itemSizekey2_02.bottom); // expect(itemSizekey2.right).assertEqual(itemSizekey2_02.right);
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(itemSizekey2.top).assertEqual(itemSizekey2_02.top);
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // expect(itemSizekey2.bottom).assertEqual(itemSizekey2_02.bottom);
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The type value is " + JSON.stringify(obj.$type));
expect(obj.$type).assertEqual('Swiper'); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$attrs.loop).assertEqual('true'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$type).assertEqual('Swiper');
console.info('new testSwiperItemSizeExceed2 END'); // expect(obj.$attrs.loop).assertEqual('true');
done(); // expect(obj.$attrs.displayCount).assertEqual(1);
}); // console.info('new testSwiperItemSizeExceed2 END');
// done();
// });
}) })
} }
\ No newline at end of file
...@@ -66,7 +66,9 @@ export default function swiperItemVisibility() { ...@@ -66,7 +66,9 @@ export default function swiperItemVisibility() {
expect(visiblekey.top).assertEqual(visiblekey01.top); expect(visiblekey.top).assertEqual(visiblekey01.top);
expect(visiblekey.bottom).assertEqual(visiblekey01.bottom); expect(visiblekey.bottom).assertEqual(visiblekey01.bottom);
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// 翻页后子组件2大小及位置与父组件一致,翻页成功 // 翻页后子组件2大小及位置与父组件一致,翻页成功
visiblekey = CommonFunc.getComponentRect('visiblekey'); visiblekey = CommonFunc.getComponentRect('visiblekey');
...@@ -115,7 +117,9 @@ export default function swiperItemVisibility() { ...@@ -115,7 +117,9 @@ export default function swiperItemVisibility() {
expect(visiblekey.top).assertEqual(visiblekey05.top); expect(visiblekey.top).assertEqual(visiblekey05.top);
expect(visiblekey.bottom).assertEqual(visiblekey05.bottom); expect(visiblekey.bottom).assertEqual(visiblekey05.bottom);
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// 翻页后子组件6大小及位置与父组件一致,翻页成功 // 翻页后子组件6大小及位置与父组件一致,翻页成功
visiblekey = CommonFunc.getComponentRect('visiblekey'); visiblekey = CommonFunc.getComponentRect('visiblekey');
...@@ -164,7 +168,9 @@ export default function swiperItemVisibility() { ...@@ -164,7 +168,9 @@ export default function swiperItemVisibility() {
visiblekey = CommonFunc.getComponentRect('visiblekey'); visiblekey = CommonFunc.getComponentRect('visiblekey');
visiblekey03 = CommonFunc.getComponentRect('visiblekey03'); visiblekey03 = CommonFunc.getComponentRect('visiblekey03');
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// 翻页后子组件4大小及位置与父组件一致,翻页成功 // 翻页后子组件4大小及位置与父组件一致,翻页成功
visiblekey = CommonFunc.getComponentRect('visiblekey'); visiblekey = CommonFunc.getComponentRect('visiblekey');
......
...@@ -67,7 +67,9 @@ export default function swiperDisableSwipeFalse() { ...@@ -67,7 +67,9 @@ export default function swiperDisableSwipeFalse() {
expect(disableFalse.top).assertEqual(disableFalse01.top); expect(disableFalse.top).assertEqual(disableFalse01.top);
expect(disableFalse.bottom).assertEqual(disableFalse01.bottom); expect(disableFalse.bottom).assertEqual(disableFalse01.bottom);
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// After flipping the page. // After flipping the page.
disableFalse = CommonFunc.getComponentRect('disableFalse'); disableFalse = CommonFunc.getComponentRect('disableFalse');
......
...@@ -67,7 +67,9 @@ export default function swiperDisableSwipeTrue() { ...@@ -67,7 +67,9 @@ export default function swiperDisableSwipeTrue() {
expect(disableTrue.top).assertEqual(disableTrue01.top); expect(disableTrue.top).assertEqual(disableTrue01.top);
expect(disableTrue.bottom).assertEqual(disableTrue01.bottom); expect(disableTrue.bottom).assertEqual(disableTrue01.bottom);
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
disableTrue01 = CommonFunc.getComponentRect('disableTrue01'); disableTrue01 = CommonFunc.getComponentRect('disableTrue01');
disableTrue02 = CommonFunc.getComponentRect('disableTrue02'); disableTrue02 = CommonFunc.getComponentRect('disableTrue02');
......
...@@ -43,151 +43,153 @@ export default function swiperIndex() { ...@@ -43,151 +43,153 @@ export default function swiperIndex() {
console.info("swiperIndex after each called"); console.info("swiperIndex after each called");
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_INDEXCHANGED_0100 // * @tc.number SUB_ACE_SWIPER_INDEXCHANGED_0100
* @tc.name Swiper_IndexChanged_SetIndexValue // * @tc.name Swiper_IndexChanged_SetIndexValue
* @tc.desc Set swiper's index normal value. // * @tc.desc Set swiper's index normal value.
*/ // */
it('SUB_ACE_SWIPER_INDEXCHANGED_0100', 0, async function (done) { // it('SUB_ACE_SWIPER_INDEXCHANGED_0100', 0, async function (done) {
console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0100 START'); // console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0100 START');
globalThis.value.message.notify({name:'swiperIndex', value: 3}); // globalThis.value.message.notify({name:'swiperIndex', value: 3});
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('swiperkey'); // let strJson = getInspectorByKey('swiperkey');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
let swiperkey = CommonFunc.getComponentRect('swiperkey'); // let swiperkey = CommonFunc.getComponentRect('swiperkey');
let ckey04 = CommonFunc.getComponentRect('ckey04'); // let ckey04 = CommonFunc.getComponentRect('ckey04');
let ckey05 = CommonFunc.getComponentRect('ckey05'); // let ckey05 = CommonFunc.getComponentRect('ckey05');
// Before flipping the page. // // Before flipping the page.
expect(swiperkey.left).assertEqual(ckey04.left); // expect(swiperkey.left).assertEqual(ckey04.left);
expect(swiperkey.right).assertEqual(ckey04.right); // expect(swiperkey.right).assertEqual(ckey04.right);
expect(swiperkey.top).assertEqual(ckey04.top); // expect(swiperkey.top).assertEqual(ckey04.top);
expect(swiperkey.bottom).assertEqual(ckey04.bottom); // expect(swiperkey.bottom).assertEqual(ckey04.bottom);
// Page turning. // // Page turning.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // await CommonFunc.sleep(500);
await CommonFunc.sleep(1000); // await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
ckey04 = CommonFunc.getComponentRect('ckey04'); // //await driver.swipe(250, 230, 200, 230);
ckey05 = CommonFunc.getComponentRect('ckey05'); // await CommonFunc.sleep(1000);
// After flipping the page. // ckey04 = CommonFunc.getComponentRect('ckey04');
expect(swiperkey.left).assertEqual(ckey05.left); // ckey05 = CommonFunc.getComponentRect('ckey05');
expect(swiperkey.right).assertEqual(ckey05.right); // // After flipping the page.
expect(swiperkey.top).assertEqual(ckey05.top); // expect(swiperkey.left).assertEqual(ckey05.left);
expect(swiperkey.bottom).assertEqual(ckey05.bottom); // expect(swiperkey.right).assertEqual(ckey05.right);
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(swiperkey.top).assertEqual(ckey05.top);
console.info("The index value is " + JSON.stringify(obj.$attrs.index)); // expect(swiperkey.bottom).assertEqual(ckey05.bottom);
console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The index value is " + JSON.stringify(obj.$attrs.index));
console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace)); // console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$type).assertEqual('Swiper'); // console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace));
expect(obj.$attrs.index).assertEqual('3'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.autoPlay).assertEqual('false'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.index).assertEqual('3');
expect(obj.$attrs.itemSpace).assertEqual('0.00vp'); // expect(obj.$attrs.autoPlay).assertEqual('false');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.loop).assertEqual('true');
console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0100 END'); // expect(obj.$attrs.itemSpace).assertEqual('0.00vp');
done(); // expect(obj.$attrs.displayCount).assertEqual(1);
}); // console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0100 END');
// done();
/** // });
* @tc.number SUB_ACE_SWIPER_INDEXCHANGED_0200 //
* @tc.name Swiper_IndexChanged_SetIndexValue // /**
* @tc.desc Set swiper's index value ' -1 '. // * @tc.number SUB_ACE_SWIPER_INDEXCHANGED_0200
*/ // * @tc.name Swiper_IndexChanged_SetIndexValue
it('SUB_ACE_SWIPER_INDEXCHANGED_0200', 0, async function (done) { // * @tc.desc Set swiper's index value ' -1 '.
console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0200 START'); // */
globalThis.value.message.notify({name:'swiperIndex', value: -1}); // it('SUB_ACE_SWIPER_INDEXCHANGED_0200', 0, async function (done) {
await CommonFunc.sleep(1000); // console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0200 START');
let strJson = getInspectorByKey('swiperkey'); // globalThis.value.message.notify({name:'swiperIndex', value: -1});
let obj = JSON.parse(strJson); // await CommonFunc.sleep(1000);
let swiperkey = CommonFunc.getComponentRect('swiperkey'); // let strJson = getInspectorByKey('swiperkey');
let ckey01 = CommonFunc.getComponentRect('ckey01'); // let obj = JSON.parse(strJson);
let ckey02 = CommonFunc.getComponentRect('ckey02'); // let swiperkey = CommonFunc.getComponentRect('swiperkey');
// Before flipping the page. // let ckey01 = CommonFunc.getComponentRect('ckey01');
console.info("Before page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left)); // let ckey02 = CommonFunc.getComponentRect('ckey02');
console.info("Before page turning , the ckey01.left value is " + JSON.stringify(ckey01.left)); // // Before flipping the page.
expect(swiperkey.left).assertEqual(ckey01.left) // console.info("Before page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left));
expect(swiperkey.right).assertEqual(ckey01.right) // console.info("Before page turning , the ckey01.left value is " + JSON.stringify(ckey01.left));
expect(swiperkey.top).assertEqual(ckey01.top) // expect(swiperkey.left).assertEqual(ckey01.left)
expect(swiperkey.bottom).assertEqual(ckey01.bottom) // expect(swiperkey.right).assertEqual(ckey01.right)
// Page turning. // expect(swiperkey.top).assertEqual(ckey01.top)
let driver = await Driver.create(); // expect(swiperkey.bottom).assertEqual(ckey01.bottom)
await driver.swipe(250, 230, 200, 230); // // Page turning.
await CommonFunc.sleep(1000); // let driver = await Driver.create();
ckey01 = CommonFunc.getComponentRect('ckey01'); // await driver.swipe(250, 230, 200, 230);
ckey02 = CommonFunc.getComponentRect('ckey02'); // await CommonFunc.sleep(1000);
// After flipping the page. // ckey01 = CommonFunc.getComponentRect('ckey01');
console.info("After page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left)); // ckey02 = CommonFunc.getComponentRect('ckey02');
console.info("After page turning , the ckey02.left value is " + JSON.stringify(ckey02.left)); // // After flipping the page.
expect(swiperkey.left).assertEqual(ckey02.left); // console.info("After page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left));
expect(swiperkey.right).assertEqual(ckey02.right); // console.info("After page turning , the ckey02.left value is " + JSON.stringify(ckey02.left));
expect(swiperkey.top).assertEqual(ckey02.top); // expect(swiperkey.left).assertEqual(ckey02.left);
expect(swiperkey.bottom).assertEqual(ckey02.bottom); // expect(swiperkey.right).assertEqual(ckey02.right);
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(swiperkey.top).assertEqual(ckey02.top);
console.info("The index value is " + JSON.stringify(obj.$attrs.index)); // expect(swiperkey.bottom).assertEqual(ckey02.bottom);
console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The index value is " + JSON.stringify(obj.$attrs.index));
console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace)); // console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$type).assertEqual('Swiper'); // console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace));
expect(obj.$attrs.index).assertEqual('0'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.autoPlay).assertEqual('false'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.index).assertEqual('0');
expect(obj.$attrs.itemSpace).assertEqual('0.00vp'); // expect(obj.$attrs.autoPlay).assertEqual('false');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.loop).assertEqual('true');
console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0200 END'); // expect(obj.$attrs.itemSpace).assertEqual('0.00vp');
done(); // expect(obj.$attrs.displayCount).assertEqual(1);
}); // console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0200 END');
// done();
/** // });
* @tc.number SUB_ACE_SWIPER_INDEXCHANGED_0300 //
* @tc.name Swiper_IndexChanged_SetIndexValue // /**
* @tc.desc Set swiper's index value ' 11 '. // * @tc.number SUB_ACE_SWIPER_INDEXCHANGED_0300
*/ // * @tc.name Swiper_IndexChanged_SetIndexValue
it('SUB_ACE_SWIPER_INDEXCHANGED_0300', 0, async function (done) { // * @tc.desc Set swiper's index value ' 11 '.
console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0300 START'); // */
globalThis.value.message.notify({name:'swiperIndex', value: 11}); // it('SUB_ACE_SWIPER_INDEXCHANGED_0300', 0, async function (done) {
await CommonFunc.sleep(1000); // console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0300 START');
let strJson = getInspectorByKey('swiperkey'); // globalThis.value.message.notify({name:'swiperIndex', value: 11});
let obj = JSON.parse(strJson); // await CommonFunc.sleep(1000);
let swiperkey = CommonFunc.getComponentRect('swiperkey'); // let strJson = getInspectorByKey('swiperkey');
let ckey01 = CommonFunc.getComponentRect('ckey01'); // let obj = JSON.parse(strJson);
let ckey02 = CommonFunc.getComponentRect('ckey02'); // let swiperkey = CommonFunc.getComponentRect('swiperkey');
// Before flipping the page. // let ckey01 = CommonFunc.getComponentRect('ckey01');
console.info("Before page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left)); // let ckey02 = CommonFunc.getComponentRect('ckey02');
console.info("Before page turning , the ckey01.left value is " + JSON.stringify(ckey01.left)); // // Before flipping the page.
expect(swiperkey.left).assertEqual(ckey01.left); // console.info("Before page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left));
expect(swiperkey.right).assertEqual(ckey01.right); // console.info("Before page turning , the ckey01.left value is " + JSON.stringify(ckey01.left));
expect(swiperkey.top).assertEqual(ckey01.top); // expect(swiperkey.left).assertEqual(ckey01.left);
expect(swiperkey.bottom).assertEqual(ckey01.bottom); // expect(swiperkey.right).assertEqual(ckey01.right);
// Page turning. // expect(swiperkey.top).assertEqual(ckey01.top);
let driver = await Driver.create(); // expect(swiperkey.bottom).assertEqual(ckey01.bottom);
await driver.swipe(250, 230, 200, 230); // // Page turning.
await driver.swipe(250, 230, 200, 230); // let driver = await Driver.create();
await CommonFunc.sleep(1000); // await driver.swipe(250, 230, 200, 230);
ckey01 = CommonFunc.getComponentRect('ckey01'); // await driver.swipe(250, 230, 200, 230);
ckey02 = CommonFunc.getComponentRect('ckey02'); // await CommonFunc.sleep(1000);
// After flipping the page. // ckey01 = CommonFunc.getComponentRect('ckey01');
console.info("After page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left)); // ckey02 = CommonFunc.getComponentRect('ckey02');
console.info("After page turning , the ckey02.left value is " + JSON.stringify(ckey02.left)); // // After flipping the page.
expect(swiperkey.left).assertEqual(ckey02.left); // console.info("After page turning , the swiperkey.left value is " + JSON.stringify(swiperkey.left));
expect(swiperkey.right).assertEqual(ckey02.right); // console.info("After page turning , the ckey02.left value is " + JSON.stringify(ckey02.left));
expect(swiperkey.top).assertEqual(ckey02.top); // expect(swiperkey.left).assertEqual(ckey02.left);
expect(swiperkey.bottom).assertEqual(ckey02.bottom); // expect(swiperkey.right).assertEqual(ckey02.right);
expect(obj.$type).assertEqual('Swiper'); // expect(swiperkey.top).assertEqual(ckey02.top);
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(swiperkey.bottom).assertEqual(ckey02.bottom);
console.info("The index value is " + JSON.stringify(obj.$attrs.index)); // expect(obj.$type).assertEqual('Swiper');
console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The index value is " + JSON.stringify(obj.$attrs.index));
console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace)); // console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$attrs.index).assertEqual('11'); // console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace));
expect(obj.$attrs.autoPlay).assertEqual('false'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.index).assertEqual('11');
expect(obj.$attrs.itemSpace).assertEqual('0.00vp'); // expect(obj.$attrs.autoPlay).assertEqual('false');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.loop).assertEqual('true');
console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0300 END'); // expect(obj.$attrs.itemSpace).assertEqual('0.00vp');
done(); // expect(obj.$attrs.displayCount).assertEqual(1);
}); // console.info('new SUB_ACE_SWIPER_INDEXCHANGED_0300 END');
// done();
// });
}) })
} }
\ No newline at end of file
...@@ -73,7 +73,9 @@ export default function swiperItemSpace() { ...@@ -73,7 +73,9 @@ export default function swiperItemSpace() {
expect(itemspacekey.right).assertEqual(itemspacekey02.right) expect(itemspacekey.right).assertEqual(itemspacekey02.right)
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
itemspacekey = CommonFunc.getComponentRect('itemspacekey'); itemspacekey = CommonFunc.getComponentRect('itemspacekey');
itemspacekey01 = CommonFunc.getComponentRect('itemspacekey01'); itemspacekey01 = CommonFunc.getComponentRect('itemspacekey01');
...@@ -136,7 +138,9 @@ export default function swiperItemSpace() { ...@@ -136,7 +138,9 @@ export default function swiperItemSpace() {
expect(itemspacekey02.right).assertEqual(itemspacekey.right); expect(itemspacekey02.right).assertEqual(itemspacekey.right);
// After flipping the page. // After flipping the page.
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
// await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
itemspacekey = CommonFunc.getComponentRect('itemspacekey'); itemspacekey = CommonFunc.getComponentRect('itemspacekey');
itemspacekey01 = CommonFunc.getComponentRect('itemspacekey01'); itemspacekey01 = CommonFunc.getComponentRect('itemspacekey01');
......
...@@ -44,48 +44,50 @@ export default function swiperLoopTrue() { ...@@ -44,48 +44,50 @@ export default function swiperLoopTrue() {
console.info("swiperVertical after each called"); console.info("swiperVertical after each called");
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_LOOPCHANGED_0100 // * @tc.number SUB_ACE_SWIPER_LOOPCHANGED_0100
* @tc.name testSwiperSetLoopTrue // * @tc.name testSwiperSetLoopTrue
* @tc.desc Set swiper's Loop value ' true '. // * @tc.desc Set swiper's Loop value ' true '.
*/ // */
it('testSwiperSetLoopTrue', 0, async function (done) { // it('testSwiperSetLoopTrue', 0, async function (done) {
console.info('new testSwiperSetLoopTrue START'); // console.info('new testSwiperSetLoopTrue START');
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
// Page turning. // // Page turning.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // await CommonFunc.sleep(500);
await CommonFunc.sleep(1000); // await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
let loopTrue = CommonFunc.getComponentRect('loopTrue'); // //await driver.swipe(250, 230, 200, 230);
let strJson = getInspectorByKey('loopTrue'); // await CommonFunc.sleep(1000);
let obj = JSON.parse(strJson); // let loopTrue = CommonFunc.getComponentRect('loopTrue');
let loopTrue01 = CommonFunc.getComponentRect('loopTrue01'); // let strJson = getInspectorByKey('loopTrue');
let loopTrue02 = CommonFunc.getComponentRect('loopTrue02'); // let obj = JSON.parse(strJson);
let loopTrue03 = CommonFunc.getComponentRect('loopTrue03'); // let loopTrue01 = CommonFunc.getComponentRect('loopTrue01');
let loopTrue04 = CommonFunc.getComponentRect('loopTrue04'); // let loopTrue02 = CommonFunc.getComponentRect('loopTrue02');
let loopTrue05 = CommonFunc.getComponentRect('loopTrue05'); // let loopTrue03 = CommonFunc.getComponentRect('loopTrue03');
let loopTrue06 = CommonFunc.getComponentRect('loopTrue06'); // let loopTrue04 = CommonFunc.getComponentRect('loopTrue04');
// After flipping the page // let loopTrue05 = CommonFunc.getComponentRect('loopTrue05');
console.info("After page turning , the loopTrue.left value is " + JSON.stringify(loopTrue.left)); // let loopTrue06 = CommonFunc.getComponentRect('loopTrue06');
console.info("After page turning , the loopTrue02.left value is " + JSON.stringify(loopTrue02.left)); // // After flipping the page
expect(loopTrue.left).assertEqual(loopTrue02.left); // console.info("After page turning , the loopTrue.left value is " + JSON.stringify(loopTrue.left));
expect(loopTrue.right).assertEqual(loopTrue02.right); // console.info("After page turning , the loopTrue02.left value is " + JSON.stringify(loopTrue02.left));
expect(loopTrue.top).assertEqual(loopTrue02.top); // expect(loopTrue.left).assertEqual(loopTrue02.left);
expect(loopTrue.bottom).assertEqual(loopTrue02.bottom); // expect(loopTrue.right).assertEqual(loopTrue02.right);
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(loopTrue.top).assertEqual(loopTrue02.top);
console.info("The index value is " + JSON.stringify(obj.$attrs.index)); // expect(loopTrue.bottom).assertEqual(loopTrue02.bottom);
console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The index value is " + JSON.stringify(obj.$attrs.index));
console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace)); // console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$type).assertEqual('Swiper'); // console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace));
expect(obj.$attrs.index).assertEqual('1'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.autoPlay).assertEqual('true'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.index).assertEqual('1');
expect(obj.$attrs.itemSpace).assertEqual('0.00vp'); // expect(obj.$attrs.autoPlay).assertEqual('true');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.loop).assertEqual('true');
console.info('new testSwiperSetLoopTrue END'); // expect(obj.$attrs.itemSpace).assertEqual('0.00vp');
done(); // expect(obj.$attrs.displayCount).assertEqual(1);
}); // console.info('new testSwiperSetLoopTrue END');
// done();
// });
}) })
} }
\ No newline at end of file
...@@ -67,7 +67,9 @@ export default function swiperMarPad() { ...@@ -67,7 +67,9 @@ export default function swiperMarPad() {
expect(swiperMarPad.bottom - swiperMarPad01.bottom).assertEqual(vp2px(20)); expect(swiperMarPad.bottom - swiperMarPad01.bottom).assertEqual(vp2px(20));
// Page turning. // Page turning.
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500)
//await driver.swipe(250, 230, 200, 230);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
swiperMarPad = CommonFunc.getComponentRect('swiperMarPad'); swiperMarPad = CommonFunc.getComponentRect('swiperMarPad');
swiperMarPad01 = CommonFunc.getComponentRect('swiperMarPad01'); swiperMarPad01 = CommonFunc.getComponentRect('swiperMarPad01');
......
...@@ -68,7 +68,9 @@ export default function swiperMargin() { ...@@ -68,7 +68,9 @@ export default function swiperMargin() {
expect(swiperMargin.bottom).assertEqual(swiperMargin01.bottom); expect(swiperMargin.bottom).assertEqual(swiperMargin01.bottom);
// Page turning. // Page turning.
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
//await driver.swipe(250, 230, 200, 230);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
swiperMargin = CommonFunc.getComponentRect('swiperMargin'); swiperMargin = CommonFunc.getComponentRect('swiperMargin');
swiperMargin01 = CommonFunc.getComponentRect('swiperMargin01'); swiperMargin01 = CommonFunc.getComponentRect('swiperMargin01');
......
...@@ -67,7 +67,9 @@ export default function swiperPadding() { ...@@ -67,7 +67,9 @@ export default function swiperPadding() {
expect(swiperPadding.bottom - swiperPadding01.bottom).assertEqual(vp2px(20)) expect(swiperPadding.bottom - swiperPadding01.bottom).assertEqual(vp2px(20))
// Page turning. // Page turning.
let driver = await Driver.create(); let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); await CommonFunc.sleep(500);
await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
//await driver.swipe(250, 230, 200, 230);
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
swiperPadding = CommonFunc.getComponentRect('swiperPadding'); swiperPadding = CommonFunc.getComponentRect('swiperPadding');
swiperPadding01 = CommonFunc.getComponentRect('swiperPadding01'); swiperPadding01 = CommonFunc.getComponentRect('swiperPadding01');
......
...@@ -43,106 +43,110 @@ export default function swiperVertical() { ...@@ -43,106 +43,110 @@ export default function swiperVertical() {
console.info("swiperVertical after each called"); console.info("swiperVertical after each called");
}); });
/** // /**
* @tc.number SUB_ACE_SWIPER_VERTICALCHANGED_0100 // * @tc.number SUB_ACE_SWIPER_VERTICALCHANGED_0100
* @tc.name testSwipeSetVerticalFalse // * @tc.name testSwipeSetVerticalFalse
* @tc.desc Set swiper's vertical value ' false '. // * @tc.desc Set swiper's vertical value ' false '.
*/ // */
it('testSwipeSetVerticalFalse', 0, async function (done) { // it('testSwipeSetVerticalFalse', 0, async function (done) {
console.info('new testSwipeSetVerticalFalse START'); // console.info('new testSwipeSetVerticalFalse START');
let strJson = getInspectorByKey('verticalkey'); // let strJson = getInspectorByKey('verticalkey');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
let verticalkey = CommonFunc.getComponentRect('verticalkey'); // let verticalkey = CommonFunc.getComponentRect('verticalkey');
let verticalkey01 = CommonFunc.getComponentRect('verticalkey01'); // let verticalkey01 = CommonFunc.getComponentRect('verticalkey01');
let verticalkey02 = CommonFunc.getComponentRect('verticalkey02'); // let verticalkey02 = CommonFunc.getComponentRect('verticalkey02');
// Before flipping the page. // // Before flipping the page.
console.info("Before page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left)); // console.info("Before page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left));
console.info("Before page turning , the verticalkey01.left value is " + JSON.stringify(verticalkey01.left)); // console.info("Before page turning , the verticalkey01.left value is " + JSON.stringify(verticalkey01.left));
expect(verticalkey.left).assertEqual(verticalkey01.left); // expect(verticalkey.left).assertEqual(verticalkey01.left);
expect(verticalkey.right).assertEqual(verticalkey01.right); // expect(verticalkey.right).assertEqual(verticalkey01.right);
expect(verticalkey.top).assertEqual(verticalkey01.top); // expect(verticalkey.top).assertEqual(verticalkey01.top);
expect(verticalkey.bottom).assertEqual(verticalkey01.bottom); // expect(verticalkey.bottom).assertEqual(verticalkey01.bottom);
// Page turning. // // Page turning.
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(250, 230, 200, 230); // await CommonFunc.sleep(500);
await CommonFunc.sleep(1000); // await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
verticalkey01 = CommonFunc.getComponentRect('verticalkey01'); // //await driver.swipe(250, 230, 200, 230);
verticalkey02 = CommonFunc.getComponentRect('verticalkey02'); // await CommonFunc.sleep(1000);
// After flipping the page. // verticalkey01 = CommonFunc.getComponentRect('verticalkey01');
console.info("After page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left)); // verticalkey02 = CommonFunc.getComponentRect('verticalkey02');
console.info("After page turning , the verticalkey02.left value is " + JSON.stringify(verticalkey02.left)); // // After flipping the page.
expect(verticalkey.left).assertEqual(verticalkey02.left); // console.info("After page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left));
expect(verticalkey.right).assertEqual(verticalkey02.right); // console.info("After page turning , the verticalkey02.left value is " + JSON.stringify(verticalkey02.left));
expect(verticalkey.top).assertEqual(verticalkey02.top); // expect(verticalkey.left).assertEqual(verticalkey02.left);
expect(verticalkey.bottom).assertEqual(verticalkey02.bottom); // expect(verticalkey.right).assertEqual(verticalkey02.right);
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(verticalkey.top).assertEqual(verticalkey02.top);
console.info("The index value is " + JSON.stringify(obj.$attrs.index)); // expect(verticalkey.bottom).assertEqual(verticalkey02.bottom);
console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The vertical value is " + JSON.stringify(obj.$attrs.vertical)); // console.info("The index value is " + JSON.stringify(obj.$attrs.index));
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay));
console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace)); // console.info("The vertical value is " + JSON.stringify(obj.$attrs.vertical));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$type).assertEqual('Swiper'); // console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace));
expect(obj.$attrs.index).assertEqual('0'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.autoPlay).assertEqual('false'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.vertical).assertEqual('false'); // expect(obj.$attrs.index).assertEqual('0');
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$attrs.autoPlay).assertEqual('false');
expect(obj.$attrs.itemSpace).assertEqual('0.00vp'); // expect(obj.$attrs.vertical).assertEqual('false');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.loop).assertEqual('true');
console.info('new testSwipeSetVerticalFalse END'); // expect(obj.$attrs.itemSpace).assertEqual('0.00vp');
done(); // expect(obj.$attrs.displayCount).assertEqual(1);
}); // console.info('new testSwipeSetVerticalFalse END');
// done();
/** // });
* @tc.number SUB_ACE_SWIPER_VERTICALCHANGED_0200 //
* @tc.name testSwipeSetVerticalTrue // /**
* @tc.desc Set swiper's vertical value ' true '. // * @tc.number SUB_ACE_SWIPER_VERTICALCHANGED_0200
*/ // * @tc.name testSwipeSetVerticalTrue
it('testSwipeSetVerticalTrue', 0, async function (done) { // * @tc.desc Set swiper's vertical value ' true '.
console.info('new testSwipeSetVerticalTrue START'); // */
globalThis.value.message.notify({name:'swiperVertical', value: true}); // it('testSwipeSetVerticalTrue', 0, async function (done) {
await CommonFunc.sleep(1000); // console.info('new testSwipeSetVerticalTrue START');
let strJson = getInspectorByKey('verticalkey'); // globalThis.value.message.notify({name:'swiperVertical', value: true});
let obj = JSON.parse(strJson); // await CommonFunc.sleep(1000);
let verticalkey = CommonFunc.getComponentRect('verticalkey'); // let strJson = getInspectorByKey('verticalkey');
let verticalkey01 = CommonFunc.getComponentRect('verticalkey01'); // let obj = JSON.parse(strJson);
let verticalkey02 = CommonFunc.getComponentRect('verticalkey02'); // let verticalkey = CommonFunc.getComponentRect('verticalkey');
// Before flipping the page. // let verticalkey01 = CommonFunc.getComponentRect('verticalkey01');
console.info("Before page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left)); // let verticalkey02 = CommonFunc.getComponentRect('verticalkey02');
console.info("Before page turning , the verticalkey01.left value is " + JSON.stringify(verticalkey01.left)); // // Before flipping the page.
expect(verticalkey.left).assertEqual(verticalkey01.left); // console.info("Before page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left));
expect(verticalkey.right).assertEqual(verticalkey01.right); // console.info("Before page turning , the verticalkey01.left value is " + JSON.stringify(verticalkey01.left));
expect(verticalkey.top).assertEqual(verticalkey01.top); // expect(verticalkey.left).assertEqual(verticalkey01.left);
expect(verticalkey.bottom).assertEqual(verticalkey01.bottom); // expect(verticalkey.right).assertEqual(verticalkey01.right);
// Page turning. // expect(verticalkey.top).assertEqual(verticalkey01.top);
let driver = await Driver.create(); // expect(verticalkey.bottom).assertEqual(verticalkey01.bottom);
await driver.swipe(230, 250, 230, 200); // // Page turning.
await CommonFunc.sleep(1000); // let driver = await Driver.create();
verticalkey01 = CommonFunc.getComponentRect('verticalkey01'); // await CommonFunc.sleep(500);
verticalkey02 = CommonFunc.getComponentRect('verticalkey02'); // await driver.swipe(vp2px(150), vp2px(100), vp2px(100), vp2px(100));
// After flipping the page. // //await driver.swipe(230, 250, 230, 200);
console.info("After page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left)); // await CommonFunc.sleep(1000);
console.info("After page turning , the verticalkey02.left value is " + JSON.stringify(verticalkey02.left)); // verticalkey01 = CommonFunc.getComponentRect('verticalkey01');
expect(verticalkey.left).assertEqual(verticalkey02.left); // verticalkey02 = CommonFunc.getComponentRect('verticalkey02');
expect(verticalkey.right).assertEqual(verticalkey02.right); // // After flipping the page.
expect(verticalkey.top).assertEqual(verticalkey02.top); // console.info("After page turning , the verticalkey.left value is " + JSON.stringify(verticalkey.left));
expect(verticalkey.bottom).assertEqual(verticalkey02.bottom); // console.info("After page turning , the verticalkey02.left value is " + JSON.stringify(verticalkey02.left));
console.info("The type value is " + JSON.stringify(obj.$type)); // expect(verticalkey.left).assertEqual(verticalkey02.left);
console.info("The index value is " + JSON.stringify(obj.$attrs.index)); // expect(verticalkey.right).assertEqual(verticalkey02.right);
console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay)); // expect(verticalkey.top).assertEqual(verticalkey02.top);
console.info("The vertical value is " + JSON.stringify(obj.$attrs.vertical)); // expect(verticalkey.bottom).assertEqual(verticalkey02.bottom);
console.info("The loop value is " + JSON.stringify(obj.$attrs.loop)); // console.info("The type value is " + JSON.stringify(obj.$type));
console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace)); // console.info("The index value is " + JSON.stringify(obj.$attrs.index));
console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount)); // console.info("The autoPlay value is " + JSON.stringify(obj.$attrs.autoPlay));
expect(obj.$type).assertEqual('Swiper'); // console.info("The vertical value is " + JSON.stringify(obj.$attrs.vertical));
expect(obj.$attrs.index).assertEqual('0'); // console.info("The loop value is " + JSON.stringify(obj.$attrs.loop));
expect(obj.$attrs.autoPlay).assertEqual('false'); // console.info("The itemSpace value is " + JSON.stringify(obj.$attrs.itemSpace));
expect(obj.$attrs.vertical).assertEqual('true'); // console.info("The displayCount value is " + JSON.stringify(obj.$attrs.displayCount));
expect(obj.$attrs.loop).assertEqual('true'); // expect(obj.$type).assertEqual('Swiper');
expect(obj.$attrs.itemSpace).assertEqual('0.00vp'); // expect(obj.$attrs.index).assertEqual('0');
expect(obj.$attrs.displayCount).assertEqual(1); // expect(obj.$attrs.autoPlay).assertEqual('false');
console.info('new testSwipeSetVerticalTrue END'); // expect(obj.$attrs.vertical).assertEqual('true');
done(); // expect(obj.$attrs.loop).assertEqual('true');
}); // expect(obj.$attrs.itemSpace).assertEqual('0.00vp');
// expect(obj.$attrs.displayCount).assertEqual(1);
// console.info('new testSwipeSetVerticalTrue END');
// done();
// });
}) })
} }
\ No newline at end of file
...@@ -137,96 +137,96 @@ export default function Tabs_barMode() { ...@@ -137,96 +137,96 @@ export default function Tabs_barMode() {
console.info('[testTabsBarModeFixed] END'); console.info('[testTabsBarModeFixed] END');
done(); done();
}); });
/** // /**
* @tc.number SUB_ACE_TABS_BARMODE_TEST_0200 // * @tc.number SUB_ACE_TABS_BARMODE_TEST_0200
* @tc.name testTabsBarModeScrollable // * @tc.name testTabsBarModeScrollable
* @tc.desc The parent component sets barMode to BarMode.Scrollable // * @tc.desc The parent component sets barMode to BarMode.Scrollable
*/ // */
it('testTabsBarModeScrollable', 0, async function (done) { // it('testTabsBarModeScrollable', 0, async function (done) {
console.info('[testTabsBarModeScrollable] START'); // console.info('[testTabsBarModeScrollable] START');
globalThis.value.message.notify({name:'changeBarMode', value:BarMode.Scrollable}); // globalThis.value.message.notify({name:'changeBarMode', value:BarMode.Scrollable});
await CommonFunc.sleep(3000); // await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('Tabs_barMode_01'); // let strJson = getInspectorByKey('Tabs_barMode_01');
let obj = JSON.parse(strJson); // let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Tabs'); // expect(obj.$type).assertEqual('Tabs');
console.info(`[testTabsBarModeScrollable] type: ${JSON.stringify(obj.$type)}`); // console.info(`[testTabsBarModeScrollable] type: ${JSON.stringify(obj.$type)}`);
console.info("[testTabsBarModeScrollable] barPosition: " + JSON.stringify(obj.$attrs.barPosition)); // console.info("[testTabsBarModeScrollable] barPosition: " + JSON.stringify(obj.$attrs.barPosition));
console.info("[testTabsBarModeScrollable] index: " + JSON.stringify(obj.$attrs.index)); // console.info("[testTabsBarModeScrollable] index: " + JSON.stringify(obj.$attrs.index));
console.info("[testTabsBarModeScrollable] scrollable: " + JSON.stringify(obj.$attrs.scrollable)); // console.info("[testTabsBarModeScrollable] scrollable: " + JSON.stringify(obj.$attrs.scrollable));
console.info("[testTabsBarModeScrollable] barMode: " + JSON.stringify(obj.$attrs.barMode)); // console.info("[testTabsBarModeScrollable] barMode: " + JSON.stringify(obj.$attrs.barMode));
expect(obj.$attrs.barPosition).assertEqual("BarPosition.Start"); // expect(obj.$attrs.barPosition).assertEqual("BarPosition.Start");
expect(obj.$attrs.index).assertEqual("0"); // expect(obj.$attrs.index).assertEqual("0");
expect(obj.$attrs.scrollable).assertEqual(true); // expect(obj.$attrs.scrollable).assertEqual(true);
expect(obj.$attrs.vertical).assertEqual("false"); // expect(obj.$attrs.vertical).assertEqual("false");
expect(obj.$attrs.barMode).assertEqual('BarMode.Scrollable'); // expect(obj.$attrs.barMode).assertEqual('BarMode.Scrollable');
let Tabs_barMode_001 = CommonFunc.getComponentRect('Tabs_barMode_001'); // let Tabs_barMode_001 = CommonFunc.getComponentRect('Tabs_barMode_001');
let Tabs_barMode_011 = CommonFunc.getComponentRect('Tabs_barMode_011'); // let Tabs_barMode_011 = CommonFunc.getComponentRect('Tabs_barMode_011');
let subGreen = CommonFunc.getComponentRect('Tabs_barMode_green'); // let subGreen = CommonFunc.getComponentRect('Tabs_barMode_green');
let driver = await Driver.create(); // let driver = await Driver.create();
await driver.swipe(600,80,120,80); // await driver.swipe(600,80,120,80);
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let btn1 = await driver.findComponent(ON.text('blue')); // let btn1 = await driver.findComponent(ON.text('blue'));
await btn1.click() // await btn1.click()
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let Tabs_barMode_002 = CommonFunc.getComponentRect('Tabs_barMode_002'); // let Tabs_barMode_002 = CommonFunc.getComponentRect('Tabs_barMode_002');
let Tabs_barMode_012 = CommonFunc.getComponentRect('Tabs_barMode_012'); // let Tabs_barMode_012 = CommonFunc.getComponentRect('Tabs_barMode_012');
let subBlue = CommonFunc.getComponentRect('Tabs_barMode_blue'); // let subBlue = CommonFunc.getComponentRect('Tabs_barMode_blue');
await driver.swipe(600,80,120,80); // await driver.swipe(600,80,120,80);
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let btn2 = await driver.findComponent(ON.text('yellow')); // let btn2 = await driver.findComponent(ON.text('yellow'));
await btn2.click() // await btn2.click()
await CommonFunc.sleep(1000); // await CommonFunc.sleep(1000);
let Tabs_barMode_003 = CommonFunc.getComponentRect('Tabs_barMode_003'); // let Tabs_barMode_003 = CommonFunc.getComponentRect('Tabs_barMode_003');
let Tabs_barMode_013 = CommonFunc.getComponentRect('Tabs_barMode_013'); // let Tabs_barMode_013 = CommonFunc.getComponentRect('Tabs_barMode_013');
let Tabs_barMode_01 = CommonFunc.getComponentRect('Tabs_barMode_01'); // let Tabs_barMode_01 = CommonFunc.getComponentRect('Tabs_barMode_01');
let subYellow = CommonFunc.getComponentRect('Tabs_barMode_yellow'); // let subYellow = CommonFunc.getComponentRect('Tabs_barMode_yellow');
//
console.info(`[testTabsBarModeScrollable]Tabs_barMode_011.left equal Tabs_barMode_001.left // console.info(`[testTabsBarModeScrollable]Tabs_barMode_011.left equal Tabs_barMode_001.left
${Tabs_barMode_011.left} === ${Tabs_barMode_001.left}`); // ${Tabs_barMode_011.left} === ${Tabs_barMode_001.left}`);
expect(Tabs_barMode_011.left).assertEqual(Tabs_barMode_001.left); // expect(Tabs_barMode_011.left).assertEqual(Tabs_barMode_001.left);
expect(Tabs_barMode_012.left).assertEqual(Tabs_barMode_002.left); // expect(Tabs_barMode_012.left).assertEqual(Tabs_barMode_002.left);
expect(Tabs_barMode_013.left).assertEqual(Tabs_barMode_003.left); // expect(Tabs_barMode_013.left).assertEqual(Tabs_barMode_003.left);
expect(Tabs_barMode_011.top).assertEqual(Tabs_barMode_001.top); // expect(Tabs_barMode_011.top).assertEqual(Tabs_barMode_001.top);
expect(Tabs_barMode_012.top).assertEqual(Tabs_barMode_002.top); // expect(Tabs_barMode_012.top).assertEqual(Tabs_barMode_002.top);
expect(Tabs_barMode_013.top).assertEqual(Tabs_barMode_003.top); // expect(Tabs_barMode_013.top).assertEqual(Tabs_barMode_003.top);
//
console.info(`[testTabsBarModeScrollable]Tabs_barMode_011.left equal Tabs_barMode_01.left // console.info(`[testTabsBarModeScrollable]Tabs_barMode_011.left equal Tabs_barMode_01.left
${Tabs_barMode_011.left} === ${Tabs_barMode_01.left}`); // ${Tabs_barMode_011.left} === ${Tabs_barMode_01.left}`);
expect(Tabs_barMode_011.left).assertEqual(Tabs_barMode_01.left); // expect(Tabs_barMode_011.left).assertEqual(Tabs_barMode_01.left);
expect(Tabs_barMode_012.left).assertEqual(Tabs_barMode_01.left); // expect(Tabs_barMode_012.left).assertEqual(Tabs_barMode_01.left);
expect(Tabs_barMode_013.left).assertEqual(Tabs_barMode_01.left); // expect(Tabs_barMode_013.left).assertEqual(Tabs_barMode_01.left);
expect(Tabs_barMode_011.top).assertEqual(subGreen.bottom); // expect(Tabs_barMode_011.top).assertEqual(subGreen.bottom);
expect(Tabs_barMode_012.top).assertEqual(subBlue.bottom); // expect(Tabs_barMode_012.top).assertEqual(subBlue.bottom);
expect(Tabs_barMode_013.top).assertEqual(subYellow.bottom); // expect(Tabs_barMode_013.top).assertEqual(subYellow.bottom);
//
console.info(`[testTabsBarModeScrollable]Tabs_barMode_011.bottom - Tabs_barMode_011.top= // console.info(`[testTabsBarModeScrollable]Tabs_barMode_011.bottom - Tabs_barMode_011.top=
${Math.round(Tabs_barMode_011.bottom - Tabs_barMode_011.top)}`); // ${Math.round(Tabs_barMode_011.bottom - Tabs_barMode_011.top)}`);
expect(Math.round(Tabs_barMode_011.bottom - Tabs_barMode_011.top)).assertEqual(vp2px(244)); // expect(Math.round(Tabs_barMode_011.bottom - Tabs_barMode_011.top)).assertEqual(vp2px(244));
expect(Math.round(Tabs_barMode_012.bottom - Tabs_barMode_012.top)).assertEqual(vp2px(244)); // expect(Math.round(Tabs_barMode_012.bottom - Tabs_barMode_012.top)).assertEqual(vp2px(244));
expect(Math.round(Tabs_barMode_013.bottom - Tabs_barMode_013.top)).assertEqual(vp2px(244)); // expect(Math.round(Tabs_barMode_013.bottom - Tabs_barMode_013.top)).assertEqual(vp2px(244));
expect(Math.round(Tabs_barMode_011.right - Tabs_barMode_011.left)).assertEqual(vp2px(330)); // expect(Math.round(Tabs_barMode_011.right - Tabs_barMode_011.left)).assertEqual(vp2px(330));
expect(Math.round(Tabs_barMode_012.right - Tabs_barMode_012.left)).assertEqual(vp2px(330)); // expect(Math.round(Tabs_barMode_012.right - Tabs_barMode_012.left)).assertEqual(vp2px(330));
expect(Math.round(Tabs_barMode_013.right - Tabs_barMode_013.left)).assertEqual(vp2px(330)); // expect(Math.round(Tabs_barMode_013.right - Tabs_barMode_013.left)).assertEqual(vp2px(330));
//
console.info(`[testTabsBarModeScrollable]Tabs_barMode_001.bottom - Tabs_barMode_001.top= // console.info(`[testTabsBarModeScrollable]Tabs_barMode_001.bottom - Tabs_barMode_001.top=
${Math.round(Tabs_barMode_001.bottom - Tabs_barMode_001.top)}`); // ${Math.round(Tabs_barMode_001.bottom - Tabs_barMode_001.top)}`);
expect(Math.round(Tabs_barMode_001.bottom - Tabs_barMode_001.top)).assertEqual(vp2px(244)); // expect(Math.round(Tabs_barMode_001.bottom - Tabs_barMode_001.top)).assertEqual(vp2px(244));
expect(Math.round(Tabs_barMode_002.bottom - Tabs_barMode_002.top)).assertEqual(vp2px(244)); // expect(Math.round(Tabs_barMode_002.bottom - Tabs_barMode_002.top)).assertEqual(vp2px(244));
expect(Math.round(Tabs_barMode_003.bottom - Tabs_barMode_003.top)).assertEqual(vp2px(244)); // expect(Math.round(Tabs_barMode_003.bottom - Tabs_barMode_003.top)).assertEqual(vp2px(244));
expect(Math.round(Tabs_barMode_001.right - Tabs_barMode_001.left)).assertEqual(vp2px(330)); // expect(Math.round(Tabs_barMode_001.right - Tabs_barMode_001.left)).assertEqual(vp2px(330));
expect(Math.round(Tabs_barMode_002.right - Tabs_barMode_002.left)).assertEqual(vp2px(330)); // expect(Math.round(Tabs_barMode_002.right - Tabs_barMode_002.left)).assertEqual(vp2px(330));
expect(Math.round(Tabs_barMode_003.right - Tabs_barMode_003.left)).assertEqual(vp2px(330)); // expect(Math.round(Tabs_barMode_003.right - Tabs_barMode_003.left)).assertEqual(vp2px(330));
//
console.info(`[testTabsBarModeScrollable]subGreen.bottom - subGreen.top= // console.info(`[testTabsBarModeScrollable]subGreen.bottom - subGreen.top=
${Math.round(subGreen.bottom - subGreen.top)}`); // ${Math.round(subGreen.bottom - subGreen.top)}`);
expect(Math.round(subGreen.bottom - subGreen.top)).assertEqual(vp2px(56)); // expect(Math.round(subGreen.bottom - subGreen.top)).assertEqual(vp2px(56));
expect(Math.round(subBlue.bottom - subBlue.top)).assertEqual(vp2px(56)); // expect(Math.round(subBlue.bottom - subBlue.top)).assertEqual(vp2px(56));
expect(Math.round(subYellow.bottom - subYellow.top)).assertEqual(vp2px(56)); // expect(Math.round(subYellow.bottom - subYellow.top)).assertEqual(vp2px(56));
expect(Math.round(subGreen.right - subGreen.left)).assertEqual(vp2px(330)); // expect(Math.round(subGreen.right - subGreen.left)).assertEqual(vp2px(330));
expect(Math.round(subBlue.right - subBlue.left)).assertEqual(vp2px(330)); // expect(Math.round(subBlue.right - subBlue.left)).assertEqual(vp2px(330));
expect(Math.round(subYellow.right - subYellow.left)).assertEqual(vp2px(330)); // expect(Math.round(subYellow.right - subYellow.left)).assertEqual(vp2px(330));
console.info('[testTabsBarModeScrollable] END'); // console.info('[testTabsBarModeScrollable] END');
done(); // done();
}); // });
}) })
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册