11//swiftlint:disable file_length
22
3+ import SentrySampleShared
34import XCTest
45
56class UserFeedbackUITests : BaseUITest {
@@ -15,14 +16,14 @@ class UserFeedbackUITests: BaseUITest {
1516 super. setUp ( )
1617
1718 app. launchArguments. append ( contentsOf: [
18- " --io.sentry.feedback.no-animations " ,
19- " --io.sentry.wipe-data " ,
19+ SentrySDKOverrides . Feedback . noAnimations . rawValue ,
20+ SentrySDKOverrides . Special . wipeDataOnLaunch . rawValue ,
2021
2122 // since the goal of these tests is only to exercise the UI of the widget and form, disable other SDK features to avoid any confounding factors that might fail or crash a test case
22- " --io.sentry.disable-everything " ,
23+ SentrySDKOverrides . Special . disableEverything . rawValue ,
2324
2425 // write base64-encoded data into the envelope file for attachments instead of raw bytes, specifically for images. this way the entire envelope contents can be more easily passed as a string through the text field in the app to this process for validation.
25- " --io.sentry.other.base64-attachment-data "
26+ SentrySDKOverrides . Other . base64AttachmentData . rawValue
2627 ] )
2728 continueAfterFailure = true
2829 }
@@ -32,7 +33,7 @@ extension UserFeedbackUITests {
3233 // MARK: Tests ensuring correct appearance
3334
3435 func testUIElementsWithDefaults( ) {
35- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] )
36+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] )
3637 // widget button text
3738 XCTAssert ( app. otherElements [ " Report a Bug " ] . exists)
3839
@@ -88,10 +89,10 @@ extension UserFeedbackUITests {
8889
8990 func testPrefilledUserInformation( ) throws {
9091 launchApp ( args: [
91- " --io.sentry.feedback.all-defaults "
92+ SentrySDKOverrides . Feedback . allDefaults . rawValue
9293 ] , env: [
93- " --io.sentry.scope.user.name " : " ui test user " ,
94- " --io.sentry.scope.user.email " : " ui-testing@sentry.io "
94+ SentrySDKOverrides . Other . userFullName . rawValue : " ui test user " ,
95+ SentrySDKOverrides . Other . userEmail . rawValue : " ui-testing@sentry.io "
9596 ] )
9697
9798 widgetButton. tap ( )
@@ -101,10 +102,10 @@ extension UserFeedbackUITests {
101102
102103 func testNoPrefilledUserInformation( ) throws {
103104 launchApp ( args: [
104- " --io.sentry.feedback.dont-use-sentry-user "
105+ SentrySDKOverrides . Feedback . noUserInjection . rawValue
105106 ] , env: [
106- " --io.sentry.scope.user.name " : " ui test user " ,
107- " --io.sentry.scope.user.email " : " ui-testing@sentry.io "
107+ SentrySDKOverrides . Other . userFullName . rawValue : " ui test user " ,
108+ SentrySDKOverrides . Other . userEmail . rawValue : " ui-testing@sentry.io "
108109 ] )
109110
110111 widgetButton. tap ( )
@@ -117,7 +118,9 @@ extension UserFeedbackUITests {
117118 // MARK: Tests validating happy path / successful submission
118119
119120 func testSubmitFullyFilledCustomForm( ) throws {
120- launchApp ( args: [ " --io.sentry.feedback.dont-use-sentry-user " ] )
121+ launchApp ( args: [
122+ SentrySDKOverrides . Feedback. noUserInjection. rawValue
123+ ] )
121124
122125 try retrieveAppUnderTestApplicationSupportDirectory ( )
123126 try assertHookMarkersNotExist ( )
@@ -155,9 +158,9 @@ extension UserFeedbackUITests {
155158 let testName = " Andrew "
156159 let testContactEmail = " andrew.mcknight@sentry.io "
157160
158- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] , env: [
159- " --io.sentry.scope.user.name " : testName,
160- " --io.sentry.scope.user.email " : testContactEmail
161+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] , env: [
162+ SentrySDKOverrides . Other . userFullName . rawValue : testName,
163+ SentrySDKOverrides . Other . userEmail . rawValue : testContactEmail
161164 ] )
162165
163166 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -202,8 +205,8 @@ extension UserFeedbackUITests {
202205
203206 func testSubmitCustomButton( ) throws {
204207 launchApp ( args: [
205- " --io.sentry.feedback.use-custom-feedback-button " ,
206- " --io.sentry.feedback.dont-use-sentry-user "
208+ SentrySDKOverrides . Feedback . useCustomFeedbackButton . rawValue ,
209+ SentrySDKOverrides . Feedback . noUserInjection . rawValue
207210 ] )
208211
209212 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -243,9 +246,9 @@ extension UserFeedbackUITests {
243246 let testName = " Andrew "
244247 let testContactEmail = " andrew.mcknight@sentry.io "
245248
246- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] , env: [
247- " --io.sentry.scope.user.name " : testName,
248- " --io.sentry.scope.user.email " : testContactEmail
249+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] , env: [
250+ SentrySDKOverrides . Other . userFullName . rawValue : testName,
251+ SentrySDKOverrides . Other . userEmail . rawValue : testContactEmail
249252 ] )
250253
251254 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -272,9 +275,9 @@ extension UserFeedbackUITests {
272275 let testName = " Andrew "
273276 let testContactEmail = " andrew.mcknight@sentry.io "
274277
275- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] , env: [
276- " --io.sentry.scope.user.name " : testName,
277- " --io.sentry.scope.user.email " : testContactEmail
278+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] , env: [
279+ SentrySDKOverrides . Other . userFullName . rawValue : testName,
280+ SentrySDKOverrides . Other . userEmail . rawValue : testContactEmail
278281 ] )
279282
280283 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -309,9 +312,9 @@ extension UserFeedbackUITests {
309312 let testName = " Andrew "
310313 let testContactEmail = " andrew.mcknight@sentry.io "
311314
312- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] , env: [
313- " --io.sentry.scope.user.name " : testName,
314- " --io.sentry.scope.user.email " : testContactEmail
315+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] , env: [
316+ SentrySDKOverrides . Other . userFullName . rawValue : testName,
317+ SentrySDKOverrides . Other . userEmail . rawValue : testContactEmail
315318 ] )
316319
317320 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -341,7 +344,9 @@ extension UserFeedbackUITests {
341344 // MARK: Tests validating screenshot functionality
342345
343346 func testAddingScreenshots( ) throws {
344- launchApp ( args: [ " --io.sentry.feedback.inject-screenshot " ] )
347+ launchApp ( args: [
348+ SentrySDKOverrides . Feedback. injectScreenshot. rawValue
349+ ] )
345350 XCTAssert ( removeScreenshotButton. isHittable)
346351
347352 let testMessage = " UITest user feedback "
@@ -353,7 +358,9 @@ extension UserFeedbackUITests {
353358 }
354359
355360 func testAddingAndRemovingScreenshots( ) throws {
356- launchApp ( args: [ " --io.sentry.feedback.inject-screenshot " ] )
361+ launchApp ( args: [
362+ SentrySDKOverrides . Feedback. injectScreenshot. rawValue
363+ ] )
357364 XCTAssert ( removeScreenshotButton. isHittable)
358365 removeScreenshotButton. tap ( )
359366 XCTAssertFalse ( removeScreenshotButton. isHittable)
@@ -369,7 +376,7 @@ extension UserFeedbackUITests {
369376 // MARK: Tests validating error cases
370377
371378 func testSubmitWithNoFieldsFilledDefault( ) throws {
372- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] )
379+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] )
373380
374381 try retrieveAppUnderTestApplicationSupportDirectory ( )
375382 try assertHookMarkersNotExist ( )
@@ -389,7 +396,10 @@ extension UserFeedbackUITests {
389396 }
390397
391398 func testSubmitWithNoFieldsFilledEmailAndMessageRequired( ) throws {
392- launchApp ( args: [ " --io.sentry.feedback.require-email " , " --io.sentry.feedback.dont-use-sentry-user " ] )
399+ launchApp ( args: [
400+ SentrySDKOverrides . Feedback. requireEmail. rawValue,
401+ SentrySDKOverrides . Feedback. noUserInjection. rawValue
402+ ] )
393403
394404 try retrieveAppUnderTestApplicationSupportDirectory ( )
395405 try assertHookMarkersNotExist ( )
@@ -414,9 +424,9 @@ extension UserFeedbackUITests {
414424
415425 func testSubmitWithNoFieldsFilledAllRequired( ) throws {
416426 launchApp ( args: [
417- " --io.sentry.feedback.require-email " ,
418- " --io.sentry.feedback.require-name " ,
419- " --io.sentry.feedback.dont-use-sentry-user "
427+ SentrySDKOverrides . Feedback . requireEmail . rawValue ,
428+ SentrySDKOverrides . Feedback . requireName . rawValue ,
429+ SentrySDKOverrides . Feedback . noUserInjection . rawValue
420430 ] )
421431
422432 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -440,7 +450,7 @@ extension UserFeedbackUITests {
440450 }
441451
442452 func testSubmitOnlyWithOptionalFieldsFilled( ) throws {
443- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] )
453+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] )
444454
445455 try retrieveAppUnderTestApplicationSupportDirectory ( )
446456 try assertHookMarkersNotExist ( )
@@ -462,9 +472,9 @@ extension UserFeedbackUITests {
462472 let testName = " Andrew "
463473 let testContactEmail = " andrew.mcknight@sentry.io "
464474
465- launchApp ( args: [ " --io.sentry.feedback.all-defaults " ] , env: [
466- " --io.sentry.scope.user.name " : testName,
467- " --io.sentry.scope.user.email " : testContactEmail
475+ launchApp ( args: [ SentrySDKOverrides . Feedback . allDefaults . rawValue ] , env: [
476+ SentrySDKOverrides . Other . userFullName . rawValue : testName,
477+ SentrySDKOverrides . Other . userEmail . rawValue : testContactEmail
468478 ] )
469479
470480 try retrieveAppUnderTestApplicationSupportDirectory ( )
@@ -492,7 +502,9 @@ extension UserFeedbackUITests {
492502 // MARK: Alternative widget control
493503
494504 func testFormShowsAndDismissesProperlyWithCustomButton( ) {
495- launchApp ( args: [ " --io.sentry.feedback.use-custom-feedback-button " ] )
505+ launchApp ( args: [
506+ SentrySDKOverrides . Feedback. useCustomFeedbackButton. rawValue
507+ ] )
496508
497509 customButton. tap ( )
498510 cancelButton. tap ( )
@@ -502,7 +514,9 @@ extension UserFeedbackUITests {
502514 }
503515
504516 func testNoAutomaticallyInjectedWidgetWithCustomButton( ) {
505- launchApp ( args: [ " --io.sentry.feedback.use-custom-feedback-button " ] )
517+ launchApp ( args: [
518+ SentrySDKOverrides . Feedback. useCustomFeedbackButton. rawValue
519+ ] )
506520
507521 XCTAssertFalse ( widgetButton. isHittable)
508522 XCTAssert ( customButton. isHittable)
@@ -516,7 +530,9 @@ extension UserFeedbackUITests {
516530 }
517531
518532 func testManuallyDisplayingWidget( ) {
519- launchApp ( args: [ " --io.sentry.feedback.no-auto-inject-widget " ] )
533+ launchApp ( args: [
534+ SentrySDKOverrides . Feedback. disableAutoInject. rawValue
535+ ] )
520536 XCTAssertFalse ( widgetButton. isHittable)
521537 extrasAreaTabBarButton. tap ( )
522538 app. buttons [ " io.sentry.ui-test.button.show-widget " ] . tap ( )
0 commit comments