Skip to content

Commit 4733ec6

Browse files
authored
Merge 3c3cc3f into 1f1c420
2 parents 1f1c420 + 3c3cc3f commit 4733ec6

File tree

10 files changed

+138
-4
lines changed

10 files changed

+138
-4
lines changed

.github/workflows/e2e-v2.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ jobs:
391391
force-avd-creation: false
392392
disable-animations: true
393393
disable-spellchecker: true
394-
target: 'aosp_atd'
395-
channel: canary # Necessary for ATDs
394+
target: 'google_apis'
396395
emulator-options: >
397396
-no-window
398397
-no-snapshot-save

dev-packages/e2e-tests/maestro/feedback.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ jsEngine: graaljs
1717
file: feedback/happyFlow-android.yml
1818
when:
1919
platform: Android
20+
21+
- runFlow:
22+
file: feedback/captureFlow-ios.yml
23+
when:
24+
platform: iOS
25+
26+
- runFlow:
27+
file: feedback/captureFlow-android.yml
28+
when:
29+
platform: Android
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This is a happy path test for the feedback widget on Android.
2+
# It verifies that the feedback form can be opened, filled out, and submitted successfully
3+
appId: ${APP_ID}
4+
jsEngine: graaljs
5+
---
6+
7+
# Show feedback button
8+
- tapOn: 'Feedback'
9+
10+
# Open feedback widget
11+
- tapOn: 'Report a Bug'
12+
13+
# Assert that the feedback form is visible
14+
- extendedWaitUntil:
15+
visible: 'Report a Bug'
16+
timeout: 5_000
17+
18+
# Fill out name field
19+
- tapOn: 'Your Name'
20+
- inputText: 'John Doe'
21+
22+
# Fill out email field
23+
- tapOn: 'your.email@example.org'
24+
- inputText: 'test@email.com'
25+
26+
# Fill out message field
27+
- tapOn: "What's the bug? What did you expect?"
28+
- inputText: 'This is a test feedback message with a screenshot from CI e2e tests'
29+
30+
# Take screenshot
31+
- scrollUntilVisible:
32+
element:
33+
text: 'Take a screenshot'
34+
- tapOn: 'Take a screenshot'
35+
- tapOn: 'Take Screenshot'
36+
37+
# Assert that the feedback form is visible
38+
- extendedWaitUntil:
39+
visible: 'Report a Bug'
40+
timeout: 5_000
41+
42+
# Hide keyboard by tapping on a non-tappable element
43+
- tapOn: 'Email'
44+
45+
# Submit feedback
46+
- scrollUntilVisible:
47+
element:
48+
text: 'Send Bug Report'
49+
- tapOn: 'Send Bug Report'
50+
- assertVisible: 'Thank you for your report!'
51+
- tapOn: 'OK'
52+
53+
# Verify feedback form is closed and the home screen is visible
54+
- assertVisible: 'Welcome to React Native'
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This is a happy path test for the feedback widget on iOS.
2+
# It verifies that the feedback form can be opened, filled out, and submitted successfully
3+
appId: ${APP_ID}
4+
jsEngine: graaljs
5+
---
6+
7+
# Show feedback button
8+
- tapOn: 'Feedback'
9+
10+
# Open feedback widget
11+
- tapOn:
12+
id: 'sentry-feedback-button'
13+
14+
# Assert that the feedback form is visible
15+
- extendedWaitUntil:
16+
visible:
17+
id: 'sentry-feedback-form-title'
18+
timeout: 5_000
19+
20+
# Fill out name field
21+
- tapOn:
22+
id: 'sentry-feedback-name-input'
23+
- inputText: 'John Doe'
24+
25+
# Fill out email field
26+
- tapOn:
27+
id: 'sentry-feedback-email-input'
28+
- inputText: 'test@email.com'
29+
30+
# Fill out message field
31+
- tapOn:
32+
id: 'sentry-feedback-message-input'
33+
- inputText: 'This is a test feedback message with a screenshot from CI e2e tests'
34+
35+
# Take screenshot
36+
- scrollUntilVisible:
37+
element:
38+
id: 'sentry-feedback-take-screenshot-button'
39+
- tapOn:
40+
id: 'sentry-feedback-take-screenshot-button'
41+
- tapOn:
42+
id: 'sentry-feedback-screenshot-button'
43+
44+
# Hide keyboard by tapping on a non-tappable element
45+
- tapOn:
46+
id: 'sentry-logo'
47+
48+
# Submit feedback
49+
- scrollUntilVisible:
50+
element:
51+
id: 'sentry-feedback-submit-button'
52+
- tapOn:
53+
id: 'sentry-feedback-submit-button'
54+
- assertVisible: 'Thank you for your report!'
55+
- tapOn: 'OK'
56+
57+
# Verify feedback form is closed and the home screen is visible
58+
- assertVisible: 'Welcome to React Native'

dev-packages/e2e-tests/maestro/feedback/happyFlow-android.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jsEngine: graaljs
2727
- tapOn: "What's the bug? What did you expect?"
2828
- inputText: 'This is a test feedback message from CI e2e tests'
2929

30+
# Hide keyboard by tapping on a non-tappable element
31+
- tapOn: 'Email'
32+
3033
# Submit feedback
3134
- scrollUntilVisible:
3235
element:

dev-packages/e2e-tests/maestro/feedback/happyFlow-ios.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ jsEngine: graaljs
3232
id: 'sentry-feedback-message-input'
3333
- inputText: 'This is a test feedback message from CI e2e tests'
3434

35+
# Hide keyboard by tapping on a non-tappable element
36+
- tapOn:
37+
id: 'sentry-logo'
38+
3539
# Submit feedback
3640
- scrollUntilVisible:
3741
element:

dev-packages/e2e-tests/patch-scripts/rn.patch.app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Sentry.init({
3232
},
3333
integrations: [
3434
Sentry.mobileReplayIntegration(),
35+
Sentry.feedbackIntegration({
36+
enableTakeScreenshot: true,
37+
}),
3538
],
3639
});
3740
`;

packages/core/src/js/feedback/FeedbackWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export class FeedbackWidget extends React.Component<FeedbackWidgetProps, Feedbac
351351
onCancel();
352352
showScreenshotButton();
353353
}}>
354-
<Text style={styles.takeScreenshotText}>{text.captureScreenshotButtonLabel}</Text>
354+
<Text style={styles.takeScreenshotText} testID='sentry-feedback-take-screenshot-button'>{text.captureScreenshotButtonLabel}</Text>
355355
</TouchableOpacity>
356356
)}
357357
<TouchableOpacity style={styles.submitButton} onPress={this.handleFeedbackSubmit}>

packages/core/src/js/feedback/ScreenshotButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class ScreenshotButton extends React.Component<ScreenshotButtonProps> {
8282
accessibilityLabel={text.triggerAriaLabel}
8383
>
8484
<Image source={{ uri: screenshotIcon }} style={styles.triggerIcon}/>
85-
<Text style={styles.triggerText}>{text.triggerLabel}</Text>
85+
<Text style={styles.triggerText} testID='sentry-feedback-screenshot-button'>{text.triggerLabel}</Text>
8686
</TouchableOpacity>
8787
);
8888
}

packages/core/test/feedback/__snapshots__/ScreenshotButton.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ exports[`ScreenshotButton matches the snapshot with custom styles 1`] = `
7878
"fontSize": 18,
7979
}
8080
}
81+
testID="sentry-feedback-screenshot-button"
8182
>
8283
Take Screenshot
8384
</Text>
@@ -162,6 +163,7 @@ exports[`ScreenshotButton matches the snapshot with custom texts 1`] = `
162163
"fontSize": 18,
163164
}
164165
}
166+
testID="sentry-feedback-screenshot-button"
165167
>
166168
Take Screenshot
167169
</Text>
@@ -246,6 +248,7 @@ exports[`ScreenshotButton matches the snapshot with default configuration 1`] =
246248
"fontSize": 18,
247249
}
248250
}
251+
testID="sentry-feedback-screenshot-button"
249252
>
250253
Take Screenshot
251254
</Text>

0 commit comments

Comments
 (0)