Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
139 views
in Technique[技术] by (71.8m points)

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

I am trying to use UIAutomation for testing an iOS 8 Today extension widget. I can change the target to the extension, launch it, but then unable to do anything after that.

Has anyone had any success in using UIAutomation with the extensions?

question from:https://stackoverflow.com/questions/26415752/how-to-use-uiautomation-on-a-today-extension-widget

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...