Caution: This page may contain information that is specific to the legacy version of the driver framework (DFv1).
Scripting Layer for Fuchsia (SL4F) is an HTTP server that allows end-to-end tests to access driver services (for instance, Audio, Screen, Input, Diagnostics, and WebDriver) on a Fuchsia device.
Note: Fuchsia integrates with Android Comms Testing Suite{: .external} (ACTS), which enables Fuchsia devices to adapt the existing connectivity tests for Android. SL4F serves as a bridge between ACTS and a Fuchsia device.
End-to-end tests run on a host machine, unlike other Fuchsia packages that are served to a Fuchsia device and run on the device. To trigger actions on a Fuchsia device (for example, “swipe right on the screen”) from a remote test host, end-to-end tests send JSON-RPC requests to SL4F running on the device. SL4F then translates these requests into Fuchsia-equivalent FIDL commands for various driver services on the device.
However, not all requests from a test host to a Fuchsia device need to go through SL4F. For instance, a test can directly access a Fuchsia device‘s Flutter driver or Chrome driver over separate, dedicated HTTP connections (see Figure 1), given the condition that the test host can access these drivers’ ports on the device. If not, the test setup may require port forwarding.
The following sequence walks through how an end-to-end test triggers the “swipe right on the screen” action on a Fuchsia device:
Once started, SL4F continues to run on the device and accept requests until the test terminates SL4F.
Fuchsia extends the functionality of SL4F to introduce additional orchestration and inspection mechanisms that are necessary for testing Fuchsia products. SL4F structures this new functionality into groupings called facades. Each facade exposes one or more JSON-RPC methods.
For end-to-end tests to trigger actions and verify states on a Fuchsia device, a facade offers the following mechanisms:
SL4F currently supports several facades, for example: