提交 38736a20 编写于 作者: H hdx

navigator组件:增加自动化测试

上级 d7d5df6b
const PAGE_PATH = '/pages/component/navigator/navigator'
const PAGE_PATH_NAVIGATE = '/pages/component/navigator/navigate'
const PAGE_PATH_REDIRECT = '/pages/component/navigator/redirect'
describe('navigator', () => {
let page
beforeAll(async () => {})
it('navigate', async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
const btnNavigate = await page.$('.navigate')
await btnNavigate.tap()
await page.waitFor(100)
const currentPage = await program.currentPage()
expect(currentPage.path).toBe(PAGE_PATH_NAVIGATE.substring(1))
})
it('redirect', async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor(500)
const btnRedirect = await page.$('.redirect')
await btnRedirect.tap()
await page.waitFor(100)
const currentPage = await program.currentPage()
expect(currentPage.path).toBe(PAGE_PATH_REDIRECT.substring(1))
})
})
......@@ -2,10 +2,10 @@
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<navigator class="navigator" url="navigate?title=navigate">
<navigator class="navigator navigate" url="navigate?title=navigate">
<button type="default">跳转到新页面</button>
</navigator>
<navigator class="navigator" url="redirect?title=redirect" open-type="redirect">
<navigator class="navigator redirect" url="redirect?title=redirect" open-type="redirect">
<button type="default">在当前页打开</button>
</navigator>
</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册