diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-11 20:47:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-11 21:56:21 +0300 |
commit | a75d8e305b43e2797bfd93cd481868d858712146 (patch) | |
tree | 708d306ce8014c659288759f973d21184f660a66 /tools | |
parent | 0010195ed52eb3f79d694391254a082f0b99725f (diff) | |
download | manaverse-a75d8e305b43e2797bfd93cd481868d858712146.tar.gz manaverse-a75d8e305b43e2797bfd93cd481868d858712146.tar.bz2 manaverse-a75d8e305b43e2797bfd93cd481868d858712146.tar.xz manaverse-a75d8e305b43e2797bfd93cd481868d858712146.zip |
Add opening and closing help and setup window in runtest.sh
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/ci/scripts/runtest.sh | 64 |
1 files changed, 55 insertions, 9 deletions
diff --git a/tools/ci/scripts/runtest.sh b/tools/ci/scripts/runtest.sh index 95e3758e8..2758d2cb1 100755 --- a/tools/ci/scripts/runtest.sh +++ b/tools/ci/scripts/runtest.sh @@ -55,23 +55,69 @@ function final_log { function send_command { echo -n "$1" | nc 127.0.0.1 44007 + sleep 5s + check_is_run +} + +function check_exists { + if [ ! -f "logs/home/Desktop/ManaPlus/$1" ]; then + echo "Error: image $1 not exists" + exit 1 + fi + if [ ! -f "logs/home/Desktop/ManaPlus/$2" ]; then + echo "Error: image $2 not exists" + exit 1 + fi +} + +function imagesdiff { + check_exists "$1" "$2" + diff "logs/home/Desktop/ManaPlus/$1" "logs/home/Desktop/ManaPlus/$2" + if [ "$?" == 0 ]; then + echo "Error: images '$1' and '$2' is same." + exit 1 + fi +} + +function imagessame { + check_exists "$1" "$2" + diff "logs/home/Desktop/ManaPlus/$1" "logs/home/Desktop/ManaPlus/$2" + if [ "$?" != 0 ]; then + echo "Error: images '$1' and '$2' is different." + exit 1 + fi } run check_is_run -send_command "/screenshot 1_" -sleep 5s -check_is_run +send_command "/screenshot run.png" # send down key send_command "/guikey -960 keyGUIDown" -sleep 5s -check_is_run - -send_command "/screenshot 2_" -sleep 5s -check_is_run +send_command "/screenshot downkey.png" +imagesdiff run.png downkey.png + +# send up key +send_command "/guikey -961 keyGUIUp" +send_command "/screenshot run2.png" +imagessame run.png run2.png + +# open help +send_command "/help" +send_command "/screenshot help.png" +imagesdiff run2.png help.png +send_command "/help" +send_command "/screenshot run3.png" +imagessame run2.png run3.png + +# open settings +send_command "/setup" +send_command "/screenshot setup.png" +imagesdiff run3.png setup.png +send_command "/setup" +send_command "/screenshot run4.png" +imagessame run3.png run4.png # final delay sleep 5s |