mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-04-22 22:37:21 +00:00
144 lines
2.8 KiB
YAML
144 lines
2.8 KiB
YAML
# test_page.tavern.yaml
|
|
---
|
|
test_name: Obj Standard Properties
|
|
|
|
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}"
|
|
|
|
stages:
|
|
- name: step 1 - Page test
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command/page
|
|
payload: "1"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/page
|
|
payload: "1"
|
|
timeout: 1
|
|
delay_after: 0
|
|
- name: step 2 - Page test
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "page 2"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/page
|
|
payload: "2"
|
|
timeout: 1
|
|
delay_after: 0
|
|
- name: step 3 - Page test
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "page=3"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/page
|
|
payload: "3"
|
|
timeout: 1
|
|
delay_after: 0
|
|
- name: step 4 - Page test
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command/json
|
|
payload: '["page=1"]'
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/page
|
|
payload: "1"
|
|
timeout: 1
|
|
delay_after: 0
|
|
- name: step 5 - Page test
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command/json
|
|
payload: '["page 300"]'
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/page
|
|
payload: "1"
|
|
timeout: 1
|
|
delay_after: 0
|
|
|
|
---
|
|
test_name: Reboot Command
|
|
|
|
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}"
|
|
|
|
stages:
|
|
- name: Test reboot command
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command/reboot
|
|
payload: ""
|
|
mqtt_response:
|
|
topic: hasp/{plate}/LWT
|
|
payload: "offline"
|
|
timeout: 20
|
|
delay_after: 0
|
|
|
|
---
|
|
test_name: Idle States
|
|
|
|
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}"
|
|
|
|
stages:
|
|
- name: Test idle
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "wakeup"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/idle
|
|
payload: "long"
|
|
timeout: 190
|
|
delay_after: 0
|
|
|
|
- name: Test idle
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "wakeup"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/idle
|
|
payload: "short"
|
|
timeout: 70
|
|
delay_after: 0
|
|
|
|
- name: Test idle
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "wakeup"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/idle
|
|
payload: "off"
|
|
timeout: 1
|
|
delay_after: 0
|