issue-18587.test.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isAndroid = platformInfo.startsWith('android')
  3. const isIOS = platformInfo.startsWith('ios')
  4. const isMP = platformInfo.startsWith('mp')
  5. const isWeb = platformInfo.startsWith('web')
  6. describe('issue-18587', () => {
  7. if(isMP || isWeb) {
  8. // 不支持scrollend事件
  9. it('not support', async() => {
  10. expect(1).toBe(1)
  11. })
  12. return
  13. }
  14. let page;
  15. beforeAll(async () => {
  16. page = await program.reLaunch('/pages/component/scroll-view/issue-18587');
  17. await page.waitFor(300);
  18. });
  19. //检测竖向scrolltop属性赋值
  20. it('check_scroll_end', async () => {
  21. await page.callMethod('scrollTo', 100)
  22. await page.waitFor(300)
  23. await page.callMethod('scrollTo', 200)
  24. await page.waitFor(300)
  25. await page.callMethod('scrollTo', 300)
  26. await page.waitFor(300)
  27. const scrollEndTriggeredTimes = await page.data('scrollEndTriggeredTimes')
  28. expect(scrollEndTriggeredTimes).toBe(3)
  29. })
  30. });