mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-04-24 07:17:21 +00:00
413 lines
8.5 KiB
YAML
413 lines
8.5 KiB
YAML
# test_page.tavern.yaml
|
|
---
|
|
test_name: Label Standard Properties
|
|
|
|
includes:
|
|
- !include config.yaml
|
|
|
|
paho-mqtt: &mqtt_spec
|
|
client:
|
|
transport: tcp
|
|
client_id: tavern-tester
|
|
connect:
|
|
host: "{host}"
|
|
port: !int "{port:d}"
|
|
timeout: 1
|
|
auth:
|
|
username: "{username}"
|
|
password: "{password}"
|
|
|
|
stages:
|
|
- name: Page 1
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "page 1"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/page
|
|
payload: "1"
|
|
timeout: 1
|
|
|
|
- name: Clear page
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command/clearpage
|
|
payload: ""
|
|
|
|
- name: Create object
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command/jsonl
|
|
json:
|
|
objid: 12
|
|
id: 1
|
|
|
|
- name: Set x
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.x=50"
|
|
|
|
- name: Get x
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.x"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
x: 50
|
|
timeout: 1
|
|
- name: Set x
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.x=25"
|
|
- name: Get x
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.x"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
x: 25
|
|
timeout: 1
|
|
|
|
- name: Set y
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.y=50"
|
|
|
|
- name: Get y
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.y"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
y: 50
|
|
timeout: 1
|
|
- name: Set y
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.y=25"
|
|
|
|
- name: Get y
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.y"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
y: 25
|
|
timeout: 1
|
|
|
|
- name: Set w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w=50"
|
|
|
|
- name: Get w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
w: !anything
|
|
timeout: 1
|
|
- name: Set w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w=25"
|
|
- name: Get w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
w: !anything
|
|
timeout: 1
|
|
|
|
- name: Set h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h=50"
|
|
|
|
- name: Get h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
h: !anything
|
|
timeout: 1
|
|
- name: Set h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h=25"
|
|
|
|
- name: Get h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
h: !anything
|
|
timeout: 1
|
|
|
|
- name: Set mode
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.mode=crop"
|
|
|
|
- name: Get mode
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.mode"
|
|
|
|
- name: Set w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w=50"
|
|
|
|
- name: Get w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
w: 50
|
|
timeout: 1
|
|
- name: Set w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w=25"
|
|
- name: Get w
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.w"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
w: 25
|
|
timeout: 1
|
|
|
|
- name: Set h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h=50"
|
|
|
|
- name: Get h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
h: 50
|
|
timeout: 1
|
|
- name: Set h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h=45"
|
|
|
|
- name: Get h
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.h"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
h: 45
|
|
timeout: 1
|
|
|
|
- name: Set enabled
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.enabled=0"
|
|
|
|
- name: Get enabled
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.enabled"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
enabled: 0
|
|
timeout: 1
|
|
- name: Set enabled
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.enabled=1"
|
|
|
|
- name: Get enabled
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.enabled"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
enabled: 1
|
|
timeout: 1
|
|
|
|
- name: Set hidden
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.hidden=1"
|
|
|
|
- name: Get hidden
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.hidden"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
hidden: 1
|
|
timeout: 1
|
|
- name: Get vis
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.vis"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
vis: 0
|
|
timeout: 1
|
|
|
|
- name: Set hidden
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.hidden=0"
|
|
|
|
- name: Get hidden
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.hidden"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
hidden: 0
|
|
timeout: 1
|
|
- name: Get vis
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.vis"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
vis: 1
|
|
timeout: 1
|
|
|
|
- name: Set vis
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.vis=0"
|
|
|
|
- name: Get hidden
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.hidden"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
hidden: 1
|
|
timeout: 1
|
|
- name: Get vis
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.vis"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
vis: 0
|
|
timeout: 1
|
|
|
|
- name: Set vis
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.vis=1"
|
|
|
|
- name: Get hidden
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.hidden"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
json:
|
|
hidden: 0
|
|
timeout: 1
|
|
- name: Get vis
|
|
mqtt_publish:
|
|
topic: hasp/{plate}/command
|
|
payload: "p1b1.vis"
|
|
mqtt_response:
|
|
topic: hasp/{plate}/state/p1b1
|
|
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
|