pages.test.js 743 字节
Newer Older
A
Anne_LXM 已提交
1 2
let pageIndex = 0
const pages = [
A
Anne_LXM 已提交
3
	'/uni_modules/uni-id-pages/pages/login/login-withpwd'
A
Anne_LXM 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
]

let page;
describe('page screenshot test', () => {
	beforeAll(async () => {
		console.log("page screenshot test start");
	});
	beforeEach(async () => {
		page = await program.reLaunch(pages[pageIndex]);
		await page.waitFor(1000);
	});
	afterEach(() => {
		pageIndex++;
	});
	afterAll(() => {
		console.log("page screenshot test finish");
	});
	test.each(pages)('%s', async () => {
22 23 24 25 26 27 28 29
		// const image = await program.screenshot();
		// expect(image).toMatchImageSnapshot();
		// await page.waitFor(500);
    const image = await program.screenshot({
    	fullPage: true
    });
    expect(image).toSaveImageSnapshot();
    await page.waitFor(500);
A
Anne_LXM 已提交
30 31
	})
})