diff --git a/pages/API/pull-down-refresh/pull-down-refresh.test.js b/pages/API/pull-down-refresh/pull-down-refresh.test.js new file mode 100644 index 0000000000000000000000000000000000000000..0dac9515ba87ffe3ab0e3391babb05408f4487a2 --- /dev/null +++ b/pages/API/pull-down-refresh/pull-down-refresh.test.js @@ -0,0 +1,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) + }); +}); diff --git a/pages/API/pull-down-refresh/pull-down-refresh.uvue b/pages/API/pull-down-refresh/pull-down-refresh.uvue index b2bb6ae56cc198479efddccf6fd796adb0108737..8b4c83b64792d13365c0a1f5eefbc91b29c26f60 100644 --- a/pages/API/pull-down-refresh/pull-down-refresh.uvue +++ b/pages/API/pull-down-refresh/pull-down-refresh.uvue @@ -1,76 +1,82 @@ - - - -