list-view-multiplex.test.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isMP = platformInfo.startsWith('mp')
  3. describe('component-native-list-view', () => {
  4. if (isMP) {
  5. it('skip mp', () => {
  6. expect(1).toBe(1)
  7. })
  8. return
  9. }
  10. let page
  11. beforeAll(async () => {
  12. //打开list-view-multiplex测试页
  13. page = await program.reLaunch('/pages/component/list-view/list-view-multiplex')
  14. await page.waitFor('list-view')
  15. })
  16. //滚动list-view到底部 加载更多 如果异常则直接闪退
  17. it('check_list_item_multiplex', async () => {
  18. await page.callMethod('listViewScrollByY', 5000)
  19. await page.waitFor(400)
  20. await page.callMethod('listViewScrollByY', 100)
  21. })
  22. //检测延迟显示listv-view后list-item是否正常显示
  23. it('check_list_item_v_show', async () => {
  24. await page.callMethod('delayShow')
  25. await page.waitFor(async () => {
  26. return await page.data('list_show') === true;
  27. });
  28. await page.waitFor(1000)
  29. const image = await program.screenshot({fullPage: true});
  30. expect(image).toSaveImageSnapshot();
  31. })
  32. //检测修改item子元素后,item是否正常调整高度
  33. it('check_switch_item_content', async () => {
  34. await page.callMethod('switchItemContent')
  35. await page.waitFor(async () => {
  36. return await page.data('displayArrow') === true;
  37. });
  38. await page.waitFor(600)
  39. const image = await program.screenshot({fullPage: true});
  40. expect(image).toSaveImageSnapshot();
  41. })
  42. })