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

Support for packages without host application. #229

Open
michael-zimmermann opened this issue Dec 3, 2024 · 0 comments
Open

Support for packages without host application. #229

michael-zimmermann opened this issue Dec 3, 2024 · 0 comments

Comments

@michael-zimmermann
Copy link

It is not possible to run accessibility snapshot testing (using point-free ios-snapshotting) when creating swift packages.
The snapshots crash with

AccessibilitySnapshot/SnapshotTesting+Accessibility.swift:57: Fatal error: Accessibility snapshot tests cannot be run in a test target without a host application

It doesn't appear that the host application is necessary, at least with the point-free framework. Here is a snapshot where the default guard causing the fatal error is overridden.

I propose, to be able to pass a variable to the snapshotting-strategy to avoid checking if a host application is available. The default value true of this new parameter would keep the old strategy working the way it did and cause no backwards compatibility problems. By orverriding this to false, accessibility snapshots could also be done for swift packages.

        assertSnapshot(
            of: view,
            as: .accessibilityImage(
                shouldRunInHostApplication: false
            )
        )
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

1 participant