Abhiek187 / ez-recipes-ios

Easy recipes finder iOS app
MIT License
0 stars 0 forks source link

iOS Day 10: README, Snap It, & Frame It! #22

Closed Abhiek187 closed 1 year ago

Abhiek187 commented 1 year ago

This was a very productive day! Not only did I create the README (using the same format as the one in ez-recipes-web), but I was also able to automate taking screenshots of the app using Fastlane. I used both snapshot and frameit as part of the screenshots lane: bundle exec fastlane ios screenshots. snapshot takes the screenshots during a UI test and frameit applies a device frame to each screenshot. I took the UI test I already wrote and added some snapshot() and swipeUp() commands throughout. These don't affect the results of each test, though they might slow them down slightly.

By default, snapshot took screenshots from all 27 iOS simulators! That caused me to waste over a third of my daily API quota. So, I reduced it to just three devices, similar to my testing and preview strategy. But I changed the iPhone 14 Pro Max to an iPhone 13 Pro Max and the 9.7-inch iPad to the 12.9-inch one to better align with Apple's screenshot size requirements and Fastlane's device compatibility.

frameit has additional options to add text and a background to each screenshot. This requires creating a JSON file and additional assets. I might consider adding some flair later on. The only issue is because the recipes are randomized, there's no guarantee how each screenshot will be aligned. Maybe once I develop more features, I can come up with a more consistent strategy of obtaining screenshots of the app. Nevertheless, I'm still impressed with how well these tools worked, and the entire process only takes six minutes.

These changes don't affect the app itself. Nor does it affect the pipeline since the screenshots can be taken on my local machine. So even if one of the workflows fail, this should be good to merge.