提交 228cce67 编写于 作者: Q qiang

test: 拦截器示例增加自动化测试

上级 fb7daedc
const PAGE_PATH = '/pages/API/interceptor/interceptor'
describe('interceptor', () => {
let page
beforeAll(async () => {
page = await program.reLaunch(PAGE_PATH)
await page.waitFor('view')
})
it('no Interceptor', async () => {
const newPage = await program.navigateTo('./page1')
await newPage.waitFor('text')
const num = (await newPage.data()).page
await program.navigateBack()
expect(num).toBe(1)
})
it('addInterceptor', async () => {
await page.callMethod('addInterceptor')
const newPage = await program.navigateTo('./page1')
await newPage.waitFor('text')
const num = (await newPage.data()).page
await program.navigateBack()
expect(num).toBe(2)
})
it('removeInterceptor', async () => {
await page.callMethod('removeInterceptor')
const newPage = await program.navigateTo('./page1')
await newPage.waitFor('text')
const num = (await newPage.data()).page
await program.navigateBack()
expect(num).toBe(1)
})
})
\ No newline at end of file
......@@ -8,7 +8,7 @@
export default {
data() {
return {
page: 1
}
},
methods: {
......
......@@ -8,7 +8,7 @@
export default {
data() {
return {
page: 2
}
},
methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册