1 from panda3d
.core
import load_prc_file_data
2 load_prc_file_data('', 'window-type none')
4 from pathlib
import Path
7 from xmlrpc
.client
import ServerProxy
8 from os
import makedirs
9 from os
.path
import exists
10 from sys
import exit
, argv
11 from direct
.showbase
.ShowBase
import ShowBase
14 from logging
import basicConfig
, debug
, info
, DEBUG
, getLogger
, Formatter
, FileHandler
, StreamHandler
17 basicConfig(level
=DEBUG
, format
='(evt-test) %(asctime)s.%(msecs)03d %(message)s', datefmt
='%H:%M:%S')
18 getLogger().setLevel(DEBUG
) # it doesn't work otherwise
19 getLogger().addHandler(StreamHandler(sys
.stdout
))
29 def __init__(self
, idx
, offset
):
30 debug('creating FunctionalTest (%s)' % id(self
))
33 # timestamp = datetime.datetime.now().strftime('%y%m%d%H%M%S')
34 # logFormatter = Formatter('%(asctime)s.%(msecs)03d %(message)s', datefmt='%H:%M:%S')
35 # path = str(Path.home()) + '/.local/share/pmachines/logs/evt/'
36 # if not exists(path):
38 # lpath = path + 'evt_%s.log' % timestamp
39 # fileHandler = FileHandler(lpath)
40 # fileHandler.setFormatter(logFormatter)
41 # getLogger().addHandler(fileHandler)
43 info('test idx: %s' % idx
)
46 self
._proxy
= ServerProxy('http://localhost:7000')
50 #taskMgr.add(self.on_frame_unpausable, 'on-frame-unpausable')
51 self
._proxy
.set_index(idx
)
52 self
._do
_screenshots
(idx
)
54 def _do_screenshot(self
, name
):
55 # time = datetime.datetime.now().strftime('%y%m%d%H%M%S')
57 self
._proxy
.screenshot(name
)
58 info('screenshot %s' % name
)
60 async def _screenshot(self
, time
, name
):
62 # self._curr_time + time,
63 # lambda: self._do_screenshot(name),
64 # 'screenshot: %s' % name)]
65 #self._curr_time += time
66 await asyncio
.sleep(time
)
67 self
._do
_screenshot
(name
)
69 async def __mouse_click(self
, tgt
, btn
):
70 await asyncio
.sleep(.5)
71 offset_x
= int((1920 - 1360) / 2) #+ 1 # xfce decorations
72 offset_y
= int((1080 - 768) / 2) #+ 24 + self._offset # xfce decorations
73 btn
= 3 if btn
== 'right' else 1
74 pos
= self
._proxy
.get_position(tgt
)
75 system('xdotool mousemove %s %s' % (offset_x
+ pos
[0], offset_y
+ pos
[1]))
77 # system('xdotool click %s' % tgt)
78 # print('CLICK %s' % str(btn))
79 #taskMgr.do_method_later(.28, click, 'click')
80 await asyncio
.sleep(.5)
81 system('xdotool click %s' % btn
)
83 async def __mouse_drag(self
, start
, end
, btn
):
84 await asyncio
.sleep(.5)
85 offset_x
= int((1920 - 1360) / 2) #+ 1 # xfce decorations
86 offset_y
= int((1080 - 768) / 2) #+ 24 + self._offset # xfce decorations
87 btn
= 3 if btn
== 'right' else 1
88 start
= self
._proxy
.get_position(start
)
89 end
= self
._proxy
.get_position(end
)
90 system('xdotool mousemove %s %s' % (offset_x
+ start
[0], offset_y
+ start
[1]))
91 await asyncio
.sleep(.5)
92 system('xdotool mousedown %s' % btn
)
93 await asyncio
.sleep(.5)
94 system('xdotool mousemove %s %s' % (offset_x
+ end
[0], offset_y
+ end
[1]))
95 await asyncio
.sleep(.5)
96 system('xdotool mouseup %s' % btn
)
97 # def mousedown(task):
98 # system('xdotool mousedown %s' % btn)
99 # def mousemove(task):
100 # system('xdotool mousemove %s %s' % (offset_x + end[0], offset_y + end[1]))
102 # system('xdotool mouseup %s' % btn)
103 # taskMgr.do_method_later(.28, mouseup, 'mouseup')
104 # taskMgr.do_method_later(.28, mousemove, 'mousemove')
105 # taskMgr.do_method_later(.28, mousedown, 'mousedown')
107 async def __emulate_keys(self
, keys
):
108 await asyncio
.sleep(.4)
110 await asyncio
.sleep(.3)
111 system(f
'xdotool key {k}')
113 async def _event(self
, time
, evt
, mouse_args
=None):
114 await asyncio
.sleep(time
)
115 if evt
== 'mouseclick':
116 #cback = lambda: self.__mouse_click(*mouse_args)
117 await self
.__mouse
_click
(*mouse_args
)
118 elif evt
== 'mousedrag':
119 #cback = lambda: self.__mouse_drag(*mouse_args)
120 await self
.__mouse
_drag
(*mouse_args
)
121 elif evt
== 'keyboard':
122 #cback = lambda: self.__mouse_drag(*mouse_args)
123 await self
.__emulate
_keys
(mouse_args
)
125 # self._curr_time + time,
127 # 'event: %s' % evt)]
128 #self._curr_time += time
130 async def _enforce_result(self
, time
, res
):
131 await asyncio
.sleep(time
)
132 self
._proxy
.enforce_result(res
)
134 # self._proxy.enforce_result(res)
135 # info('enforce_result %s' % res)
137 # self._curr_time + time,
139 # 'enforce res: %s' % res)]
140 #self._curr_time += time
142 async def _enforce_resolution(self
, time
, res
):
143 await asyncio
.sleep(time
)
144 self
._proxy
.enforce_resolution(res
)
146 # self._proxy.enforce_resolution(res)
147 # info('enforce_resolution %s (send)' % res)
149 # self._curr_time + time,
151 # 'enforce resolution: %s' % res)]
152 #self._curr_time += time
154 async def _verify(self
, time
):
155 await asyncio
.sleep(time
)
159 # self._proxy.verify()
162 # self._curr_time + 3,
163 # lambda: __verify(),
165 #self._curr_time += 3
167 async def _exit(self
, time
):
168 await asyncio
.sleep(time
)
171 except (ConnectionRefusedError
, xmlrpc
.client
.Fault
) as e
: # the other part has been closed with the exit button
172 debug('already closed (%s)' % e
)
173 debug('destroying FunctionalTest (%s)' % id(self
))
177 # self._proxy.close()
178 # except (ConnectionRefusedError, xmlrpc.client.Fault) as e: # the other part has been closed with the exit button
179 # debug('already closed (%s)' % e)
180 # debug('destroying FunctionalTest (%s)' % id(self))
183 # self._curr_time + 3,
187 # def on_frame_unpausable(self, task):
188 # for tsk in self._tasks:
189 # #if self._prev_time <= tsk[0] < self.eng.event.unpaused_time:
190 # if self._prev_time <= tsk[0] < globalClock.getFrameTime():
191 # debug('%s %s' % (tsk[0], tsk[2]))
193 # self._prev_time = globalClock.getFrameTime() # self.eng.event.unpaused_time
196 async def _do_screenshots_1(self
):
197 info('_do_screenshots_1')
198 await self
._screenshot
(FunctionalTest
.start_time
, 'main_menu')
199 await self
._do
_screenshots
_credits
()
200 await self
._do
_screenshots
_options
()
201 await self
._do
_screenshots
_exit
()
203 async def _do_screenshots_credits(self
):
204 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left'])
205 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['credits', 'left'])
206 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'credits_menu')
207 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left'])
208 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['back', 'left'])
209 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'main_menu_back_from_credits')
211 async def _do_screenshots_options(self
):
212 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 300), 'left'])
213 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['options', 'left'])
214 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'options_menu')
216 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
217 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['languages', 'left'])
218 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'open_languages')
219 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(980, 120), 'left'])
220 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['italian', 'left'])
221 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'options_menu_italian')
223 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 163), 'left'])
224 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['volume', 'left'])
225 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'options_menu_drag_1')
227 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
228 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['aa', 'left'])
229 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'antialiasing_no')
231 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
232 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['shadows', 'left'])
233 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'shadows_no')
234 # test aa and shadows
235 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
236 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['back', 'left']) # back
237 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
238 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['play', 'left']) # play
239 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
240 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['domino', 'left']) # domino
241 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(900, 490), 'left']) # close instructions
242 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left']) # close instructions
243 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'aa_no_shadows_no')
244 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(25, 740), 'left']) # home
245 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['home', 'left']) # home
247 async def _do_screenshots_restore_options(self
):
248 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 300), 'left'])
249 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['options', 'left'])
250 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'options_menu_restored')
252 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 60), 'left'])
253 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['languages', 'left'])
254 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'open_languages_restored')
255 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(980, 20), 'left'])
256 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['english', 'left'])
257 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'options_menu_english')
259 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(719, 163), 'left'])
260 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['volume_0', 'left'])
261 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'options_menu_drag_2')
263 # the first one is because of the windowed mode in test
264 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
265 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['fullscreen', 'left'])
266 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'fullscreen')
267 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
268 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['fullscreen', 'left'])
269 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'fullscreen')
270 #await self._event(8 + FunctionalTest.evt_time, 'mouseclick', [(440, 120), 'left'])
271 #await self._event(8 + FunctionalTest.evt_time, 'mouseclick', [(680, 250), 'left'])
272 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['fullscreen', 'left'])
273 await self
._screenshot
(8 + FunctionalTest
.screenshot_time
, 'back_from_fullscreen')
275 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 340), 'left'])
276 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['resolutions', 'left'])
277 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'resolutions')
278 await self
._enforce
_resolution
(FunctionalTest
.evt_time
, '1440x900')
279 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1000, 440), 'left'])
280 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['res_1440x900', 'left'])
281 await self
._screenshot
(FunctionalTest
.screenshot_time
, '1440x900')
282 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(740, 400), 'left'])
283 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['resolutions', 'left'])
284 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'resolutions_2')
285 await self
._enforce
_resolution
(FunctionalTest
.evt_time
, '1360x768')
286 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1110, 80), 'left'])
287 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['res_1360x768', 'left'])
288 await self
._screenshot
(FunctionalTest
.screenshot_time
, '1360x768')
290 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 440), 'left'])
291 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['aa', 'left'])
292 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'antialiasing_yes')
294 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 540), 'left'])
295 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['shadows', 'left'])
296 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'shadows_yes')
297 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
298 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['back', 'left'])
300 async def _do_screenshots_play(self
):
301 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
302 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['play', 'left'])
303 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'play_menu')
304 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 680), 'left']) # back
305 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['back', 'left'])
306 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'back_from_play')
307 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
308 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['play', 'left'])
309 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino scene
310 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['domino', 'left'])
311 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_domino_instructions')
312 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
313 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
314 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_domino')
315 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(25, 740), 'left']) # home
316 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['home', 'left'])
317 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'home_back_from_scene')
318 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
319 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['play', 'left'])
320 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
321 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['domino', 'left'])
322 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
323 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
324 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(70, 740), 'left']) # info
325 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['information', 'left'])
326 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'info')
327 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
328 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
329 # await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (430, 280), 'left']) # drag a piece
330 # await self._screenshot(FunctionalTest.screenshot_time, 'domino_dragged')
331 # await self._event(FunctionalTest.evt_time, 'mouseclick', [(1220, 740), 'left']) # rewind
332 # await self._screenshot(FunctionalTest.screenshot_time, 'rewind')
333 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left']) # drag a piece
334 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
335 # await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
336 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
337 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left']) # play
338 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_domino')
339 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(630, 450), 'left']) # home
340 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['home_win', 'left']) # home
341 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'home_back_from_fail')
342 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 140), 'left']) # play
343 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['play', 'left']) # play
344 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(230, 160), 'left']) # domino
345 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['domino', 'left'])
346 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(850, 490), 'left']) # close instructions
347 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
348 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (550, 380), 'left']) # drag a piece
349 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
350 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
351 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a piece .49 .06
352 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
353 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left']) # play
354 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_domino_2')
355 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
356 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left']) # play
357 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (570, 380), 'left']) # drag a piece -1.54 .06
358 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a piece -1.54 .06
359 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(570, 355), (605, 355), 'right']) # rotate the piece -1.05 .4
360 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_1', 'drag_stop_3', 'right']) # rotate the piece -1.54 .4 -1.05 .4
361 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(35, 60), (715, 380), 'left']) # drag a piece
362 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a piece
363 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
364 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
365 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left']) # play
366 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_domino')
367 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
368 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
369 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['next', 'left']) # play
370 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_box')
372 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(880, 490), 'left']) # close instructions
373 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
374 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 620), 'left']) # drag a box .42 -3.29
375 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box .42 -3.29
376 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left']) # drag a box .42 -2.18
377 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box .42 -2.18
378 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
379 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
380 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_box')
381 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
382 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left'])
383 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 620), 'left']) # drag a box
384 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
385 # await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (710, 540), 'left']) # drag a box
386 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box
387 # await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (705, 460), 'left']) # drag a box .35 -1.06
388 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a box .35 -1.06
389 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
390 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
391 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
392 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_box')
393 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
394 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
395 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['next', 'left'])
396 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_box_domino')
398 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(930, 485), 'left']) # close instructions
399 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
400 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 440), 'left']) # drag a box 3.21 -.78
401 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box 3.21 -.78
402 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 360), 'left']) # drag a box 3.21 .33
403 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box 3.21 .33
404 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
405 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
406 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_box_domino')
407 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
408 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left'])
409 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (910, 440), 'left']) # drag a box
410 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
411 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (835, 250), 'left']) # drag a box 2.16 1.87
412 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_2', 'left']) # drag a box 2.16 1.87
413 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
414 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
415 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
416 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_box_domino')
417 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
418 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
419 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['next', 'left'])
420 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_basketball')
422 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(870, 490), 'left']) # close instructions
423 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
424 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(55, 50), (650, 310), 'left']) # drag a ball -.42 1.03
425 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a ball -.42 1.03
426 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
427 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
428 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_basketball')
429 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
430 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left'])
431 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(55, 50), (380, 50), 'left']) # drag a ball -4.19 4.66
432 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a ball -4.19 4.66
433 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
434 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
435 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
436 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_basketball')
437 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
438 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
439 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['next', 'left'])
440 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_domino_box_basketball')
442 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(865, 490), 'left']) # close instructions
443 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
444 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (580, 440), 'left']) # drag a box -1.4 -.78
445 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -1.4 -.78
446 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (590, 370), 'left']) # drag a piece -1.26 .2
447 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_1', 'drag_stop_1', 'left']) # drag a piece -1.26 .2
448 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
449 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
450 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_domino_box_basketball')
451 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
452 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left'])
453 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(65, 60), (580, 440), 'left']) # drag a box
454 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box
455 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(30, 60), (660, 440), 'left']) # drag a piece -.28 -.78
456 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'left']) # drag a piece -.28 -.78
457 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 425), (625, 425), 'right']) # rotate a piece -.28 -.57 -.77 -.57
458 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_2', 'drag_stop_3', 'right']) # rotate a piece -.28 -.57 -.77 -.57
459 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(660, 435), (650, 445), 'left']) # drag a piece -.28 -.85 -.42 -.85
460 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_3', 'drag_stop_4', 'left']) # drag a piece -.28 -.85 -.42 -.85
461 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
462 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
463 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
464 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_domino_box_basketball')
465 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
466 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
467 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['next', 'left'])
468 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_teeter_tooter')
470 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(870, 485), 'left']) # close instructions
471 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
472 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (490, 300), 'left']) # drag a box -2.65 1.18
473 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -2.65 1.18
474 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
475 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
476 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_teeter_tooter')
477 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
478 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left'])
479 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (490, 150), 'left']) # drag a box -2.65 3.27
480 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box -2.65 3.27
481 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(515, 115), (515, 122), 'right']) # rotate a box -2.3 3.75 -2.5 3.66
482 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'right']) # rotate a box -2.3 3.75 -2.5 3.66
483 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
484 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
485 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
486 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_teeter_tooter')
487 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
488 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(735, 450), 'left']) # next
489 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['next', 'left'])
490 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'scene_teeter_domino_box_basketball')
492 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(930, 485), 'left']) # close instructions
493 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
494 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (155, 180), 'left']) # drag a box -7.33 4.24
495 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_0', 'left']) # drag a box -7.33 4.24
496 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
497 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
498 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'fail_teeter_domino_box_basketball')
499 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 450), 'left']) # replay
500 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['replay', 'left'])
501 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(60, 60), (170, 80), 'left']) # drag a box -7.12 4.24
502 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_0', 'drag_stop_1', 'left']) # drag a box -7.12 4.24
503 #await self._event(FunctionalTest.drag_time, 'mousedrag', [(195, 50), (195, 80), 'right']) # rotate a box -6.77 4.66 -6.77 4.24
504 await self
._event
(FunctionalTest
.drag_time
, 'mousedrag', ['drag_start_1', 'drag_stop_2', 'right']) # rotate a box -6.77 4.66 -6.77 4.24
505 await self
._enforce
_result
(FunctionalTest
.evt_time
, 'win')
506 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(1340, 740), 'left']) # play
507 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['right', 'left'])
508 await self
._screenshot
(16 + FunctionalTest
.screenshot_time
, 'win_teeter_domino_box_basketball')
509 await self
._enforce
_result
(FunctionalTest
.evt_time
, '')
510 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(630, 450), 'left']) # home
511 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['home_win', 'left'])
512 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'home_from_play')
514 async def _do_screenshots_exit(self
):
515 await self
._verify
(FunctionalTest
.evt_time
)
516 #await self._event(FunctionalTest.evt_time, 'mouseclick', [(680, 600), 'left'])
517 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['exit', 'left'])
518 await self
._exit
(FunctionalTest
.evt_time
)
520 async def _do_screenshots_2(self
):
521 info('_do_screenshots_2')
522 await self
._screenshot
(FunctionalTest
.start_time
, 'main_menu_2')
523 await self
._do
_screenshots
_restore
_options
()
524 await self
._do
_screenshots
_play
()
525 await self
._do
_screenshots
_exit
()
527 async def _do_screenshots_editor(self
):
528 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['play', 'left'])
529 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['domino', 'left'])
530 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['close_instructions', 'left'])
531 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['wrench', 'left'])
532 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene')
533 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['collapse_button_scene', 'left'])
534 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_collapsed')
535 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['collapse_button_scene', 'left'])
536 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_expanded')
537 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_save', 'left'])
538 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_save')
539 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_scene_filename', 'left'])
540 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
541 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_filename_changed')
542 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_scene_filename', 'left'])
543 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
544 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_filename_restored')
545 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_scene_name', 'left'])
546 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
547 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_name_changed')
548 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_scene_name', 'left'])
549 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
550 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_name_restored')
551 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_scene_instructions', 'left'])
552 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return', 'BackSpace', 'BackSpace', 'BackSpace', 'BackSpace'])
553 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_sorting', 'left'])
554 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting')
555 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_sorting_text', 'left'])
556 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
557 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting_changed')
558 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_sorting_text', 'left'])
559 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'BackSpace'])
560 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting_restored')
561 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['collapse_button_sorting', 'left'])
562 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting_collapsed')
563 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['collapse_button_sorting', 'left'])
564 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting_expanded')
565 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_sorting_save', 'left'])
566 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting_save')
567 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_sorting_close', 'left'])
568 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_sorting_closed')
569 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start', 'left'])
570 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start')
571 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_class', 'left'])
572 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_start_class')
573 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['start_class_box', 'left'])
574 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_start_class_box')
575 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_strategy', 'left'])
576 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_start_strategy')
577 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['start_strategy_upstrategy', 'left'])
578 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_start_strategy_up')
579 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_count', 'left'])
580 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['0', 'Return'])
581 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_count_modified')
582 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_count', 'left'])
583 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
584 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_count_restored')
585 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_scale', 'left'])
586 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
587 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_scale_modified')
588 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_scale', 'left'])
589 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
590 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_scale_restored')
591 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_mass', 'left'])
592 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
593 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_mass_modified')
594 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_mass', 'left'])
595 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
596 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_mass_restored')
597 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_restitution', 'left'])
598 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
599 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_restitution_modifed')
600 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_restitution', 'left'])
601 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
602 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_restitution_restored')
603 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_friction', 'left'])
604 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
605 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_friction_modified')
606 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_friction', 'left'])
607 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
608 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_friction_restored')
609 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_id', 'left'])
610 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
611 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_id_modified')
612 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_id', 'left'])
613 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
614 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_id_restored')
615 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_strategy_args', 'left'])
616 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
617 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_strategy_args_modified')
618 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_strategy_args', 'left'])
619 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
620 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_strategy_args_restored')
621 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_save', 'left'])
622 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_save')
623 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_next', 'left'])
624 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_next')
625 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_new', 'left'])
626 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_new')
627 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_delete', 'left'])
628 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_delete')
629 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_start_close', 'left'])
630 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_start_close')
631 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_new', 'left'])
632 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['collapse_button_scene', 'left'])
633 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['test_piece', 'left'])
634 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_strategy', 'left'])
635 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_inspector_strategy')
636 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['inspector_strategy_upstrategy', 'left'])
637 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_inspector_strategy_up')
638 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_position', 'left'])
639 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
640 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_position_modified')
641 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_position', 'left'])
642 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
643 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_position_restored')
644 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_roll', 'left'])
645 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
646 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_roll_modified')
647 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_roll', 'left'])
648 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
649 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_roll_restored')
650 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_scale', 'left'])
651 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
652 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_scale_modified')
653 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_scale', 'left'])
654 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
655 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_scale_restored')
656 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_mass', 'left'])
657 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
658 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_mass_modified')
659 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_mass', 'left'])
660 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
661 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_mass_restored')
662 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_restitution', 'left'])
663 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
664 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_restitution_modifed')
665 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_restitution', 'left'])
666 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
667 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_restitution_restored')
668 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_friction', 'left'])
669 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
670 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_friction_modified')
671 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_friction', 'left'])
672 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
673 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_friction_restored')
674 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_id', 'left'])
675 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
676 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_id_modified')
677 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_id', 'left'])
678 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
679 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_id_restored')
680 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_strategy_args', 'left'])
681 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
682 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_strategy_args_modified')
683 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_strategy_args', 'left'])
684 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
685 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_strategy_args_restored')
686 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_delete', 'left'])
687 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_delete')
688 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_close', 'left'])
689 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_close')
690 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['drag_stop_0', 'left'])
691 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_test_position', 'left'])
692 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['1', 'Return'])
693 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_test_position_modified')
694 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_test_position', 'left'])
695 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'Return'])
696 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_test_position_restored')
697 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_test_id', 'left'])
698 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['a', 'b', 'c', 'Return'])
699 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_test_id_modified')
700 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_test_id', 'left'])
701 await self
._event
(FunctionalTest
.evt_time
, 'keyboard', ['BackSpace', 'BackSpace', 'BackSpace', 'Return'])
702 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_test_id_restored')
703 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_test_delete', 'left'])
704 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_test_delete')
705 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_inspector_test_close', 'left'])
706 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_inspector_test_close')
707 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_new')
708 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['wrench', 'left'])
709 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_new_item', 'left'])
710 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_new_item')
711 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['new_item_box', 'left'])
712 await self
._screenshot
(FunctionalTest
.screenshot_time
, 'editor_new_item')
713 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['editor_close', 'left'])
714 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_close')
715 await self
._screenshot
(FunctionalTest
.start_time
, 'editor_scene_new')
716 await self
._event
(FunctionalTest
.evt_time
, 'mouseclick', ['home', 'left'])
717 await self
._screenshot
(FunctionalTest
.start_time
, 'home_from_editor')
719 async def _do_screenshots_3(self
):
720 info('_do_screenshots_3')
721 await self
._screenshot
(FunctionalTest
.start_time
, 'main_menu_3')
722 await self
._do
_screenshots
_editor
()
723 await self
._do
_screenshots
_exit
()
725 def _do_screenshots(self
, idx
):
727 [self
._do
_screenshots
_1, self
._do
_screenshots
_2, self
._do
_screenshots
_3][int(idx
) - 1]()
731 class TestApp(ShowBase
):
734 ShowBase
.__init
__(self
)
735 offset
= int(argv
[2]) if len(argv
) >= 3 else 0
736 FunctionalTest(int(argv
[1]), offset
)