list-view-multiplex.test.js 1.0 KB
Newer Older
雪洛's avatar
雪洛 已提交
1 2 3
describe('component-native-list-view', () => {
  if (process.env.uniTestPlatformInfo.startsWith('web')) {
    it('dummyTest', async () => {
DCloud-WZF's avatar
DCloud-WZF 已提交
4
      expect(1).toBe(1)
雪洛's avatar
雪洛 已提交
5 6
    })
    return
DCloud-WZF's avatar
DCloud-WZF 已提交
7
  }
雪洛's avatar
雪洛 已提交
8 9 10 11 12 13 14 15 16 17 18 19
  let page
  beforeAll(async () => {
    //打开list-view-multiplex测试页
    page = await program.reLaunch('/pages/component/list-view/list-view-multiplex')
    await page.waitFor('list-view')
  })

  //滚动list-view到底部 加载更多 如果异常则直接闪退
  it('check_list_item_multiplex', async () => {
    await page.callMethod('listViewScrollByY', 5000)
    await page.waitFor(400)
    await page.callMethod('listViewScrollByY', 100)
shutao-dc's avatar
shutao-dc 已提交
20 21 22 23 24 25 26 27 28 29 30
  })

  //检测延迟显示listv-view后list-item是否正常显示
  it('check_list_item_v_show', async () => {
    await page.callMethod('delayShow')
    await page.waitFor(async () => {
      return await page.data('list_show') === true;
    });
    await page.waitFor(200)
    const image = await program.screenshot();
    expect(image).toMatchImageSnapshot();
雪洛's avatar
雪洛 已提交
31
  })
32
})