create-selector-query-onScroll.test.js 904 B

12345678910111213141516171819202122232425262728293031323334353637
  1. const platformInfo = process.env.uniTestPlatformInfo.toLocaleLowerCase()
  2. const isWeb = platformInfo.startsWith('web')
  3. const isMP = platformInfo.startsWith('mp')
  4. const PAGE_PATH = '/pages/API/create-selector-query/create-selector-query-onScroll'
  5. describe('create-selector-query-onScroll', () => {
  6. if (isWeb || isMP || process.env.UNI_TEST_DEVICES_DIRECTION == 'landscape') {
  7. it('not support', () => {
  8. expect(1).toBe(1)
  9. })
  10. return
  11. }
  12. let page
  13. beforeAll(async () => {
  14. page = await program.reLaunch(PAGE_PATH)
  15. await page.waitFor(500);
  16. })
  17. it('test-createSelectorQuery-onScroll', async () => {
  18. let x = 100
  19. let y = 250
  20. // 滑动事件
  21. await program.swipe({
  22. startPoint: {x: x, y: y},
  23. endPoint: {x: x,y: y-100},
  24. duration: 300
  25. })
  26. await page.waitFor(600);
  27. const ret = await page.data('ret')
  28. expect(ret).toBe(true)
  29. })
  30. })