Update tests

This commit is contained in:
fvanroie 2021-04-22 05:18:58 +02:00
parent e018baed09
commit 0aece4f29f
5 changed files with 166 additions and 18 deletions

3
.gitignore vendored
View File

@ -5,12 +5,13 @@
.git
.pio
data/*
src/user_setups/active/*
include/user_config_override.h
src/user_config_override.h
user_config_override.h
platformio_override.ini
user_setups/active/*
src/user_setups/active/*
test/config.yaml
build_output/*
build_output/firmware/*.bin
build_output/firmware/*.exe

View File

@ -159,3 +159,69 @@ stages:
g: !int "{g:d}"
b: !int "{b:d}"
timeout: 1
---
test_name: Value String Loop
includes:
- !include config.yaml
paho-mqtt:
client:
transport: tcp
client_id: tavern-tester
connect:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
marks:
- parametrize:
key: str1
vals:
- "Test 123456 longer strings work too"
- "The cat stretched."
- "Jacob stood on his tiptoes."
- "The car turned the corner."
- "Kelly twirled in circles."
- "She opened the door."
- "Aaron made a picture."
- "I'm sorry."
- huey
- dewey
- ""
- parametrize:
key: str2
vals:
- louie
- " I danced."
- " Oak is strong and also gives shade."
- " Cats and dogs each hate the other."
- " The pipe began to rust while new."
- " Open the crate but don't break the glass."
- " Add the sum to the product of these three."
- " Thieves who rob friends deserve jail."
- " The ripe taste of cheese improves with age."
- " Act on these orders with great speed."
- " The hog crawled under the high fence."
- " Move the vat over the hot fire."
- ""
stages:
- name: Set value_str
mqtt_publish:
topic: "hasp/{plate}/command/p1b1.value_str"
payload: "{str1}{str2}"
- name: Get value_str
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.value_str"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
value_str: "{str1}{str2}"
timeout: 1

View File

@ -344,3 +344,69 @@ stages:
json:
vis: 1
timeout: 1
---
test_name: Value String Loop
includes:
- !include config.yaml
paho-mqtt:
client:
transport: tcp
client_id: tavern-tester
connect:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
marks:
- parametrize:
key: str1
vals:
- "Test 123456 longer strings work too"
- "The cat stretched."
- "Jacob stood on his tiptoes."
- "The car turned the corner."
- "Kelly twirled in circles."
- "She opened the door."
- "Aaron made a picture."
- "I'm sorry."
- huey
- dewey
- ""
- parametrize:
key: str2
vals:
- louie
- " I danced."
- " Oak is strong and also gives shade."
- " Cats and dogs each hate the other."
- " The pipe began to rust while new."
- " Open the crate but don't break the glass."
- " Add the sum to the product of these three."
- " Thieves who rob friends deserve jail."
- " The ripe taste of cheese improves with age."
- " Act on these orders with great speed."
- " The hog crawled under the high fence."
- " Move the vat over the hot fire."
- ""
stages:
- name: Set value_str
mqtt_publish:
topic: "hasp/{plate}/command/p1b1.value_str"
payload: "{str1}{str2}"
- name: Get value_str
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.value_str"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
value_str: "{str1}{str2}"
timeout: 1

View File

@ -26,7 +26,7 @@ stages:
topic: hasp/{plate}/state/page
payload: "1"
timeout: 1
delay_after: 0
- name: step 2 - Page test
mqtt_publish:
topic: hasp/{plate}/command
@ -35,7 +35,7 @@ stages:
topic: hasp/{plate}/state/page
payload: "2"
timeout: 1
delay_after: 0
- name: step 3 - Page test
mqtt_publish:
topic: hasp/{plate}/command
@ -44,7 +44,7 @@ stages:
topic: hasp/{plate}/state/page
payload: "3"
timeout: 1
delay_after: 0
- name: step 4 - Page test
mqtt_publish:
topic: hasp/{plate}/command/json
@ -53,7 +53,7 @@ stages:
topic: hasp/{plate}/state/page
payload: "1"
timeout: 1
delay_after: 0
- name: step 5 - Page test
mqtt_publish:
topic: hasp/{plate}/command/json
@ -62,7 +62,6 @@ stages:
topic: hasp/{plate}/state/page
payload: "1"
timeout: 1
delay_after: 0
---
test_name: Reboot Command
@ -77,9 +76,18 @@ paho-mqtt:
connect:
host: "{host}"
port: !int "{port:d}"
timeout: 1
timeout: 3
auth:
username: "{username}"
password: "{password}"
stages:
- name: Lower idle values
mqtt_publish:
topic: hasp/{plate}/config/gui
json:
idle1: 6
idle2: 13
- name: Test reboot command
mqtt_publish:
topic: hasp/{plate}/command/reboot
@ -103,6 +111,9 @@ paho-mqtt:
host: "{host}"
port: !int "{port:d}"
timeout: 3
auth:
username: "{username}"
password: "{password}"
stages:
- name: Test idle
@ -111,17 +122,16 @@ stages:
payload: "wakeup"
mqtt_response:
topic: hasp/{plate}/state/idle
payload: "long"
timeout: 190
- name: Test idle
mqtt_publish:
topic: hasp/{plate}/command
payload: "wakeup"
payload: "off"
timeout: 5
mqtt_response:
topic: hasp/{plate}/state/idle
payload: "short"
timeout: 70
timeout: 15
mqtt_response:
topic: hasp/{plate}/state/idle
payload: "long"
timeout: 30
- name: Test idle
mqtt_publish:
@ -130,4 +140,4 @@ stages:
mqtt_response:
topic: hasp/{plate}/state/idle
payload: "off"
timeout: 1
timeout: 5

View File

@ -49,13 +49,13 @@ marks:
- parametrize:
key: obj
vals:
- cpicker
# - cpicker
- table
- tabview
- chart
- gauge
- btn
- label
# - label
- slider
- checkbox
- switch
@ -102,6 +102,11 @@ marks:
- ""
stages:
- name: Clear page
mqtt_publish:
topic: hasp/{plate}/command
payload: clearpage
- name: Create object
mqtt_publish:
topic: hasp/{plate}/command/jsonl