Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run snapshot test directly in Swift Package Manager (SPM) containing SwiftUI views #732

Open
XRadevFRT opened this issue May 12, 2023 · 3 comments

Comments

@XRadevFRT
Copy link

Greetings everyone!
The title pretty much says it all. Im currently exporting the UI in a SwiftPM and because there are already XCTest I was wondering if there is a way to directly snapshot the UI in the package...

@mltbnz
Copy link

mltbnz commented Jun 7, 2023

You can set up and run the tests from your package.

You can take a look here:

https://github.com/criticalmaps/criticalmaps-ios/tree/main/CriticalMapsKit/Tests/StyleguideTests

@XRadevFRT
Copy link
Author

@mltbnz

Thank You! By chance, I managed to make them work. But still, your answer is beneficial to me.

One thing I couldn't do, however, is to generate images for the failing tests...
Help will be much appreciated! 🍻

@mltbnz
Copy link

mltbnz commented Jun 7, 2023

I think I don't know what you referring to.
If you mean the failure screenshot when a test fails you will see them in Xcode

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants