Skip to content

Commit 1700abc

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] Differential Revision: D106089813
1 parent cb74b82 commit 1700abc

2 files changed

Lines changed: 50 additions & 1 deletion

File tree

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