提交 b01eeeb8 编写于 作者: 李鲲辉

fit bug for "滚动类组件支持配置fling效果的参数"XTS用例

Signed-off-by: N李鲲辉 <likunhui@huawei.com>
上级 c922ed10
......@@ -15,34 +15,33 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection,
WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest';
import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager';
export default function grid_GridFrictionTest() {
describe('Grid_GridFrictionTest', function () {
describe('grid_GridFrictionTest', function () {
beforeEach(async function (done) {
console.info("Grid_GridFrictionTest beforeEach start");
console.info("GridFrictionPage beforeEach start");
let options = {
url: 'MainAbility/pages/Grid/Grid_attribute/GridFrictionPage',
}
try {
router.clear();
let pages = router.getState();
console.info("get Grid_GridFrictionTest state pages:" + JSON.stringify(pages));
if (!("Grid_GridFrictionTest" == pages.name)) {
console.info("get Grid_GridInitialIndex1 pages.name:" + JSON.stringify(pages.name));
console.info("get GridFrictionPage state pages:" + JSON.stringify(pages));
if (!("GridFrictionPage" == pages.name)) {
console.info("get GridFrictionPage pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Grid_GridFrictionTest page result:" + JSON.stringify(result));
console.info("push GridFrictionPage page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Grid_GridFrictionTest page error:" + err);
console.error("push GridFrictionPage page error:" + err);
}
console.info("Grid_GridFrictionTest beforeEach end");
console.info("GridFrictionPage beforeEach end");
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Grid_GridFrictionTest after each called");
console.info("GridFrictionPage after each called");
});
/**
* @tc.number SUB_ACE_GRID_GRIDFRICTION_001
......@@ -52,10 +51,11 @@ export default function grid_GridFrictionTest() {
it('testGridFriction', 0, async function (done) {
console.info('[testGridFriction] START');
globalThis.value.message.notify({name:'friction', value:-1})
await CommonFunc.sleep(2000);
let gridContainerStrJson = getInspectorByKey('Grid_GridFriction');
let gridContainerObj = JSON.parse(gridContainerStrJson);
expect(gridContainerObj.$type).assertEqual('Grid');
expect(gridContainerObj.$friction).assertEqual(0.6);
expect(gridContainerObj.$attrs.friction).assertEqual(0.6);
console.info('[testGridFriction] END');
done();
});
......@@ -68,10 +68,11 @@ export default function grid_GridFrictionTest() {
it('testGridFriction', 0, async function (done) {
console.info('[testGridFriction] START');
globalThis.value.message.notify({name:'friction', value:10})
await CommonFunc.sleep(2000);
let gridContainerStrJson = getInspectorByKey('Grid_GridFriction');
let gridContainerObj = JSON.parse(gridContainerStrJson);
expect(gridContainerObj.$type).assertEqual('Grid');
expect(gridContainerObj.$friction).assertEqual(10);
expect(gridContainerObj.$attrs.friction).assertEqual(10);
console.info('[testGridFriction] END');
done();
});
......
......@@ -15,34 +15,34 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection,
WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest';
import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager';
export default function list_ListFrictionTest() {
describe('List_ListFrictionTest', function () {
describe('list_ListFrictionTest', function () {
beforeEach(async function (done) {
console.info("List_ListFrictionTest beforeEach start");
console.info("ListFrictionPage beforeEach start");
let options = {
url: 'MainAbility/pages/List/List_attribute/ListFrictionPage',
}
try {
router.clear();
let pages = router.getState();
console.info("get List_ListFrictionTest state pages:" + JSON.stringify(pages));
if (!("list_ListFrictionTest" == pages.name)) {
console.info("get List_ListInitialIndex1 pages.name:" + JSON.stringify(pages.name));
console.info("get ListFrictionPage state pages:" + JSON.stringify(pages));
if (!("ListFrictionPage" == pages.name)) {
console.info("get ListFrictionPage pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push List_ListFrictionTest page result:" + JSON.stringify(result));
console.info("push ListFrictionPage page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push List_ListFrictionTest page error:" + err);
console.error("push ListFrictionPage page error:" + err);
}
console.info("List_ListFrictionTest beforeEach end");
console.info("ListFrictionPage beforeEach end");
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("List_ListFrictionTest after each called");
console.info("ListFrictionPage after each called");
});
/**
* @tc.number SUB_ACE_LIST_LISTFRICTION_001
......@@ -52,10 +52,11 @@ export default function list_ListFrictionTest() {
it('testListFriction', 0, async function (done) {
console.info('[testListFriction] START');
globalThis.value.message.notify({name:'friction', value:-1})
await CommonFunc.sleep(2000);
let listContainerStrJson = getInspectorByKey('List_ListFriction');
let listContainerObj = JSON.parse(listContainerStrJson);
expect(listContainerObj.$type).assertEqual('List');
expect(listContainerObj.$friction).assertEqual(0.6);
expect(listContainerObj.$attrs.friction).assertEqual(0.6);
console.info('[testListFriction] END');
done();
});
......@@ -68,10 +69,11 @@ export default function list_ListFrictionTest() {
it('testListFriction', 0, async function (done) {
console.info('[testListFriction] START');
globalThis.value.message.notify({name:'friction', value:10})
await CommonFunc.sleep(2000);
let listContainerStrJson = getInspectorByKey('List_ListFriction');
let listContainerObj = JSON.parse(listContainerStrJson);
expect(listContainerObj.$type).assertEqual('List');
expect(listContainerObj.$friction).assertEqual(10);
expect(listContainerObj.$attrs.friction).assertEqual(10);
console.info('[testListFriction] END');
done();
});
......
......@@ -15,34 +15,33 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection,
WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest';
import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager';
export default function scroll_ScrollFrictionTest() {
describe('Scroll_ScrollFrictionTest', function () {
describe('scroll_ScrollFrictionTest', function () {
beforeEach(async function (done) {
console.info("Scroll_ScrollFrictionTest beforeEach start");
console.info("ScrollFrictionPage beforeEach start");
let options = {
url: 'MainAbility/pages/Scroll/Scroll_attribute/ScrollFrictionPage',
}
try {
router.clear();
let pages = router.getState();
console.info("get Scroll_ScrollFrictionTest state pages:" + JSON.stringify(pages));
if (!("Scroll_ScrollFrictionTest" == pages.name)) {
console.info("get ScrollFrictionPage state pages:" + JSON.stringify(pages));
if (!("ScrollFrictionPage" == pages.name)) {
console.info("get Scroll_ScrollInitialIndex1 pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push Scroll_ScrollFrictionTest page result:" + JSON.stringify(result));
console.info("push ScrollFrictionPage page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push Scroll_ScrollFrictionTest page error:" + err);
console.error("push ScrollFrictionPage page error:" + err);
}
console.info("Scroll_ScrollFrictionTest beforeEach end");
console.info("ScrollFrictionPage beforeEach end");
done();
});
afterEach(async function () {
await CommonFunc.sleep(1000);
console.info("Scroll_ScrollFrictionTest after each called");
console.info("ScrollFrictionPage after each called");
});
/**
* @tc.number SUB_ACE_SCROLL_SCROLLFRICTION_001
......@@ -52,10 +51,11 @@ export default function scroll_ScrollFrictionTest() {
it('testScrollFriction', 0, async function (done) {
console.info('[testScrollFriction] START');
globalThis.value.message.notify({name:'friction', value:-1})
await CommonFunc.sleep(2000);
let scrollContainerStrJson = getInspectorByKey('Scroll_ScrollFriction');
let scrollContainerObj = JSON.parse(scrollContainerStrJson);
expect(scrollContainerObj.$type).assertEqual('Scroll');
expect(scrollContainerObj.$friction).assertEqual(0.6);
expect(scrollContainerObj.$attrs.friction).assertEqual(0.6);
console.info('[testScrollFriction] END');
done();
});
......@@ -68,10 +68,11 @@ export default function scroll_ScrollFrictionTest() {
it('testScrollFriction', 0, async function (done) {
console.info('[testScrollFriction] START');
globalThis.value.message.notify({name:'friction', value:10})
await CommonFunc.sleep(2000);
let scrollContainerStrJson = getInspectorByKey('Scroll_ScrollFriction');
let scrollContainerObj = JSON.parse(scrollContainerStrJson);
expect(scrollContainerObj.$type).assertEqual('Scroll');
expect(scrollContainerObj.$friction).assertEqual(10);
expect(scrollContainerObj.$attrs.friction).assertEqual(10);
console.info('[testScrollFriction] END');
done();
});
......
......@@ -15,29 +15,28 @@
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
import router from '@ohos.router';
import CommonFunc from '../../../MainAbility/common/Common';
import { UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection,
WindowMode, PointerMatrix, UiDirection, MouseButton } from '@ohos.UiTest';
import { MessageManager,Callback } from '../../../MainAbility/common/MessageManager';
export default function waterFlow_WaterFlowFrictionTest() {
describe('WaterFlow_WaterFlowFrictionTest', function () {
describe('waterFlow_WaterFlowFrictionTest', function () {
beforeEach(async function (done) {
console.info("WaterFlow_WaterFlowFrictionTest beforeEach start");
console.info("WaterFlowFrictionPage beforeEach start");
let options = {
url: 'MainAbility/pages/WaterFlow/WaterFlow_attribute/WaterFlowFrictionPage',
}
try {
router.clear();
let pages = router.getState();
console.info("get WaterFlow_WaterFlowFrictionTest state pages:" + JSON.stringify(pages));
if (!("WaterFlow_WaterFlowFrictionTest" == pages.name)) {
console.info("get WaterFlowFrictionPage state pages:" + JSON.stringify(pages));
if (!("WaterFlowFrictionPage" == pages.name)) {
console.info("get WaterFlow_WaterFlow pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push WaterFlow_WaterFlowFrictionTest page result:" + JSON.stringify(result));
console.info("push WaterFlowFrictionPage page result:" + JSON.stringify(result));
}
} catch (err) {
console.error("push WaterFlow_WaterFlowFrictionTest page error:" + err);
console.error("push WaterFlowFrictionPage page error:" + err);
}
console.info("WaterFlow_WaterFlowFrictionTest beforeEach end");
console.info("WaterFlowFrictionPage beforeEach end");
done();
});
afterEach(async function () {
......@@ -52,10 +51,11 @@ export default function waterFlow_WaterFlowFrictionTest() {
it('testWaterFlowFriction', 0, async function (done) {
console.info('[testWaterFlowFriction] START');
globalThis.value.message.notify({name:'friction', value:-1})
await CommonFunc.sleep(2000);
let scrollContainerStrJson = getInspectorByKey('WaterFlow_WaterFlowFriction');
let scrollContainerObj = JSON.parse(scrollContainerStrJson);
expect(scrollContainerObj.$type).assertEqual('WaterFlow');
expect(scrollContainerObj.$friction).assertEqual(0.6);
expect(scrollContainerObj.$attrs.friction).assertEqual(0.6);
console.info('[testWaterFlowFriction] END');
done();
});
......@@ -68,10 +68,11 @@ export default function waterFlow_WaterFlowFrictionTest() {
it('testWaterFlowFriction', 0, async function (done) {
console.info('[testWaterFlowFriction] START');
globalThis.value.message.notify({name:'friction', value:10})
await CommonFunc.sleep(2000);
let scrollContainerStrJson = getInspectorByKey('WaterFlow_WaterFlowFriction');
let scrollContainerObj = JSON.parse(scrollContainerStrJson);
expect(scrollContainerObj.$type).assertEqual('WaterFlow');
expect(scrollContainerObj.$friction).assertEqual(10);
expect(scrollContainerObj.$attrs.friction).assertEqual(10);
console.info('[testWaterFlowFriction] END');
done();
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册