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

test: 优化测试等待时间

上级 aee12dd7
...@@ -55,63 +55,63 @@ describe("onLoad", () => { ...@@ -55,63 +55,63 @@ describe("onLoad", () => {
}); });
it("showToast", async () => { it("showToast", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor('view'); await page.waitFor("view");
await page.callMethod("navigateToOnLoadWithType", "showToast"); await page.callMethod("navigateToOnLoadWithType", "showToast");
await page.waitFor(500); await page.waitFor(1000);
const image = await program.screenshot({ const image = await program.screenshot({
adb: true, adb: true,
area: { area: {
x: 0, x: 0,
y: 200, y: 200,
height: 2140 height: 2140,
} },
}); });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
await page.waitFor('view'); await page.waitFor("view");
}); });
it("showLoading", async () => { it("showLoading", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor('view'); await page.waitFor("view");
await page.callMethod("navigateToOnLoadWithType", "showLoading"); await page.callMethod("navigateToOnLoadWithType", "showLoading");
await page.waitFor(500); await page.waitFor(1000);
const image = await program.screenshot({ const image = await program.screenshot({
adb: true, adb: true,
area: { area: {
x: 0, x: 0,
y: 200, y: 200,
height: 2140 height: 2140,
} },
}); });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}); });
it("showModal", async () => { it("showModal", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor('view'); await page.waitFor("view");
await page.callMethod("navigateToOnLoadWithType", "showModal"); await page.callMethod("navigateToOnLoadWithType", "showModal");
await page.waitFor(500); await page.waitFor(1000);
const image = await program.screenshot({ const image = await program.screenshot({
adb: true, adb: true,
area: { area: {
x: 0, x: 0,
y: 200, y: 200,
height: 2140 height: 2140,
} },
}); });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}); });
it("showActionSheet", async () => { it("showActionSheet", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
await page.waitFor('view'); await page.waitFor("view");
await page.callMethod("navigateToOnLoadWithType", "showActionSheet"); await page.callMethod("navigateToOnLoadWithType", "showActionSheet");
await page.waitFor(500); await page.waitFor(1000);
const image = await program.screenshot({ const image = await program.screenshot({
adb: true, adb: true,
area: { area: {
x: 0, x: 0,
y: 200, y: 200,
height: 2140 height: 2140,
} },
}); });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}); });
}); });
...@@ -18,7 +18,7 @@ describe('Progress.uvue', () => { ...@@ -18,7 +18,7 @@ describe('Progress.uvue', () => {
const p2 = await page.$('.p2') const p2 = await page.$('.p2')
const p3 = await page.$('.p3') const p3 = await page.$('.p3')
await page.callMethod('setProgress') await page.callMethod('setProgress')
await page.waitFor(1000) await page.waitFor(2000);
expect(await p.property('percent')).toEqual(20) expect(await p.property('percent')).toEqual(20)
expect(await p1.property('percent')).toEqual(40) expect(await p1.property('percent')).toEqual(40)
expect(await p2.property('percent')).toEqual(60) expect(await p2.property('percent')).toEqual(60)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册