Skip to content

Commit 56db1bd

Browse files
Abbondanzofacebook-github-bot
authored andcommitted
Add Maestro test for Image.getSize with local drawable resources
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 66bc8bc commit 56db1bd

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
- scrollUntilVisible:
25+
element: "Image.getSize with local drawables"
26+
direction: DOWN
27+
speed: 40
28+
timeout: 10000
29+
- tapOn: "Image.getSize with local drawables"
30+
31+
# Tap the run button
32+
- tapOn: "Run Image.getSize on local drawable resources"
33+
34+
# Assert success results contain dp dimensions
35+
- extendedWaitUntil:
36+
visible: "24x24 dp"
37+
timeout: 10000
38+
- assertVisible: "108x108 dp"
39+
40+
# Assert error case shows error message
41+
- assertVisible:
42+
text: "error:.*"
43+
regex: true

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)