plu / pxctest

Execute tests in parallel on multiple iOS Simulators
MIT License
800 stars 57 forks source link

My tests require photos in the Camera Roll but this is empty #28

Open pellyco opened 7 years ago

pellyco commented 7 years ago

Some of my tests have a requirement to attach photos. For this we have a number of photos stored in the Camera Roll. We then can attach a photo in our app. However, we delete the simulator each time (starting fresh each time we found to be more reliable) and there are no photos in the Media folder of the device type so when we go to add a photo as an attachment in our app the tests fail. Would it be possible for the media folder to be pre-populated with a sample photo? I have looked at adding something like: xcrun simctl addmedia {UUID} .~/Automation/Media/.jpg or xcrun simctl addmedia booted .~/Automation/Media/.jpg Any suggestions on the best approach ? Thank you for any help.

plu commented 7 years ago

I think xcrun simctl is the easiest way to approach this.

There's also support for that in FBSimulatorControl - so you could fork pxctest and add the functionality directly there. Maybe you can figure out a generic way of implementing this, so we can merge it back upstream here?

pellyco commented 7 years ago

Thanks - yes I will look at making any solution generic so we can merge it back upstream.

davetobin commented 7 years ago

@plu @pellyco I've noticed that when the devices are booted headlessly they include the default photos so maybe the same setup can be added to the standard boot?