Skip to content

feat(e2e): reuse the running app between tests through a reset link - #1258

Merged
krozniata merged 1 commit into
mainfrom
perf/e2e-reset-link
Nov 18, 2026
Merged

krozniata merged 1 commit into
mainfrom
perf/e2e-reset-link

Conversation

@krozniata

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings November 18, 2026 09:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical active finding remains because the invalid detached wait state throws before the app relaunch fallback can run.

1 open issue
What changed in this PR

This pull request reduces mobile E2E runtime by reusing the running example app between successful tests, resetting navigation in place through a deep link, and relaunching when app state cannot be trusted.

Changes:

  • Adds reset-link handling, keyboard dismissal, animation suppression, and mount markers to the example app.
  • Tracks E2E session state and conditionally reuses or relaunches the app.
  • Removes redundant RTL cleanup hooks and updates E2E documentation and configuration.
File Description
example/​src/​App.tsx Adds reset-link handling, navigation-stack resets, keyboard dismissal, animation suppression, and mount markers to the example app.
e2e/​tests/​support/​test.ts Tracks test success and app-session trust to control reuse after failures or timeouts.
e2e/​tests/​support/​app.ts Reuses the running app through reset links and falls back to relaunching when reuse is unsafe.
e2e/​tests/​set-page-animation.e2e.ts Removes the previous RTL restoration cleanup hook.
e2e/​tests/​issues/​issue-1154-page-change-focus.e2e.ts Removes the previous RTL restoration cleanup hook.
e2e/​tests/​issues/​issue-1050-back-gesture.e2e.ts Removes the previous RTL restoration cleanup hook.
e2e/​tests/​basic-pager.e2e.ts Removes the previous RTL restoration cleanup hook.
e2e/​README.md Documents app reuse, reset-link behavior, session tracking, and the updated test lifecycle.
e2e/​e2e.config.ts Removes the cleanup timeout that was required by the previous relaunch-based hooks.

Review effort: Lite

Comment thread e2e/tests/support/app.ts Resolved
@github-actions

Copy link
Copy Markdown

🟢 e2e: 68 passed

All 68 tests in 27 files
Test Time
🟢 tests/basic-pager.e2e.ts · 3 passed 48.6s
🟢 basic pager › in LTR › pages horizontally 23.2s
🟢 basic pager › in LTR › pages vertically 7.4s
🟢 basic pager › in RTL › pages horizontally with the reversed gesture 18.0s
🟢 tests/issues/issue-1083-modal-set-page.e2e.ts · 1 passed 12.9s
🟢 setPage called behind a native-stack modal lands on the requested page 12.9s
🟢 tests/issues/issue-1098-nested-pager.e2e.ts · 1 passed 2.8s
🟢 outer pager stays responsive after its page count changes around a nested pager 2.8s
🟢 tests/issues/issue-1154-page-change-focus.e2e.ts · 7 passed 21.4s
🟢 leaving a page with setPage blurs its input 3.8s
🟢 setPage with an input focused lands on the target page 3.4s
🟢 leaving a page with a swipe blurs its input 1.5s
🟢 an input focused on the new page keeps focus 3.0s
🟢 an input focused on the new page keeps focus going back 4.1s
🟢 a swipe keeps the focus the new page takes from onPageSelected 3.5s
🟢 setPage keeps the focus the new page takes from onPageSelected 2.1s
🟢 tests/issues/issue-1156-nested-horizontal-scroll.e2e.ts · 3 passed 5.0s
🟢 a horizontal ScrollView in a page scrolls instead of the pager 1.9s
🟢 the pager takes the swipe once the ScrollView is at its edge 1.8s
🟢 a swipe outside the ScrollView changes the page 1.3s
🟢 tests/issues/issue-1196-set-page-after-add.e2e.ts · 6 passed 14.9s
🟢 setPageWithoutAnimation selects a page added in the same commit 1.5s
🟢 setPage animates to a page added in the same commit 1.7s
🟢 setPage from useEffect animates to a page added in the same commit 1.7s
🟢 setPageWithoutAnimation selects a page added to an empty pager in the same commit 1.9s
🟢 an index that is not there yet is ignored, not applied later 3.5s
🟢 pages that come back report the page the pager lands on once 4.5s
🟢 tests/issues/issue-1199-scroll-state.e2e.ts · 2 passed 2.9s
🟢 setPage reports settling, then idle once the page has stopped 1.8s
🟢 a swipe reports settling when the finger lifts, then idle once the page has stopped 1.2s
🟢 tests/issues/issue-1205-diagonal-swipe.e2e.ts · 2 passed 3.0s
🟢 a slanted, mostly vertical drag scrolls the list 1.6s
🟢 a slanted, mostly horizontal drag changes the page 1.4s
🟢 tests/issues/issue-1229-text-input-cursor.e2e.ts · 5 passed 9.6s
🟢 a tap that moves places the cursor in the input above the pager 1.7s
🟢 a tap that moves places the cursor in a single-line input on a page 1.7s
🟢 a tap that moves places the cursor in a single-line input on a page with scrolling disabled 2.2s
🟢 a tap that moves places the cursor in a multiline input on a page 1.7s
🟢 a tap that moves places the cursor in a multiline input on a page with scrolling disabled 2.3s
🟢 tests/issues/issue-1248-clipped-text-scroll.e2e.ts · 2 passed 3.6s
🟢 an upward drag over clipped text scrolls the list 1.3s
🟢 a nested vertical list keeps its own drag 2.3s
🟢 tests/issues/issue-1250-page-selected-timing.e2e.ts · 2 passed 3.0s
🟢 setPage reports the selected page before it starts moving 1.9s
🟢 a flick reports the selected page when the finger lifts 1.2s
🟢 tests/issues/issue-219-empty-pager.e2e.ts · 3 passed 6.7s
🟢 a pager that mounts empty shows its first page when pages arrive 1.3s
🟢 a pager that loses all its pages shows them again when they come back 3.6s
🟢 setPage works as soon as pages arrive in a pager that mounted empty 1.9s
🟢 tests/issues/issue-424-swipe-cancels-press.e2e.ts · 3 passed 8.5s
🟢 a tap on a button in a page presses it 1.1s
🟢 a swipe that starts on a button in a page cancels its touch 1.2s
🟢 a swipe while the JS thread is busy does not press the button 6.1s
🟢 tests/issues/issue-965-pages-before-current.e2e.ts · 6 passed 9.6s
🟢 inserting a page before the current one keeps it visible 1.5s
🟢 inserting a page at the current index keeps the current page 1.4s
🟢 removing a page before the current one keeps it visible 1.4s
🟢 removing pages up to the current index keeps it visible 1.5s
🟢 moving the current page keeps it visible 1.5s
🟢 moving a page next to the current one keeps it rendered 2.3s
🟢 tests/issues/pr-1194-remount-initial-page.e2e.ts · 1 passed 3.8s
🟢 a pager remounted after its screen was covered starts on its own initialPage 3.8s
🟢 tests/issues/pr-1241-switch-state-restore.e2e.ts · 1 passed 4.2s
🟢 a page that comes back keeps the switch value React set while it was away 4.2s
🟢 tests/keyboard-dismiss-mode.e2e.ts · 3 passed 6.1s
🟢 on-drag: dragging the pager blurs the input 1.9s
🟢 on-drag: setPage keeps the input focused 2.1s
🟢 none: dragging the pager keeps the input focused 2.2s
🟢 tests/lazy-pager-view.e2e.ts · 4 passed 12.4s
🟢 setPage mounts the target and its neighbours only 2.7s
🟢 swiping mounts the next neighbour 2.5s
🟢 preload distance 0 mounts only the pages visited 2.9s
🟢 a visited page keeps its scroll position 4.3s
🟢 tests/material-top-bar.e2e.ts · 1 passed 6.3s
🟢 material top tabs survive a native-stack push and pop 6.3s
🟢 tests/memo-pages.e2e.ts · 1 passed 3.2s
🟢 memoized pages do not re-render with the pager 3.2s
🟢 tests/native-driver-events.e2e.ts · 2 passed 3.8s
🟢 native driver events › setPage through the Animated ref drives the native value 2.5s
🟢 native driver events › a swipe drives the native value 1.3s
🟢 tests/nested-pager-view.e2e.ts · 1 passed 4.8s
🟢 nested horizontal and vertical pagers scroll independently 4.8s
🟢 tests/on-page-selected.e2e.ts · 1 passed 15.2s
🟢 onPageSelected fires an alert for every page change 15.2s
🟢 tests/scrollable-pager-view.e2e.ts · 1 passed 9.7s
🟢 pager inside a ScrollView keeps its page across vertical scrolls 9.7s
🟢 tests/set-page-animation.e2e.ts · 4 passed 26.0s
🟢 ltr › direct setPage selects only the target page (ltr) 3.1s
🟢 rtl › direct setPage selects only the target page (rtl) 10.2s
🟢 the page next to the target is selectable after a direct setPage 9.6s
🟢 scroll setPage passes the pages in between, direct setPage does not 3.1s
🟢 tests/smoke.e2e.ts · 1 passed 2.2s
🟢 horizontal pager pages with the panel buttons 2.2s
🟢 tests/tab-view-inside-scroll-view.e2e.ts · 1 passed 5.1s
🟢 TabView inside a ScrollView swipes tabs and scrolls the page 5.1s

Tested by e2e 0.23.1 · 4m 16s · android · run artifacts

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 6cd49d1

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
e2e/tests/support/test.ts:29 A test.skip inside a body marks the next test's app as dirty

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (9ed912f7fb58).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apex Sentinel: 1 new finding on 6cd49d1. The verdict and the full list are in the summary comment.

Comment thread e2e/tests/support/test.ts
Comment on lines +29 to +38
apply(target, thisArg, args: unknown[]) {
const body = args.at(-1) as (fixtures: unknown) => Promise<void>;
args[args.length - 1] = async (fixtures: unknown) => {
if (!appSession.lastTestPassed) appSession.state = undefined;
appSession.lastTestPassed = false;
await body(fixtures);
appSession.lastTestPassed = true;
};
return Reflect.apply(target, thisArg, args);
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Minor · A test.skip inside a body marks the next test's app as dirty

skipWithoutContentPop aborts the body with the engine's skip signal, so await body(fixtures) never resolves normally and lastTestPassed stays false. Every test following a skip then relaunches the app; on iOS without the content pop, all four issue-1050 tests take the slow path, cancelling the speed-up this PR targets on those devices.

Details

Also raised here

Also raised at this location by persona maintainability: test wrapper assumes the last argument is the test body — The Proxy apply trap casts whatever is last in args to the test function and replaces it, so any declaration whose last argument is not a body — the body-less form vitest accepts for a todo/skipped scenario, or a call written as test(name, options) — gets a string or options object turned into an async function that is then called as body(fixtures), and a todo silently becomes a failing implemented test. Add the pass/fail bookkeeping only when the last argument is a function, so the wrapper stays correct for every declaration form vitest supports.

persona: senior-developer, maintainability

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

@github-actions

Copy link
Copy Markdown

🟢 e2e ios: 51 passed

All 51 tests in 20 files
Test Time
🟢 tests/basic-pager.e2e.ts · 3 passed 58.8s
🟢 basic pager › in LTR › pages horizontally 27.3s
🟢 basic pager › in LTR › pages vertically 12.0s
🟢 basic pager › in RTL › pages horizontally with the reversed gesture 19.4s
🟢 tests/issues/issue-1050-back-gesture.e2e.ts · 8 passed 45.1s
🟢 back gesture over the pager › in LTR › a back swipe on the first page pops the screen 11.0s
🟢 back gesture over the pager › in LTR › a back swipe on a later page goes to the previous page 2.9s
🟢 back gesture over the pager › in LTR › a forward swipe on the first page still goes to the next page 2.2s
🟢 back gesture over the pager › in RTL › a back swipe on the first page pops the screen 12.0s
🟢 back gesture over the pager › in RTL › a back swipe on a later page goes to the previous page 3.2s
🟢 back gesture over the pager › in RTL › a forward swipe on the first page still goes to the next page 1.8s
🟢 back gesture over a pager in a nested stack › a back swipe on the first page pops the outer stack 9.8s
🟢 back gesture over a pager in a nested stack › a forward swipe on the first page still goes to the next page 2.2s
🟢 tests/issues/issue-1083-modal-set-page.e2e.ts · 1 passed 6.3s
🟢 setPage called behind a native-stack modal lands on the requested page 6.3s
🟢 tests/issues/issue-1096-keyboard-shrink.e2e.ts · 1 passed 7.9s
🟢 keyboard avoidance does not shrink the page under the keyboard 7.9s
🟢 tests/issues/issue-1098-nested-pager.e2e.ts · 1 passed 4.8s
🟢 outer pager stays responsive after its page count changes around a nested pager 4.8s
🟢 tests/issues/issue-1142-search-bar-inset.e2e.ts · 1 passed 4.7s
🟢 FlatList inside the pager gets the search bar safe-area insets 4.7s
🟢 tests/issues/issue-1154-page-change-focus.e2e.ts · 14 passed 1m 23s
🟢 leaving a page with setPage blurs its input 5.2s
🟢 setPage with an input focused lands on the target page 5.0s
🟢 a setPage two pages away lands on the far page 5.1s
🟢 a setPage repeated during the slide changes nothing 4.4s
🟢 leaving a page with a swipe blurs its input 4.7s
🟢 an input focused on the new page keeps focus 5.4s
🟢 a swipe keeps the focus the new page takes from onPageSelected 5.8s
🟢 a setPage that interrupts another lands on the page asked for last 4.8s
🟢 a setPage back to the page a slide is passing lands there 2.9s
🟢 a setPage that interrupts another still lands on the later page 5.8s
🟢 a setPage redirected once the focus has landed blurs it 4.6s
🟢 two setPage calls that cancel out land on the first page 4.4s
🟢 right to left › leaving a page with a swipe blurs its input 11.4s
🟢 a page that grows with the keyboard still lands on the target page 13.1s
🟢 tests/issues/issue-1230-pager-between-pages.e2e.ts · 1 passed 2.6s
🟢 a pager scrolled to a focused field still lands on the page asked for 2.6s
🟢 tests/issues/pr-1194-remount-initial-page.e2e.ts · 1 passed 4.5s
🟢 a pager remounted after its screen was covered starts on its own initialPage 4.5s
🟢 tests/keyboard-dismiss-mode.e2e.ts · 3 passed 12.1s
🟢 on-drag: dragging the pager blurs the input 4.0s
🟢 on-drag: setPage keeps the input focused 4.0s
🟢 none: dragging the pager keeps the input focused 4.1s
🟢 tests/lazy-pager-view.e2e.ts · 4 passed 25.4s
🟢 setPage mounts the target and its neighbours only 5.3s
🟢 swiping mounts the next neighbour 6.3s
🟢 preload distance 0 mounts only the pages visited 5.8s
🟢 a visited page keeps its scroll position 8.0s
🟢 tests/material-top-bar.e2e.ts · 1 passed 9.0s
🟢 material top tabs survive a native-stack push and pop 9.0s
🟢 tests/memo-pages.e2e.ts · 1 passed 4.3s
🟢 memoized pages do not re-render with the pager 4.3s
🟢 tests/native-driver-events.e2e.ts · 2 passed 4.7s
🟢 native driver events › setPage through the Animated ref drives the native value 2.5s
🟢 native driver events › a swipe drives the native value 2.2s
🟢 tests/nested-pager-view.e2e.ts · 1 passed 8.0s
🟢 nested horizontal and vertical pagers scroll independently 8.0s
🟢 tests/on-page-selected.e2e.ts · 1 passed 9.0s
🟢 onPageSelected fires an alert for every page change 9.0s
🟢 tests/scrollable-pager-view.e2e.ts · 1 passed 12.8s
🟢 pager inside a ScrollView keeps its page across vertical scrolls 12.8s
🟢 tests/set-page-animation.e2e.ts · 4 passed 26.4s
🟢 ltr › direct setPage selects only the target page (ltr) 3.3s
🟢 rtl › direct setPage selects only the target page (rtl) 10.1s
🟢 the page next to the target is selectable after a direct setPage 10.2s
🟢 scroll setPage passes the pages in between, direct setPage does not 2.8s
🟢 tests/smoke.e2e.ts · 1 passed 3.0s
🟢 horizontal pager pages with the panel buttons 3.0s
🟢 tests/tab-view-inside-scroll-view.e2e.ts · 1 passed 8.4s
🟢 TabView inside a ScrollView swipes tabs and scrolls the page 8.4s

Tested by e2e 0.23.1 · 5m 41s · ios · run artifacts

@krozniata
krozniata added this pull request to stack #1260 November 18, 2026 09:39
@github-actions

Copy link
Copy Markdown

🟢 e2e ios-spm: 51 passed

All 51 tests in 20 files
Test Time
🟢 tests/basic-pager.e2e.ts · 3 passed 1m 27s
🟢 basic pager › in LTR › pages horizontally 40.2s
🟢 basic pager › in LTR › pages vertically 18.9s
🟢 basic pager › in RTL › pages horizontally with the reversed gesture 27.9s
🟢 tests/issues/issue-1050-back-gesture.e2e.ts · 8 passed 59.9s
🟢 back gesture over the pager › in LTR › a back swipe on the first page pops the screen 15.1s
🟢 back gesture over the pager › in LTR › a back swipe on a later page goes to the previous page 5.3s
🟢 back gesture over the pager › in LTR › a forward swipe on the first page still goes to the next page 2.7s
🟢 back gesture over the pager › in RTL › a back swipe on the first page pops the screen 14.1s
🟢 back gesture over the pager › in RTL › a back swipe on a later page goes to the previous page 4.6s
🟢 back gesture over the pager › in RTL › a forward swipe on the first page still goes to the next page 2.0s
🟢 back gesture over a pager in a nested stack › a back swipe on the first page pops the outer stack 13.3s
🟢 back gesture over a pager in a nested stack › a forward swipe on the first page still goes to the next page 2.9s
🟢 tests/issues/issue-1083-modal-set-page.e2e.ts · 1 passed 7.6s
🟢 setPage called behind a native-stack modal lands on the requested page 7.6s
🟢 tests/issues/issue-1096-keyboard-shrink.e2e.ts · 1 passed 10.4s
🟢 keyboard avoidance does not shrink the page under the keyboard 10.4s
🟢 tests/issues/issue-1098-nested-pager.e2e.ts · 1 passed 6.2s
🟢 outer pager stays responsive after its page count changes around a nested pager 6.2s
🟢 tests/issues/issue-1142-search-bar-inset.e2e.ts · 1 passed 5.7s
🟢 FlatList inside the pager gets the search bar safe-area insets 5.7s
🟢 tests/issues/issue-1154-page-change-focus.e2e.ts · 14 passed 1m 53s
🟢 leaving a page with setPage blurs its input 5.6s
🟢 setPage with an input focused lands on the target page 6.6s
🟢 a setPage two pages away lands on the far page 6.4s
🟢 a setPage repeated during the slide changes nothing 6.4s
🟢 leaving a page with a swipe blurs its input 6.4s
🟢 an input focused on the new page keeps focus 7.9s
🟢 a swipe keeps the focus the new page takes from onPageSelected 8.3s
🟢 a setPage that interrupts another lands on the page asked for last 6.1s
🟢 a setPage back to the page a slide is passing lands there 4.6s
🟢 a setPage that interrupts another still lands on the later page 6.4s
🟢 a setPage redirected once the focus has landed blurs it 6.4s
🟢 two setPage calls that cancel out land on the first page 6.8s
🟢 right to left › leaving a page with a swipe blurs its input 18.1s
🟢 a page that grows with the keyboard still lands on the target page 16.6s
🟢 tests/issues/issue-1230-pager-between-pages.e2e.ts · 1 passed 3.2s
🟢 a pager scrolled to a focused field still lands on the page asked for 3.2s
🟢 tests/issues/pr-1194-remount-initial-page.e2e.ts · 1 passed 4.8s
🟢 a pager remounted after its screen was covered starts on its own initialPage 4.8s
🟢 tests/keyboard-dismiss-mode.e2e.ts · 3 passed 14.7s
🟢 on-drag: dragging the pager blurs the input 4.9s
🟢 on-drag: setPage keeps the input focused 4.5s
🟢 none: dragging the pager keeps the input focused 5.3s
🟢 tests/lazy-pager-view.e2e.ts · 4 passed 38.5s
🟢 setPage mounts the target and its neighbours only 7.7s
🟢 swiping mounts the next neighbour 9.7s
🟢 preload distance 0 mounts only the pages visited 9.6s
🟢 a visited page keeps its scroll position 11.5s
🟢 tests/material-top-bar.e2e.ts · 1 passed 12.5s
🟢 material top tabs survive a native-stack push and pop 12.5s
🟢 tests/memo-pages.e2e.ts · 1 passed 6.7s
🟢 memoized pages do not re-render with the pager 6.7s
🟢 tests/native-driver-events.e2e.ts · 2 passed 5.7s
🟢 native driver events › setPage through the Animated ref drives the native value 3.5s
🟢 native driver events › a swipe drives the native value 2.1s
🟢 tests/nested-pager-view.e2e.ts · 1 passed 9.7s
🟢 nested horizontal and vertical pagers scroll independently 9.7s
🟢 tests/on-page-selected.e2e.ts · 1 passed 11.4s
🟢 onPageSelected fires an alert for every page change 11.4s
🟢 tests/scrollable-pager-view.e2e.ts · 1 passed 17.5s
🟢 pager inside a ScrollView keeps its page across vertical scrolls 17.5s
🟢 tests/set-page-animation.e2e.ts · 4 passed 36.6s
🟢 ltr › direct setPage selects only the target page (ltr) 4.3s
🟢 rtl › direct setPage selects only the target page (rtl) 13.8s
🟢 the page next to the target is selectable after a direct setPage 15.1s
🟢 scroll setPage passes the pages in between, direct setPage does not 3.4s
🟢 tests/smoke.e2e.ts · 1 passed 3.9s
🟢 horizontal pager pages with the panel buttons 3.9s
🟢 tests/tab-view-inside-scroll-view.e2e.ts · 1 passed 11.2s
🟢 TabView inside a ScrollView swipes tabs and scrolls the page 11.2s

Tested by e2e 0.23.1 · 7m 47s · ios · run artifacts

@krozniata
krozniata merged commit 454528e into main Nov 18, 2026
14 checks passed
@krozniata
krozniata deleted the perf/e2e-reset-link branch November 18, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants