pwd-retrieve.test.js 930 字节
Newer Older
study夏羽's avatar
study夏羽 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
// jest官方文档: https://www.jestjs.cn/
// uniapp自动化测试教程: https://uniapp.dcloud.io/collocation/auto/quick-start
describe('pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue', () => {

	let page
	beforeAll(async () => {
		page = await program.navigateTo('/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve?phoneNumber=17769516019')
		await page.waitFor(500)
	})

	it('重置密码', async () => {
		await page.setData({
			formData: {
				"phone": "17769516019",
				'pwd': '222222',
				'pwd2': '222222',
				'code':'123456'
			}
		})
		
		if (process.env.UNI_PLATFORM === "h5") {
			const submitRes = await page.callMethod('submit')
			console.log("submitRes: ",submitRes);
			// expect(submitRes.msg).toBe('密码重置成功')
			await page.waitFor(500)
		}
		
		console.log(await program.currentPage());
		// expect((await program.currentPage()).path).toBe('/pages/ucenter/settings/settings')
		
	})
})