How to use UIAutomation on a Today extension widget? How to use UIAutomation on a Today extension widget? ios ios

How to use UIAutomation on a Today extension widget?


I hope I have the right end of the stick on this one.

I think you want to create a set of UI Tests which run like you can do with a normal application.

I found that I was not able to create a specific UI Tests target to then set the target application as WidgetExtension, as you would normally.

However I was able to set the WidgetExtension target to build and run onto a device (>= iOS 14) then within my UI Tests, I was able to record some steps which would allow me to write a clearer UI Test (place the cursor inside a test function to use record, you might already know this).

enter image description here

The tricky bit would be keeping the WidgetExtension target up-to-date onto the testing simulator to run your automated tests.