display_interactive.display_interactive¶
Source code: display_interactive/display_interactive.py
Test display functionality with interactive mode.
Description¶
This test runs in interactive mode.
A host (test station) connects to this test via xml-rpc client. The test supports the following functions that can be called by the host:
GetSerialNumber: Retrieves the DUT device serial number.
ShowPattern: Displays a pattern defined in css, multiple patterns can be shown and the previous pattern will be hidden after the new one is displayed.
ShowImage: Displays a local image on the DUT. Multiple images can be shown, and the previous image will be hidden after the new one is displayed.
SetDisplayBrightness: Sets the brightness level of the display.
SetKeyboardBacklight: Sets the brightness level of the keyboard backlight.
tearDown: Closes the XML-RPC server and ends the test with a “PASS” result.
FailTest: Fails the test with the given reason.
Test Procedure¶
At the beginning, if the argument autostart
is set, the DUT will display a
white screen without calling any functions; otherwise it will wait for the space
key to be pressed before starting the test. Additionally, the test will wait for
the XML-RPC client to connect and then call the functions defined above to
control the DUT.
When the ShowImage
function is invoked, we verify if the file is present in
the static folder located at py/test/pytests/display_interactive/static/
.
The test fails if the image is not found, or else it will be displayed in
fullscreen mode. Moreover, if a pattern or image was previously displayed by the
ShowImage
function, it will first be hidden before displaying a new image.
Dependency¶
This test uses javascript to control the display.
This test uses an XML-RPC server to receive commands from the test station.
Examples¶
To test display functionality, add this into test list:
{
"pytest_name": "display_interactive.display_interactive",
"label": "Enter Front Of Screen Test Interactive Mode",
"related_components": [
"test_tags.TestCategory.LCD"
],
"args": {
"port": 5566,
"autostart": true
}
}
Test Arguments¶
Name |
Type |
Description |
---|---|---|
port |
int |
(optional; default: |
autostart |
bool |
(optional; default: |