-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support instrumentation capabilities #998
Changes from all commits
718b66a
631cdec
3767f74
aef763e
3865215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,8 +76,16 @@ func NewEspressoCmd() *cobra.Command { | |
cmd.Flags().Var(&lflags.Device, "device", "Specifies the device to use for testing. Requires --name to be set.") | ||
|
||
// Overwrite devices settings | ||
sc.Bool("resigningEnabled", "suite::appSettings::resigningEnabled", false, "Overwrite app settings for real device to enable app resigning.") | ||
sc.Bool("audioCapture", "suite::appSettings::audioCapture", false, "Overwrite app settings for real device to capture audio.") | ||
sc.Bool("imageInjection", "suite::appSettings::instrumentation::imageInjection", false, "Overwrite app settings for real device to inject provided images in the user app.") | ||
sc.Bool("bypassScreenshotRestriction", "suite::appSettings::instrumentation::bypassScreenshotRestriction", false, "Overwrite app settings for real device to enable screenshot restriction.") | ||
sc.Bool("groupFolderRedirect", "suite::appSettings::instrumentation::groupFolderRedirect", false, "Overwrite app settings for real device to redirect group folder.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @diegoperini ! I noticed that some iOS-specific configuration fields have been added here for Espresso run arguments. Could you clarify why these are necessary? I don't think they’re needed in this context. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are not needed. Addressed here: https://github.com/saucelabs/saucectl/pull/999/files |
||
sc.Bool("sysAlertsDelay", "suite::appSettings::instrumentation::sysAlertsDelay", false, "Overwrite app settings for real device to delay system alerts.") | ||
sc.Bool("vitals", "suite::appSettings::instrumentation::vitals", false, "Overwrite app settings for real device to enable vitals.") | ||
sc.Bool("networkCapture", "suite::appSettings::instrumentation::networkCapture", false, "Overwrite app settings for real device to capture network.") | ||
sc.Bool("biometrics", "suite::appSettings::instrumentation::biometrics", false, "Overwrite app settings for real device to intercept biometric authentication.") | ||
sc.Bool("groupDirectory", "suite::appSettings::instrumentation::groupDirectory", false, "Overwrite app settings for real device to enable group directory access.") | ||
|
||
return cmd | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,8 +73,16 @@ func NewXCUITestCmd() *cobra.Command { | |
cmd.Flags().Var(&lflags.Simulator, "simulator", "Specifies the simulator to use for testing. Requires --name to be set.") | ||
|
||
// Overwrite devices settings | ||
sc.Bool("resigningEnabled", "suite::appSettings::resigningEnabled", false, "Overwrite app settings for real device to enable app resigning.") | ||
sc.Bool("audioCapture", "suite::appSettings::audioCapture", false, "Overwrite app settings for real device to capture audio.") | ||
sc.Bool("imageInjection", "suite::appSettings::instrumentation::imageInjection", false, "Overwrite app settings for real device to inject provided images in the user app.") | ||
sc.Bool("bypassScreenshotRestriction", "suite::appSettings::instrumentation::bypassScreenshotRestriction", false, "Overwrite app settings for real device to enable screenshot restriction.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same applies here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed here: https://github.com/saucelabs/saucectl/pull/999/files |
||
sc.Bool("groupFolderRedirect", "suite::appSettings::instrumentation::groupFolderRedirect", false, "Overwrite app settings for real device to redirect group folder.") | ||
sc.Bool("sysAlertsDelay", "suite::appSettings::instrumentation::sysAlertsDelay", false, "Overwrite app settings for real device to delay system alerts.") | ||
sc.Bool("vitals", "suite::appSettings::instrumentation::vitals", false, "Overwrite app settings for real device to enable vitals.") | ||
sc.Bool("networkCapture", "suite::appSettings::instrumentation::networkCapture", false, "Overwrite app settings for real device to capture network.") | ||
sc.Bool("biometrics", "suite::appSettings::instrumentation::biometrics", false, "Overwrite app settings for real device to intercept biometric authentication.") | ||
sc.Bool("groupDirectory", "suite::appSettings::instrumentation::groupDirectory", false, "Overwrite app settings for real device to enable group directory access.") | ||
|
||
return cmd | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -254,9 +254,27 @@ func (r *EspressoRunner) newStartOptions( | |||||
// Overwrite device settings | ||||||
RealDeviceKind: strings.ToLower(espresso.Android), | ||||||
AppSettings: job.AppSettings{ | ||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||||
// The key name mismatch here between left and right hand side is intentional. | ||||||
// | ||||||
// Traditionally, saucectl made no distinction between instrumentation and resigning | ||||||
// while our composer API backend always used specific key names per platform, | ||||||
// either Instrumentation for Android and Resigning for iOS. | ||||||
// | ||||||
// This created a situation where app settings were sporadically ignored in Android RDC sessions. | ||||||
// | ||||||
// Here, we choose the lesser evil and keep supporting `ResignerEnabled` in the saucectl config yaml | ||||||
// for backward compatibility while also mapping it to the correct API parameter for composer to evaluate. | ||||||
InstrumentationEnabled: s.AppSettings.ResigningEnabled, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't that supposed to be
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This History:
TLDR: The shape of that line is intentional, to avoid breaking all YAML files out there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're updating the docs today 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @diegoperini! It'd be good to leave an inline comment in the code explaining that little difference. I won't remember this in 2 weeks (or any new dev that joins) 😂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, added it. |
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||||
|
||||||
AudioCapture: s.AppSettings.AudioCapture, | ||||||
Instrumentation: job.Instrumentation{ | ||||||
NetworkCapture: s.AppSettings.Instrumentation.NetworkCapture, | ||||||
ImageInjection: s.AppSettings.Instrumentation.ImageInjection, | ||||||
BypassScreenshotRestriction: s.AppSettings.Instrumentation.BypassScreenshotRestriction, | ||||||
Vitals: s.AppSettings.Instrumentation.Vitals, | ||||||
NetworkCapture: s.AppSettings.Instrumentation.NetworkCapture, | ||||||
BiometricsInterception: s.AppSettings.Instrumentation.Biometrics, | ||||||
}, | ||||||
}, | ||||||
} | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the configuration fields are newly added and already separated into Android and iOS, I believe it would be better to split them into distinct sections for each platform in the JSON schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree but that's a change that will make existing saucectl configurations invalid. We'll have to plan for it with proper communication.