提交 febdb369 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

test: 优化测试 waitFor 等待时间

上级 00efb758
...@@ -5,7 +5,7 @@ let page; ...@@ -5,7 +5,7 @@ let page;
describe("getElementByIdForMultipleRootNode", () => { describe("getElementByIdForMultipleRootNode", () => {
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH); page = await program.reLaunch(PAGE_PATH);
await page.waitFor(1000); await page.waitFor('view');
}); });
it("getElementByNotExistId", async () => { it("getElementByNotExistId", async () => {
const res = await page.callMethod("getElementByNotExistId"); const res = await page.callMethod("getElementByNotExistId");
......
...@@ -4,7 +4,7 @@ let page; ...@@ -4,7 +4,7 @@ let page;
describe("getElementById", () => { describe("getElementById", () => {
beforeAll(async () => { beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH); page = await program.reLaunch(PAGE_PATH);
await page.waitFor(1000); await page.waitFor('view');
}); });
it("getElementByNotExistId", async () => { it("getElementByNotExistId", async () => {
const res = await page.callMethod("getElementByNotExistId"); const res = await page.callMethod("getElementByNotExistId");
......
...@@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/API/get-launch-options-sync/get-launch-options-sync' ...@@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/API/get-launch-options-sync/get-launch-options-sync'
describe('getLaunchOptionsSync', () => { describe('getLaunchOptionsSync', () => {
it('getLaunchOptionsSync', async () => { it('getLaunchOptionsSync', async () => {
const page = await program.navigateTo(PAGE_PATH) const page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
await page.callMethod('getLaunchOptionsSync') await page.callMethod('getLaunchOptionsSync')
const data = await page.data() const data = await page.data()
expect(data.checked).toBe(true) expect(data.checked).toBe(true)
......
...@@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/API/load-font-face/load-font-face-child' ...@@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/API/load-font-face/load-font-face-child'
describe('loadFontFace global', () => { describe('loadFontFace global', () => {
beforeAll(async () => { beforeAll(async () => {
const page = await program.navigateTo(PAGE_PATH) const page = await program.navigateTo(PAGE_PATH)
await page.waitFor(2000) await page.waitFor('view')
}) })
it('screenshot', async () => { it('screenshot', async () => {
const image = await program.screenshot() const image = await program.screenshot()
......
...@@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/API/load-font-face/load-font-face' ...@@ -3,7 +3,7 @@ const PAGE_PATH = '/pages/API/load-font-face/load-font-face'
describe('loadFontFace', () => { describe('loadFontFace', () => {
beforeAll(async () => { beforeAll(async () => {
const page = await program.navigateTo(PAGE_PATH) const page = await program.navigateTo(PAGE_PATH)
await page.waitFor(4000) await page.waitFor(3000)
}) })
it('screenshot', async () => { it('screenshot', async () => {
const image = await program.screenshot() const image = await program.screenshot()
......
...@@ -17,12 +17,12 @@ describe('navigator', () => { ...@@ -17,12 +17,12 @@ describe('navigator', () => {
it('reLaunch', async () => { it('reLaunch', async () => {
page = await program.navigateTo(CURRENT_PAGE_PATH) page = await program.navigateTo(CURRENT_PAGE_PATH)
await page.waitFor(500) await page.waitFor('view')
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('reLaunch') await page.callMethod('reLaunch')
await page.waitFor(500) await page.waitFor(500)
page = await program.navigateTo(CURRENT_PAGE_PATH) page = await program.navigateTo(CURRENT_PAGE_PATH)
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
}) })
...@@ -30,11 +30,11 @@ describe('navigator', () => { ...@@ -30,11 +30,11 @@ describe('navigator', () => {
it('navigateTo', async () => { it('navigateTo', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateTo') await page.callMethod('navigateTo')
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(500) await page.waitFor('view')
}) })
it('navigateTo error page', async () => { it('navigateTo error page', async () => {
...@@ -52,45 +52,41 @@ describe('navigator', () => { ...@@ -52,45 +52,41 @@ describe('navigator', () => {
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(4) expect(lifeCycleNum).toBe(4)
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(500) await page.waitFor('view')
}) })
it('navigateTo relative path', async () => { it('navigateTo relative path', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateToRelativePath1') await page.callMethod('navigateToRelativePath1')
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
await page.waitFor(500)
}) })
it('navigateTo relative path ./', async () => { it('navigateTo relative path ./', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateToRelativePath2') await page.callMethod('navigateToRelativePath2')
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
await page.waitFor(500)
}) })
it('navigateTo relative path ../', async () => { it('navigateTo relative path ../', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateToRelativePath3') await page.callMethod('navigateToRelativePath3')
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
await page.waitFor(500)
}) })
it('navigateBack', async () => { it('navigateBack', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateBack') await page.callMethod('navigateBack')
await page.waitFor(500)
page = await program.navigateTo(CURRENT_PAGE_PATH) page = await program.navigateTo(CURRENT_PAGE_PATH)
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
}) })
...@@ -98,7 +94,6 @@ describe('navigator', () => { ...@@ -98,7 +94,6 @@ describe('navigator', () => {
it('navigateBackWithDelta1', async () => { it('navigateBackWithDelta1', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateBackWithDelta1') await page.callMethod('navigateBackWithDelta1')
await page.waitFor(1000)
page = await program.currentPage() page = await program.currentPage()
expect(`/${page.path}`).toBe(CURRENT_PAGE_PATH) expect(`/${page.path}`).toBe(CURRENT_PAGE_PATH)
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
...@@ -108,11 +103,8 @@ describe('navigator', () => { ...@@ -108,11 +103,8 @@ describe('navigator', () => {
it('navigateBackWithDelta2', async () => { it('navigateBackWithDelta2', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await program.navigateTo(CHILD2_PAGE_PATH) await program.navigateTo(CHILD2_PAGE_PATH)
await page.waitFor(500)
page = await program.navigateTo(CHILD1_PAGE_PATH) page = await program.navigateTo(CHILD1_PAGE_PATH)
await page.waitFor(500)
await page.callMethod('navigateBackWithDelta2') await page.callMethod('navigateBackWithDelta2')
await page.waitFor(500)
page = await program.currentPage() page = await program.currentPage()
expect(`/${page.path}`).toBe(CURRENT_PAGE_PATH) expect(`/${page.path}`).toBe(CURRENT_PAGE_PATH)
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
...@@ -123,8 +115,8 @@ describe('navigator', () => { ...@@ -123,8 +115,8 @@ describe('navigator', () => {
page = await program.reLaunch(CURRENT_PAGE_PATH) page = await program.reLaunch(CURRENT_PAGE_PATH)
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('navigateBackWithDelta100') await page.callMethod('navigateBackWithDelta100')
await page.waitFor(1000)
page = await program.currentPage() page = await program.currentPage()
await page.waitFor('view')
expect(`/${page.path}`).toBe(CURRENT_PAGE_PATH) expect(`/${page.path}`).toBe(CURRENT_PAGE_PATH)
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
...@@ -133,9 +125,8 @@ describe('navigator', () => { ...@@ -133,9 +125,8 @@ describe('navigator', () => {
it('redirectTo', async () => { it('redirectTo', async () => {
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('redirectTo') await page.callMethod('redirectTo')
await page.waitFor(500)
page = await program.redirectTo(CURRENT_PAGE_PATH) page = await program.redirectTo(CURRENT_PAGE_PATH)
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
}) })
...@@ -144,9 +135,8 @@ describe('navigator', () => { ...@@ -144,9 +135,8 @@ describe('navigator', () => {
page = await program.reLaunch(CURRENT_PAGE_PATH) page = await program.reLaunch(CURRENT_PAGE_PATH)
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
await page.callMethod('switchTab') await page.callMethod('switchTab')
await page.waitFor(500)
page = await program.navigateTo(CURRENT_PAGE_PATH) page = await program.navigateTo(CURRENT_PAGE_PATH)
await page.waitFor(500) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(2) expect(lifeCycleNum).toBe(2)
}) })
......
jest.setTimeout(30000) jest.setTimeout(20000)
const PAGE_PATH = '/pages/API/navigator/new-page/new-page-2' const PAGE_PATH = '/pages/API/navigator/new-page/new-page-2'
const INTERMEDIATE_PAGE_PATH = '/pages/API/navigator/navigator' const INTERMEDIATE_PAGE_PATH = '/pages/API/navigator/navigator'
let page let page
...@@ -7,13 +7,13 @@ let lifeCycleNum ...@@ -7,13 +7,13 @@ let lifeCycleNum
describe('app-lifecycle', () => { describe('app-lifecycle', () => {
it('onLaunch onShow', async () => { it('onLaunch onShow', async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH) page = await program.reLaunch(INTERMEDIATE_PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(1100) expect(lifeCycleNum).toBe(1100)
}) })
it('onLastPageBackPress', async () => { it('onLastPageBackPress', async () => {
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(100) expect(lifeCycleNum).toBe(100)
...@@ -26,7 +26,7 @@ describe('app-lifecycle', () => { ...@@ -26,7 +26,7 @@ describe('app-lifecycle', () => {
describe('page-lifecycle', () => { describe('page-lifecycle', () => {
it('onLoad onShow onReady', async () => { it('onLoad onShow onReady', async () => {
page = await program.reLaunch(PAGE_PATH) page = await program.reLaunch(PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(120) expect(lifeCycleNum).toBe(120)
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
...@@ -48,28 +48,28 @@ describe('page-lifecycle', () => { ...@@ -48,28 +48,28 @@ describe('page-lifecycle', () => {
}) })
it('onHide', async () => { it('onHide', async () => {
page = await program.navigateTo(INTERMEDIATE_PAGE_PATH) page = await program.navigateTo(INTERMEDIATE_PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(-10) expect(lifeCycleNum).toBe(-10)
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(0) expect(lifeCycleNum).toBe(0)
}) })
it('onUnload', async () => { it('onUnload', async () => {
page = await program.redirectTo(INTERMEDIATE_PAGE_PATH) page = await program.redirectTo(INTERMEDIATE_PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(-100) expect(lifeCycleNum).toBe(-100)
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
}) })
it('onBackPress', async () => { it('onBackPress', async () => {
page = await program.navigateTo(PAGE_PATH) page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(120) expect(lifeCycleNum).toBe(120)
page = await program.navigateBack() page = await program.navigateBack()
await page.waitFor(1000) await page.waitFor('view')
lifeCycleNum = await page.callMethod('getLifeCycleNum') lifeCycleNum = await page.callMethod('getLifeCycleNum')
expect(lifeCycleNum).toBe(10) expect(lifeCycleNum).toBe(10)
await page.callMethod('setLifeCycleNum', 0) await page.callMethod('setLifeCycleNum', 0)
......
...@@ -7,50 +7,50 @@ let page; ...@@ -7,50 +7,50 @@ let page;
describe("onLoad", () => { describe("onLoad", () => {
it("adjustData", async () => { it("adjustData", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor(500); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "adjustData"); await page.callMethod("navigateToOnLoadWithType", "adjustData");
await page.waitFor(1000); await page.waitFor(500);
const image = await program.screenshot(); const image = await program.screenshot();
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}); });
it("navigateTo", async () => { it("navigateTo", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor(500); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "navigateTo"); await page.callMethod("navigateToOnLoadWithType", "navigateTo");
await page.waitFor(1000); await page.waitFor(500);
page = await program.currentPage(); page = await program.currentPage();
expect(page.path).toBe(TARGET_PAGE_PATH.substring(1)); expect(page.path).toBe(TARGET_PAGE_PATH.substring(1));
}); });
it("navigateBack", async () => { it("navigateBack", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor(500); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "navigateBack"); await page.callMethod("navigateToOnLoadWithType", "navigateBack");
await page.waitFor(1000);
page = await program.currentPage(); page = await program.currentPage();
await page.waitFor('view');
expect(page.path).toBe(INTERMEDIATE_PAGE_PATH.substring(1)); expect(page.path).toBe(INTERMEDIATE_PAGE_PATH.substring(1));
}); });
it("redirectTo", async () => { it("redirectTo", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor(500); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "redirectTo"); await page.callMethod("navigateToOnLoadWithType", "redirectTo");
await page.waitFor(1000); await page.waitFor(500);
page = await program.currentPage(); page = await program.currentPage();
expect(page.path).toBe(TARGET_PAGE_PATH.substring(1)); expect(page.path).toBe(TARGET_PAGE_PATH.substring(1));
}); });
it("reLaunch", async () => { it("reLaunch", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor(500); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "reLaunch"); await page.callMethod("navigateToOnLoadWithType", "reLaunch");
await page.waitFor(1000); await page.waitFor(500);
page = await program.currentPage(); page = await program.currentPage();
expect(page.path).toBe(TARGET_PAGE_PATH.substring(1)); expect(page.path).toBe(TARGET_PAGE_PATH.substring(1));
}); });
it("switchTab", async () => { it("switchTab", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor(500); await page.waitFor('view');
await page.callMethod("navigateToOnLoadWithType", "switchTab"); await page.callMethod("navigateToOnLoadWithType", "switchTab");
await page.waitFor(1000);
page = await program.currentPage(); page = await program.currentPage();
await page.waitFor('view');
expect(page.path).toBe("pages/tabBar/component"); expect(page.path).toBe("pages/tabBar/component");
}); });
// toast 出现在 INTERMEDIATE_PAGE_PATH 页面(非 onLoad 生命周期所在页面) // toast 出现在 INTERMEDIATE_PAGE_PATH 页面(非 onLoad 生命周期所在页面)
...@@ -66,7 +66,7 @@ describe("onLoad", () => { ...@@ -66,7 +66,7 @@ describe("onLoad", () => {
// 同 toast // 同 toast
// it("showLoading", async () => { // it("showLoading", async () => {
// page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); // page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
// await page.waitFor(500); // await page.waitFor('view');
// await page.callMethod("navigateToOnLoadWithType", "showLoading"); // await page.callMethod("navigateToOnLoadWithType", "showLoading");
// await page.waitFor(1000); // await page.waitFor(1000);
// const image = await program.screenshot(); // const image = await program.screenshot();
...@@ -75,7 +75,7 @@ describe("onLoad", () => { ...@@ -75,7 +75,7 @@ describe("onLoad", () => {
// 同 toast // 同 toast
// it("showModal", async () => { // it("showModal", async () => {
// page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); // page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
// await page.waitFor(500); // await page.waitFor('view');
// await page.callMethod("navigateToOnLoadWithType", "showModal"); // await page.callMethod("navigateToOnLoadWithType", "showModal");
// await page.waitFor(1000); // await page.waitFor(1000);
// const image = await program.screenshot(); // const image = await program.screenshot();
...@@ -84,7 +84,7 @@ describe("onLoad", () => { ...@@ -84,7 +84,7 @@ describe("onLoad", () => {
// 同 toast // 同 toast
// it("showActionSheet", async () => { // it("showActionSheet", async () => {
// page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); // page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
// await page.waitFor(500); // await page.waitFor('view');
// await page.callMethod("navigateToOnLoadWithType", "showActionSheet"); // await page.callMethod("navigateToOnLoadWithType", "showActionSheet");
// await page.waitFor(1000); // await page.waitFor(1000);
// const image = await program.screenshot(); // const image = await program.screenshot();
......
...@@ -5,7 +5,7 @@ describe('general attribute', () => { ...@@ -5,7 +5,7 @@ describe('general attribute', () => {
beforeAll(async () => { beforeAll(async () => {
page = await program.navigateTo(PAGE_PATH) page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
}) })
it("class & style", async () => { it("class & style", async () => {
const image = await program.screenshot(); const image = await program.screenshot();
...@@ -20,7 +20,7 @@ describe('general attribute', () => { ...@@ -20,7 +20,7 @@ describe('general attribute', () => {
it("ref", async () => { it("ref", async () => {
const button = await page.$(".btn-ref"); const button = await page.$(".btn-ref");
await button.tap(); await button.tap();
await page.waitFor(1000); await page.waitFor(500);
const image = await program.screenshot(); const image = await program.screenshot();
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}); });
......
...@@ -5,7 +5,7 @@ describe('event trigger sequence', () => { ...@@ -5,7 +5,7 @@ describe('event trigger sequence', () => {
let el let el
beforeAll(async () => { beforeAll(async () => {
page = await program.navigateTo(PAGE_PATH) page = await program.navigateTo(PAGE_PATH)
await page.waitFor(1000) await page.waitFor('view')
el = await page.$('.target') el = await page.$('.target')
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册