settings.test.js 1.0 KB
Newer Older
study夏羽's avatar
study夏羽 已提交
1 2 3
// uniapp自动化测试教程: https://uniapp-test.dcloud.net.cn/docs/testcase/start

describe('pages/ucenter/settings/settings', () => {
study夏羽's avatar
study夏羽 已提交
4
	let page,uniToken;
study夏羽's avatar
study夏羽 已提交
5
	beforeAll(async () => {
study夏羽's avatar
study夏羽 已提交
6 7
		try {
			page = await program.navigateTo('/pages/ucenter/settings/settings')
study夏羽's avatar
study夏羽 已提交
8 9 10 11
			await page.waitFor(1000)
			console.log("pageStack: ",await program.pageStack());
			uniToken = await page.data('uniToken')
			console.log('uniToken:',uniToken);
study夏羽's avatar
study夏羽 已提交
12 13 14
		} catch (e) {
			console.log("e: ",e);
		}
study夏羽's avatar
study夏羽 已提交
15
	})
study夏羽's avatar
study夏羽 已提交
16

study夏羽's avatar
study夏羽 已提交
17 18
	it('settings', async () => {
		if (process.env.UNI_PLATFORM == "app-plus") {
study夏羽's avatar
study夏羽 已提交
19
			await page.callMethod('clearTmp')
study夏羽's avatar
study夏羽 已提交
20
			// console.log(await page.data('pushIsOn'), "pushIsOn-------------");
study夏羽's avatar
study夏羽 已提交
21 22
			const pushRes = await page.data('pushIsOn')
			if (pushRes == "wait") {
study夏羽's avatar
study夏羽 已提交
23 24 25
				await page.callMethod('pushServer.off')
			}
		}
study夏羽's avatar
study夏羽 已提交
26 27 28
		await page.callMethod('deactivate')
		await page.waitFor(300)
		await program.navigateBack()
study夏羽's avatar
study夏羽 已提交
29
	})
study夏羽's avatar
study夏羽 已提交
30

study夏羽's avatar
study夏羽 已提交
31 32
	it('退出登录', async () => {
		
study夏羽's avatar
study夏羽 已提交
33
		if(uniToken){
study夏羽's avatar
study夏羽 已提交
34 35
			await page.callMethod('clickLogout')
		}
study夏羽's avatar
study夏羽 已提交
36
		// console.log(await program.currentPage(),"333333");
study夏羽's avatar
study夏羽 已提交
37
	})
study夏羽's avatar
study夏羽 已提交
38 39

});