Skip to content

Commit f15d887

Browse files
authored
feat: add Maestro E2E tests (#507)
* feat: add Maestro E2E tests Replace build.yml with e2e.yml that builds and runs Maestro tests. Add main-sheet and child-sheets test flows. * fix(ci): install Maestro via curl instead of third-party action * fix(ci): build Release for E2E, fix Android arch to x86_64 * feat(e2e): switch to expo with fingerprint-based build caching * chore: remove turbo * fix(ios): use parameterless updateState for RN < 0.82 * fix(e2e): run android build inside emulator runner * fix(ci): explicit prebuild and fix android emulator script * revert: restore build.yml and turbo, remove e2e.yml * docs: update changelog for #507
1 parent 6b520b2 commit f15d887

4 files changed

Lines changed: 118 additions & 8 deletions

File tree

.maestro/child-sheets.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
appId: com.lodev09.truesheet.expo
2+
---
3+
4+
- launchApp:
5+
clearState: true
6+
7+
- waitForAnimationToEnd:
8+
timeout: 3000
9+
10+
# Expand main sheet
11+
- swipe:
12+
start: "50%, 90%"
13+
end: "50%, 30%"
14+
duration: 500
15+
- waitForAnimationToEnd
16+
17+
# --- BasicSheet: header, footer, detent resize, dismiss ---
18+
19+
- tapOn: "TrueSheet View"
20+
- waitForAnimationToEnd
21+
22+
- assertVisible: "Enter some text..."
23+
- assertVisible: "FOOTER"
24+
- assertVisible: "Add Content"
25+
26+
# Resize detents
27+
- tapOn: "Large"
28+
- waitForAnimationToEnd
29+
- tapOn: "Auto"
30+
- waitForAnimationToEnd
31+
32+
- tapOn: "Dismiss"
33+
- waitForAnimationToEnd
34+
- assertVisible: "True Sheet"
35+
36+
# --- PromptSheet: scrollable, form inputs ---
37+
38+
- scrollUntilVisible:
39+
element: "Prompt"
40+
direction: DOWN
41+
- tapOn: "Prompt"
42+
- waitForAnimationToEnd
43+
44+
- assertVisible: "First name"
45+
- assertVisible: "Last name"
46+
- tapOn: "First name"
47+
- inputText: "John"
48+
- tapOn: "Last name"
49+
- inputText: "Doe"
50+
51+
- scrollUntilVisible:
52+
element: "Dismiss"
53+
direction: DOWN
54+
- tapOn: "Dismiss"
55+
- waitForAnimationToEnd
56+
- assertVisible: "True Sheet"
57+
58+
# --- FlatListSheet: scrollable content ---
59+
60+
- tapOn: "FlatList"
61+
- waitForAnimationToEnd
62+
63+
- assertVisible: "Enter some text..."
64+
- assertVisible: "Item #0"
65+
66+
- scrollUntilVisible:
67+
element: "Item #9"
68+
direction: DOWN
69+
- assertVisible: "Item #9"
70+
71+

.maestro/main-sheet.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
appId: com.lodev09.truesheet.expo
2+
---
3+
4+
- launchApp:
5+
clearState: true
6+
7+
- waitForAnimationToEnd:
8+
timeout: 3000
9+
10+
# --- initialDetentIndex + dismissible=false ---
11+
12+
# Main sheet auto-presents collapsed (header only)
13+
- assertVisible: "True Sheet"
14+
- assertVisible: "Enter some text..."
15+
16+
# Try to swipe down — main sheet is not dismissible
17+
- swipe:
18+
start: "50%, 90%"
19+
end: "50%, 99%"
20+
duration: 300
21+
- waitForAnimationToEnd
22+
- assertVisible: "True Sheet"
23+
24+
# --- Expand and verify content ---
25+
26+
- swipe:
27+
start: "50%, 90%"
28+
end: "50%, 30%"
29+
duration: 500
30+
- waitForAnimationToEnd
31+
32+
- assertVisible: "TrueSheet View"
33+
- assertVisible: "Prompt"
34+
- assertVisible: "ScrollView"
35+
- assertVisible: "FlatList"
36+
37+
# --- Expand to full, then dismiss ---
38+
39+
- tapOn: "Expand"
40+
- waitForAnimationToEnd
41+
- tapOn: "Dismiss"
42+
- waitForAnimationToEnd
43+
44+
- assertNotVisible: "True Sheet"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
### 🎉 New features
1010

11-
- **iOS**: Enable synchronous state update for RN 0.82+. ([#505](https://github.com/lodev09/react-native-true-sheet/pull/505) by [@lodev09](https://github.com/lodev09))
11+
- **iOS**: Enable synchronous state update for RN 0.82+. ([#505](https://github.com/lodev09/react-native-true-sheet/pull/505), [#507](https://github.com/lodev09/react-native-true-sheet/pull/507) by [@lodev09](https://github.com/lodev09))
1212
- Added `maxContentWidth` prop to control the maximum width of the sheet content. ([#495](https://github.com/lodev09/react-native-true-sheet/pull/495) by [@lodev09](https://github.com/lodev09))
1313
- Added `anchor` and `anchorOffset` props for side sheet positioning. ([#496](https://github.com/lodev09/react-native-true-sheet/pull/496), [#500](https://github.com/lodev09/react-native-true-sheet/pull/500) by [@lodev09](https://github.com/lodev09))
1414

ios/TrueSheetView.mm

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,11 @@ - (void)updateStateWithSize:(CGSize)size {
290290
stateData.containerWidth = static_cast<float>(size.width);
291291
stateData.containerHeight = static_cast<float>(size.height);
292292

293-
// RN 0.82+ processes state updates in the same layout pass (synchronous).
294-
// TODO: Once stable, we can drop native layout constraints in favor of synchronous Yoga layout.
295-
auto updateMode =
296293
#if REACT_NATIVE_VERSION_MINOR >= 82
297-
facebook::react::EventQueue::UpdateMode::unstable_Immediate;
294+
_state->updateState(std::move(stateData), facebook::react::EventQueue::UpdateMode::unstable_Immediate);
298295
#else
299-
facebook::react::EventQueue::UpdateMode::Asynchronous;
296+
_state->updateState(std::move(stateData));
300297
#endif
301-
302-
_state->updateState(std::move(stateData), updateMode);
303298
}
304299

305300
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {

0 commit comments

Comments
 (0)