issue-18773.test.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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-18773');
  17. await page.waitFor(300);
  18. });
  19. //首次不触发scrollend事件
  20. it('check_scroll_end_test1', async () => {
  21. await page.callMethod('scrollTo')
  22. await page.waitFor(300)
  23. const scrollEndTriggeredTimes = await page.data('scrollEndTriggeredTimes')
  24. expect(scrollEndTriggeredTimes).toBe(0)
  25. })
  26. //触发scrollend事件
  27. it('check_scroll_end_test2', async () => {
  28. await page.callMethod('scrollTo')
  29. await page.waitFor(300)
  30. const scrollEndTriggeredTimes = await page.data('scrollEndTriggeredTimes')
  31. expect(scrollEndTriggeredTimes).toBe(1)
  32. })
  33. });