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

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 () => {
		const image = await program.screenshot();
		expect(image).toMatchImageSnapshot();
		await page.waitFor(500);
	})
})