cashapp / AccessibilitySnapshot

Easy regression testing for iOS accessibility
Apache License 2.0
541 stars 69 forks source link

Add Swift Package Manager Support #24

Closed Sherlouk closed 3 years ago

Sherlouk commented 3 years ago

⚠️ Work in progress...

Based on conversation in #1 This is also extending from the work in #21 enabling SnapshotTesting support (which is the default for Swift Package Manager installation).

Changes:

Notes:

TODO:

@NickEntin - would love to hear your opinions on the work here and particularly if you have any thoughts on how to approach the two top TODOs and honestly listing all the issues with the work here that you'd want changing! Thanks 🙌

NickEntin commented 3 years ago

This is looking great so far!

The example project doesn't like having both the CocoaPods version and the Swift Package Manager version building at the same time. As it stands, you need to enabling one or the other via the scheme but both do work when run individually.

That's fine. We can have two schemes - one for each of the dependency managers, something like AccessibilitySnapshotDemo (FBSnapshotTestCase) and AccessibilitySnapshotDemo (SnapshotTesting). We don't need to test both using the same scheme.

Figure out how to implement the SnapshotTestCase for SnapshotTesting. SnapshotTesting doesn't (yet, there have been many discussions...) support adding simulator details such as OS, screen size or screen scale to the image name like Uber's library does.

Hmm, I don't have enough experience with SnapshotTesting to know what all options are available here. @efirestone do you have any ideas how we can do this?

Sherlouk commented 3 years ago

Okay so both schemes are happily working locally on Xcode 12 but CI is having a cry because.. well.. it's not on Xcode 12. Also got CocoaPods lint all happy 👍

We might need to make an entirely separate project to get the Swift Package version working on CI. Thoughts?

Will wait on guidance around how we want to handle the different scales as well.

NickEntin commented 3 years ago

Should be able to rebase on master now to avoid the fishhook dependency

Sherlouk commented 3 years ago

Awesome! I'll take a fresh branch and go at it again this week (hopefully 🤞) - I'll start a new draft PR and I'll leave out most of the changes to tests (for now) focussing on the restructure and basic SPM support 👍