Skip to content

Commit 8a80e83

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 79ff756 commit 8a80e83

7 files changed

+70
-1
lines changed
118 KB
Loading
37.3 KB
Loading
Loading
150 KB
Loading

.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 && export XDG_RUNTIME_DIR=/run/user/1000 WAYLAND_DISPLAY=wayland-1 && 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.0100
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,54 @@
1+
*** Variables ***
2+
${INIT_SCREEN_IMAGE} init-screen.png
3+
${HOME_SCREEN_IMAGE} home-screen.png
4+
${SEARCH_SCREEN_IMAGE} search-screen.png
5+
${SEARCH_NAVIGATION_SCREEN_IMAGE} search-navigation-screen.png
6+
7+
*** Settings ***
8+
Test Timeout 60 seconds
9+
10+
Library ../libs/TestUtils.py
11+
12+
Resource variables.robot
13+
Resource keywords_common.robot
14+
15+
*** Test Cases ***
16+
Test Check Navigation Bar
17+
[Tags] ignoreonfail
18+
19+
${TEST_BOARD_IP} Get Environment Variable TEST_BOARD_IP
20+
21+
SSH Command ${TEST_BOARD_IP} sed -i 's|ExecStart=/usr/bin/weston --continue-without-input --modules=systemd-notify.so|ExecStart=/usr/bin/weston --continue-without-input --modules=systemd-notify.so --debug|' /lib/systemd/system/weston.service
22+
SSH Command ${TEST_BOARD_IP} systemctl daemon-reload && systemctl restart weston
23+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${INIT_SCREEN_IMAGE}
24+
25+
# Open Home
26+
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
27+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${HOME_SCREEN_IMAGE}
28+
29+
# Open Search
30+
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
31+
Sleep 10s
32+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 0.2 --steps 2 --delay-on-touch-up 0 90 300 90 300
33+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${SEARCH_SCREEN_IMAGE}
34+
35+
# Click
36+
SSH Command ${TEST_BOARD_IP} /root/scripts/touch-one-finger-gesture.py --duration 0.2 --steps 2 --delay-on-touch-up 0 90 90 90 90
37+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${SEARCH_NAVIGATION_SCREEN_IMAGE}
38+
39+
# Navigation Back
40+
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
41+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${SEARCH_SCREEN_IMAGE}
42+
43+
# Navigation Forward
44+
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
45+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${SEARCH_NAVIGATION_SCREEN_IMAGE}
46+
47+
# Reload
48+
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
49+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${SEARCH_NAVIGATION_SCREEN_IMAGE}
50+
51+
# Terminate browser
52+
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
53+
Wait Until Keyword Succeeds 20x 1000ms Remote Weston Check Screenshot ${INIT_SCREEN_IMAGE}
54+

0 commit comments

Comments
 (0)