Posts

Post not yet marked as solved
117 Views

Best practices for conducting Unit/UI Testing on Safari App Extensions?

Hi, I have a Safari App Extension that I would like to create unit and UI tests for. I am not new to Swift or development, but admittedly I do not have a lot of experience writing tests. My app extension is in the Mac App Store, so I figured it's the prime candidate for learning. Unfortunately I'm running into issues, namely that the extension doesn't have a host application (or so Xcode thinks), and so the UI tests fail to run: language Cannot test target “TweaksForRedditUITests” on “My Mac”: UITargetAppPath should be provided If I go to the project browser and click on the UI test target, the target application is set to TweaksForReddit, which seems like it's correct. The other targets include TweaksForRedditExtension, TweaksForRedditUnitTests, and TweaksForRedditUITests. I could probably "fudge" it and add a button to the main app's interface that opens the extension's popover view in a window for testing, but I'm mostly wondering if that's necessary. Thanks!
Asked Last updated
.
Post marked as solved
152 Views

Is there a callback API for when a user enables your Safari Extension?

See title. I would like my app to react to the user enabling the app's extension in Safari but cannot seem to find an API method for this. EDIT: I just found the documentation under SFSafariExtensionState. Looks like I jumped the gun asking here!
Asked Last updated
.
Post not yet marked as solved
282 Views

SafariServices API to set user agent

As far as I am aware it is not possible to change the user agent via javascript in Safari 13, and I was not able to find anything in the SafariServices documentation. Is this possible?
Asked Last updated
.