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