pull-down-refresh.test.js 843 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
const PAGE_PATH = "/pages/API/pull-down-refresh/pull-down-refresh"

describe("payment", () => {
  if (process.env.uniTestPlatformInfo.indexOf('web') > -1 || process.env.UNI_AUTOMATOR_APP_WEBVIEW === 'true') {
    it('web || app-webview', () => {
      expect(1).toBe(1)
    })
    return
  }

  it("trigger pulldown refresh by swipe", async () => {
    const page = await program.navigateTo(PAGE_PATH)
    await page.waitFor('view')
    await page.waitFor(4000)
    await page.setData({
      pulldownRefreshTriggered: false
    })

    await program.swipe({
      startPoint: {
        x: 100,
        y: 400
      },
      endPoint: {
        x: 100,
        y: 800
      },
      duration: 1000
    })
    await page.waitFor(1500)
    expect(await page.data('pulldownRefreshTriggered')).toBe(true)
  });
});