forked from HASwitchPlate/openHASP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_switch.tavern.yaml
288 lines (265 loc) · 6.25 KB
/
test_switch.tavern.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# 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}"
marks:
- parametrize:
key: obj
vals:
- switch
- parametrize:
key:
- hidden
- hidden_inv
- x
- y
- w
- h
- radius
- opacity
- str1
- str2
vals:
- [1, 0, 120, 121, 122, 123, 0, 255, "I'm sorry.", "louie"]
- [1, 0, -10, -10, 256, 257, 1, 64, "louie", " The cat stretched."]
- [
0,
1,
1024,
1025,
1026,
1027,
5,
0,
"The pipe began to rust while new.",
"",
]
- [
0,
1,
80,
81,
82,
83,
32535,
192,
"",
" Oak is strong and also gives shade.",
]
stages:
- name: Page 1
mqtt_publish:
topic: hasp/{plate}/command
payload: "page 1"
mqtt_response:
topic: hasp/{plate}/state/page
payload: "1"
timeout: 1
delay_after: 0
- name: Clear page
mqtt_publish:
topic: hasp/{plate}/command/clearpage
payload: ""
delay_after: 0.2
- name: Create object
mqtt_publish:
topic: hasp/{plate}/command/jsonl
json:
obj: "{obj}"
id: 1
x: 128
y: 128
delay_after: 0
- name: Test x
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.x={x}","p1b1.x"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
x: !int "{x:d}"
timeout: 1
- name: Test y
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.y={y}","p1b1.y"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
y: !int "{y:d}"
timeout: 1
- name: Test w
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.w={w}","p1b1.w"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
w: !int "{w:d}"
timeout: 1
- name: Test h
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.h={h}","p1b1.h"]'
delay_after: 0
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
h: !int "{h:d}"
timeout: 1
- name: Test enabled
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.enabled={hidden}","p1b1.enabled"]'
delay_after: 0
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
enabled: !int "{hidden:d}"
timeout: 1
- name: Test click
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.click={hidden}","p1b1.click"]'
delay_after: 0
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
click: !int "{hidden:d}"
timeout: 1
- name: Test swipe
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.swipe={hidden_inv}","p1b1.swipe"]'
delay_after: 0
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
swipe: !int "{hidden_inv:d}"
timeout: 1
- name: Set vis
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.vis={hidden}"
delay_after: 0
- name: Get hidden
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.hidden"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
hidden: !int "{hidden_inv:d}"
timeout: 1
- name: Get vis
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.vis"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
vis: !int "{hidden:d}"
timeout: 1
- name: Set hidden
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.hidden={hidden}"
delay_after: 0
- name: Get hidden
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.hidden"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
hidden: !int "{hidden:d}"
timeout: 1
- name: Get vis
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.vis"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
vis: !int "{hidden_inv:d}"
timeout: 1
- name: Test opacity
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.opacity={opacity}","p1b1.opacity"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
opacity: !int "{opacity:d}"
timeout: 1
- name: Test radius
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.radius={radius}","p1b1.radius"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
radius: !int "{radius:d}"
timeout: 1
- name: Test radius2
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.radius2={radius}","p1b1.radius2"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
radius2: !int "{radius:d}"
timeout: 1
- name: Set value_str
mqtt_publish:
topic: "hasp/{plate}/command/p1b1.value_str"
payload: "{str1}{str2}"
delay_after: 0.05
- 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
- name: Get obj type
mqtt_publish:
topic: hasp/{plate}/command
payload: "p1b1.obj"
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
obj: "{obj}"
timeout: 1
- name: Test groupid
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.groupid={hidden}","p1b1.groupid"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
groupid: !int "{hidden:d}"
timeout: 1
- name: Test val
mqtt_publish:
topic: hasp/{plate}/command/json
payload: '["p1b1.val={hidden}","p1b1.val"]'
mqtt_response:
topic: hasp/{plate}/state/p1b1
json:
val: !int "{hidden:d}"
timeout: 1