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

test: web端启用吸顶测试例

上级 21e2a5ed
describe('component-native-sticky-header', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/sticky-header/sticky-header')
await page.waitFor('sticky-header')
})
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/sticky-header/sticky-header')
await page.waitFor('sticky-header')
})
//检测吸顶效果
it('check_sticky_header', async () => {
await page.callMethod('confirm_scroll_top_input', 600)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
} else {
// TODO: web 端暂不支持
it('web', async () => {
expect(1).toBe(1)
})
}
})
\ No newline at end of file
//检测吸顶效果
it('check_sticky_header', async () => {
await page.callMethod('confirm_scroll_top_input', 600)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
})
describe('component-native-sticky-section', () => {
if (process.env.uniTestPlatformInfo.startsWith('android')) {
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/sticky-section/sticky-section')
await page.waitFor('sticky-section')
})
let page
beforeAll(async () => {
page = await program.reLaunch('/pages/component/sticky-section/sticky-section')
await page.waitFor('sticky-section')
})
//检测吸顶上推效果
it('check_sticky_section', async () => {
await page.callMethod('listViewScrollByY', 1000)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
it('check_goto_sticky_header', async () => {
//滚动回顶部
await page.callMethod('toTop')
page.waitFor(100)
await page.setData({
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)
//检测吸顶上推效果
it('check_sticky_section', async () => {
await page.callMethod('listViewScrollByY', 1000)
const image = await program.screenshot();
expect(image).toMatchImageSnapshot();
})
it('check_goto_sticky_header', async () => {
//滚动回顶部
await page.callMethod('toTop')
page.waitFor(100)
await page.setData({
scrolling: 'true'
})
}
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.
先完成此消息的编辑!
想要评论请 注册