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

Implement SemanticsNodeInteraction.captureToImage() #589

Merged

Conversation

m-sasha
Copy link

@m-sasha m-sasha commented Jun 1, 2023

Proposed Changes

Implement SemanticsNodeInteraction.captureToImage() to allow it to be used directly with a TestRule, rather than only in the context of a SkikoComposeUiTest.

Testing

Test: Added a unit test

@m-sasha m-sasha requested review from igordmn and eymar June 1, 2023 13:05
@m-sasha
Copy link
Author

m-sasha commented Jun 1, 2023

The trick with SkikoTestOwner is also how Android solves the problem of accessing test-assisting functionality in an Android-test-specific module from another module: androidx.compose.ui.platform.ViewRootForTest

@eymar
Copy link
Collaborator

eymar commented Jun 1, 2023

Just a note: while adding and completing the API of the ComposeTestRule is important to do, it's not supported in common tests (because of JUnit).
I think "runComposeUiTest" or "runSkikoComposeUiTest" should be promoted when we publish the test API (even if for desktop-only as a starting point).

@m-sasha
Copy link
Author

m-sasha commented Jun 1, 2023

Just a note: while adding and completing the API of the ComposeTestRule is important to do, it's not supported in common tests (because of JUnit).

Hmm, I see. So I guess I should move SkikoImageHelpers and SkikoTestOwner to jvmMain (and probably rename them to DesktopImageHelpers and DesktopTestOwner)?

@m-sasha m-sasha force-pushed the m-sasha/wait-for-idle-when-getting-test-roots branch from 1d3e287 to 388c66c Compare June 3, 2023 07:31
@m-sasha m-sasha force-pushed the m-sasha/implement-TestRule-captureToImage branch from 4eee669 to c6dec8b Compare June 3, 2023 07:32
@m-sasha m-sasha force-pushed the m-sasha/wait-for-idle-when-getting-test-roots branch from 388c66c to 3d8c570 Compare June 3, 2023 12:08
@m-sasha m-sasha force-pushed the m-sasha/implement-TestRule-captureToImage branch from c6dec8b to 8cd56f9 Compare June 3, 2023 12:08
Base automatically changed from m-sasha/wait-for-idle-when-getting-test-roots to m-sasha/test-framework June 4, 2023 07:04
@m-sasha m-sasha force-pushed the m-sasha/implement-TestRule-captureToImage branch from 8cd56f9 to 482bda5 Compare June 4, 2023 07:05
@m-sasha m-sasha merged commit 3dc5bbb into m-sasha/test-framework Jun 4, 2023
@m-sasha m-sasha deleted the m-sasha/implement-TestRule-captureToImage branch June 4, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants