提交 625eb050 编写于 作者: H hdx

navigator: 自动化测试使用id作为查询元素的标识

上级 aff62b6b
......@@ -15,7 +15,7 @@ describe('navigator', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
const btnNavigate = await page.$('.navigate')
const btnNavigate = await page.$('#navigate')
await btnNavigate.tap()
await page.waitFor(300)
......@@ -26,7 +26,7 @@ describe('navigator', () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
const btnRedirect = await page.$('.redirect')
const btnRedirect = await page.$('#redirect')
await btnRedirect.tap()
await page.waitFor(300)
......
<template>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<navigator class="navigator navigate" url="navigate?title=navigate">
<navigator id="navigate" class="navigator" url="navigate?title=navigate">
<button type="default">跳转到新页面</button>
</navigator>
<navigator class="navigator redirect" url="redirect?title=redirect" open-type="redirect">
<navigator id="redirect" class="navigator" url="redirect?title=redirect" open-type="redirect">
<button type="default">在当前页打开redirect</button>
</navigator>
<navigator id="switchTab" class="navigator" url="/pages/tabBar/template" open-type="switchTab">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册