提交 c902f1f8 编写于 作者: 雪洛's avatar 雪洛

test: web端启用吸顶测试例

上级 21e2a5ed
describe('component-native-sticky-header', () => { describe('component-native-sticky-header', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { let page
let page beforeAll(async () => {
beforeAll(async () => { page = await program.reLaunch('/pages/component/sticky-header/sticky-header')
page = await program.reLaunch('/pages/component/sticky-header/sticky-header') await page.waitFor('sticky-header')
await page.waitFor('sticky-header') })
})
//检测吸顶效果 //检测吸顶效果
it('check_sticky_header', async () => { it('check_sticky_header', async () => {
await page.callMethod('confirm_scroll_top_input', 600) await page.callMethod('confirm_scroll_top_input', 600)
const image = await program.screenshot(); const image = await program.screenshot();
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}) })
} else { })
// TODO: web 端暂不支持
it('web', async () => {
expect(1).toBe(1)
})
}
})
\ No newline at end of file
describe('component-native-sticky-section', () => { describe('component-native-sticky-section', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) { let page
let page beforeAll(async () => {
beforeAll(async () => { page = await program.reLaunch('/pages/component/sticky-section/sticky-section')
page = await program.reLaunch('/pages/component/sticky-section/sticky-section') await page.waitFor('sticky-section')
await page.waitFor('sticky-section') })
})
//检测吸顶上推效果 //检测吸顶上推效果
it('check_sticky_section', async () => { it('check_sticky_section', async () => {
await page.callMethod('listViewScrollByY', 1000) await page.callMethod('listViewScrollByY', 1000)
const image = await program.screenshot(); const image = await program.screenshot();
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
}) })
it('check_goto_sticky_header', async () => { it('check_goto_sticky_header', async () => {
//滚动回顶部 //滚动回顶部
await page.callMethod('toTop') await page.callMethod('toTop')
page.waitFor(100) page.waitFor(100)
await page.setData({ await page.setData({
scrolling: 'true' scrolling: 'true'
})
//跳转到id为C的StickyHeader位置
await page.callMethod('gotoStickyHeader', 'C')
await page.waitFor(async () => {
return await page.data('scrolling') === false;
});
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
} else {
// TODO: web 端暂不支持
it('web', async () => {
expect(1).toBe(1)
}) })
} if (process.env.uniTestPlatformInfo.startsWith('android')) {
//跳转到id为C的StickyHeader位置
await page.callMethod('gotoStickyHeader', 'C')
}
await page.waitFor(async () => {
return await page.data('scrolling') === false;
});
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
}) })
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册