Testing Guide

This document provides instructions on how to run tests for Remote Compose.

Running Unit Tests

To run unit tests for a specific module, use the following command:

./gradlew :compose:remote:<module-name>:test

For Android modules, use:

./gradlew :compose:remote:<module-name>:testDebugUnitTest

Key Unit Tests

ModuleTest ClassDescription
remote-coreWireTestTests the binary wire format.
remote-creation-coreRemoteComposeWriterTestTests the procedural Java writer.
remote-creation-composeRemoteComposeV2TestTests the V2 Compose-based creation API.
player-view-demosRemoteComposeConverterTestPerforms round-trip conversion tests for .rc files.

Running RemoteComposeConverterTest

./gradlew :compose:remote:integration-tests:player-view-demos:testDebugUnitTest --tests "androidx.compose.remote.integration.view.convert.RemoteComposeConverterTest"

Running Instrumentation Tests

To run instrumentation (on-device) tests:

./gradlew :compose:remote:<module-name>:connectedCheck

Key Instrumentation Tests

ModuleTest ClassDescription
remote-creation-composeBasicLayoutTestVerifies basic layout rendering and capture.
remote-player-viewPlayerScreenshotTestVerifies rendering accuracy via screenshots.
remote-player-viewDisplayDocumentTestTests document loading and display.

Running All Tests

To run all tests in the project (caution: this may take a long time):

./gradlew :compose:remote:test

For instrumentation tests:

./gradlew :compose:remote:connectedCheck