Skip to content

Commit 2941322

Browse files
committed
ci: Add screenshot validation and navigation bar test
* Introduced screenshot validation using `Remote Weston Capture Screenshot` and `Remote Weston Check Screenshot` keywords. * Implemented a new test: `Test Check Navigation Bar` to verify navigation bar transitions using screenshots. * Updated dependencies in `keywords_common.robot` to include `DocTest.VisualTest`.
1 parent 5161e35 commit 2941322

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

.ci/robot_framework/tests/keywords_common.robot

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
*** Variables ***
2+
${BASELINE_IMAGES_PATH} /app/robot_framework/images/
3+
14
*** Settings ***
25
Library Collections
6+
Library DocTest.VisualTest
37
Library OperatingSystem
48
Library ../libs/TestUtils.py
59

@@ -31,6 +35,18 @@ Get Remote Memory Used
3135
${value}= Evaluate float(${stdout}[0])
3236
RETURN ${value}
3337

38+
Remote Weston Capture Screenshot
39+
[Arguments] ${capture_name}
40+
41+
${TEST_BOARD_IP} Get Environment Variable TEST_BOARD_IP
42+
SSH Command ${TEST_BOARD_IP} rm -rf wayland-screenshot-*.png && weston-screenshooter
43+
Run scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@%{TEST_BOARD_IP}:~/wayland-screenshot-*.png ${capture_name}
44+
45+
Remote Weston Check Screenshot
46+
[Arguments] ${image}
47+
Remote Weston Capture Screenshot ${image}
48+
Compare Images ${BASELINE_IMAGES_PATH}/${image} ${image} threshold=0.0005
49+
3450
Webdriver Remote Start
3551
[Arguments] @{other_params}
3652
[Timeout] 2 minutes
@@ -57,4 +73,3 @@ Webdriver Remote Stop
5773
Close All Browsers
5874
SSH Webdriver Remote Stop ${TEST_BOARD_IP}
5975
SSH Force Kill ${TEST_BOARD_IP} cog
60-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
*** Variables ***
2+
${INIT_SCREEN_IMAGE} init-screen.png
3+
${HOME_SCREEN_IMAGE} home-screen.png
4+
${SEARCH_SCREEN_IMAGE} search-screen.png
5+
6+
*** Settings ***
7+
Test Timeout 60 seconds
8+
9+
Library ../libs/TestUtils.py
10+
11+
Resource variables.robot
12+
Resource keywords_common.robot
13+
14+
*** Test Cases ***
15+
Test Check Navigation Bar
16+
[Tags] ignoreonfail
17+
18+
${TEST_BOARD_IP} Get Environment Variable TEST_BOARD_IP
19+
20+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 595 15 595 15
21+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${INIT_SCREEN_IMAGE}
22+
23+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 215 15 215 15
24+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${HOME_SCREEN_IMAGE}
25+
26+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 275 15 275 15
27+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${SEARCH_SCREEN_IMAGE}
28+
29+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 345 15 345 15
30+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${HOME_SCREEN_IMAGE}
31+
32+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 400 15 400 15
33+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${SEARCH_SCREEN_IMAGE}
34+
35+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 470 15 470 15
36+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${SEARCH_SCREEN_IMAGE}
37+
38+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 1 --steps 1 --delay-on-touch-up 0 595 15 595 15
39+
Wait Until Keyword Succeeds 6x 500ms Remote Weston Check Screenshot ${INIT_SCREEN_IMAGE}
40+

0 commit comments

Comments
 (0)