Skip to content

Commit b8984b8

Browse files
Abbondanzofacebook-github-bot
authored andcommitted
Add Maestro test for Image.getSize with local drawable resources (#56945)
Summary: Adds a Maestro E2E test that exercises the new RNTester example for `Image.getSize()` with Android drawable resources. The test navigates to the Image examples, opens the "Image.getSize with local drawables" example, taps the run button, and verifies that VectorDrawable and PNG drawable dimensions are returned correctly in dp, and that the error case for a nonexistent drawable shows an error message. Changelog: [Internal] Reviewed By: javache Differential Revision: D106089813
1 parent c0ee408 commit b8984b8

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
appId: ${APP_ID} # iOS: com.meta.RNTester.localDevelopment | Android: com.facebook.react.uiapp
2+
tags:
3+
- android-only
4+
---
5+
# This flow exercises Android-only behavior (Image.getSize on local drawable
6+
# resources). The RNTester E2E job runs the entire .maestro/ folder on iOS as
7+
# well, so guard the whole flow with a platform condition: on iOS the wrapped
8+
# runFlow is skipped, leaving an empty (passing) flow; on Android it runs in full.
9+
- runFlow:
10+
when:
11+
platform: Android
12+
commands:
13+
# Navigate to Image examples
14+
- runFlow: ./helpers/launch-app-and-search.yml
15+
- inputText:
16+
text: "Image"
17+
- assertVisible:
18+
id: "Image"
19+
- tapOn:
20+
id: "Image"
21+
22+
# Search for the local drawables example
23+
- assertVisible:
24+
id: "example_search"
25+
- tapOn:
26+
id: "example_search"
27+
- inputText:
28+
text: "local drawables"
29+
- hideKeyboard
30+
31+
# Navigate to the example
32+
# RNTester appends " (android only)" to platform-scoped example titles, so
33+
# match with an inline regex rather than the bare title.
34+
- scrollUntilVisible:
35+
element: "Image.getSize with local drawables.*"
36+
direction: DOWN
37+
speed: 40
38+
timeout: 10000
39+
- tapOn: "Image.getSize with local drawables.*"
40+
41+
# Tap the run button
42+
- tapOn: "Run Image.getSize on local drawable resources"
43+
44+
# Assert success results contain dp dimensions
45+
- extendedWaitUntil:
46+
visible: "24x24 dp"
47+
timeout: 10000
48+
- assertVisible: "108x108 dp"
49+
50+
# Assert error case shows error message. The six getSize results render
51+
# asynchronously in callback-completion order, so the non-existent resource
52+
# row may land below the fold; scroll until the error text is visible.
53+
- scrollUntilVisible:
54+
element: "error:.*"
55+
direction: DOWN
56+
speed: 40
57+
timeout: 10000

packages/rn-tester/scripts/maestro-test-ios.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# LICENSE file in the root directory of this source tree.
66

77
UDID=$(xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid')
8-
maestro --udid="$UDID" test .maestro/ -e APP_ID=com.meta.RNTester.localDevelopment
8+
maestro --udid="$UDID" test --exclude-tags android-only .maestro/ -e APP_ID=com.meta.RNTester.localDevelopment

0 commit comments

Comments
 (0)