ya2 · news · projects · code · about

gettext: --no-location
[pmachines.git] / tests / functional_test.py
CommitLineData
361d3942
FC
1from panda3d.core import load_prc_file_data
2load_prc_file_data('', 'window-type none')
a6f7e35d 3import sys
361d3942 4from time import sleep
c991401b 5from os import system
158b04a8 6from xmlrpc.client import ServerProxy
361d3942 7from sys import exit, argv
361d3942 8from direct.showbase.ShowBase import ShowBase
a33967c7
FC
9import asyncio
10import xmlrpc
a6f7e35d 11from logging import basicConfig, debug, info, DEBUG, getLogger, StreamHandler
e5b1e7e0
FC
12
13
14basicConfig(level=DEBUG, format='(evt-test) %(asctime)s.%(msecs)03d %(message)s', datefmt='%H:%M:%S')
15getLogger().setLevel(DEBUG) # it doesn't work otherwise
0af5e552 16getLogger().addHandler(StreamHandler(sys.stdout))
361d3942
FC
17
18
aed9737a 19class FunctionalTest:
361d3942 20
a33967c7
FC
21 screenshot_time = 2.0
22 evt_time = 2.0
23 drag_time = 2.0
361d3942
FC
24 start_time = 2
25
68f6c184 26 def __init__(self, idx, offset):
a33967c7 27 debug('creating FunctionalTest (%s)' % id(self))
361d3942 28 super().__init__()
e5b1e7e0 29
0af5e552
FC
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):
34 # makedirs(path)
35 # lpath = path + 'evt_%s.log' % timestamp
36 # fileHandler = FileHandler(lpath)
37 # fileHandler.setFormatter(logFormatter)
38 # getLogger().addHandler(fileHandler)
e5b1e7e0 39
361d3942 40 info('test idx: %s' % idx)
68f6c184 41 self._offset = offset
0c36d0bf
FC
42 info(str(sys.argv))
43 sleep(int(sys.argv[2]) if len(sys.argv) >= 3 else 12)
a33967c7 44 self._proxy = ServerProxy('http://localhost:7000')
361d3942
FC
45 self._curr_time = 0
46 self._tasks = []
47 self._prev_time = 0
a33967c7 48 #taskMgr.add(self.on_frame_unpausable, 'on-frame-unpausable')
d68aeda7 49 self._proxy.set_index(idx)
361d3942
FC
50 self._do_screenshots(idx)
51
52 def _do_screenshot(self, name):
c991401b 53 # time = datetime.datetime.now().strftime('%y%m%d%H%M%S')
361d3942 54 name = name + '.png'
158b04a8 55 self._proxy.screenshot(name)
361d3942
FC
56 info('screenshot %s' % name)
57
a33967c7
FC
58 async def _screenshot(self, time, name):
59 #self._tasks += [(
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)
361d3942 66
a33967c7
FC
67 async def __mouse_click(self, tgt, btn):
68 await asyncio.sleep(.5)
2e5f0efc
FC
69 offset_x = int((1920 - 1360) / 2) #+ 1 # xfce decorations
70 offset_y = int((1080 - 768) / 2) #+ 24 + self._offset # xfce decorations
361d3942 71 btn = 3 if btn == 'right' else 1
d68aeda7 72 pos = self._proxy.get_position(tgt)
361d3942 73 system('xdotool mousemove %s %s' % (offset_x + pos[0], offset_y + pos[1]))
a33967c7
FC
74 #def click(task):
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)
361d3942 80
a33967c7
FC
81 async def __mouse_drag(self, start, end, btn):
82 await asyncio.sleep(.5)
2e5f0efc
FC
83 offset_x = int((1920 - 1360) / 2) #+ 1 # xfce decorations
84 offset_y = int((1080 - 768) / 2) #+ 24 + self._offset # xfce decorations
361d3942 85 btn = 3 if btn == 'right' else 1
d68aeda7
FC
86 start = self._proxy.get_position(start)
87 end = self._proxy.get_position(end)
361d3942 88 system('xdotool mousemove %s %s' % (offset_x + start[0], offset_y + start[1]))
a33967c7
FC
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]))
99 # def mouseup(task):
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')
361d3942 104
3466af49
FC
105 async def __emulate_keys(self, keys):
106 await asyncio.sleep(.4)
107 for k in keys:
108 await asyncio.sleep(.3)
109 system(f'xdotool key {k}')
110
a33967c7
FC
111 async def _event(self, time, evt, mouse_args=None):
112 await asyncio.sleep(time)
361d3942 113 if evt == 'mouseclick':
a33967c7
FC
114 #cback = lambda: self.__mouse_click(*mouse_args)
115 await self.__mouse_click(*mouse_args)
361d3942 116 elif evt == 'mousedrag':
a33967c7
FC
117 #cback = lambda: self.__mouse_drag(*mouse_args)
118 await self.__mouse_drag(*mouse_args)
3466af49
FC
119 elif evt == 'keyboard':
120 #cback = lambda: self.__mouse_drag(*mouse_args)
121 await self.__emulate_keys(mouse_args)
a33967c7
FC
122 #self._tasks += [(
123 # self._curr_time + time,
124 # cback,
125 # 'event: %s' % evt)]
126 #self._curr_time += time
361d3942 127
d68aeda7 128 async def _enforce_result(self, time, res):
a33967c7 129 await asyncio.sleep(time)
d68aeda7 130 self._proxy.enforce_result(res)
a33967c7 131 #def cback():
d68aeda7
FC
132 # self._proxy.enforce_result(res)
133 # info('enforce_result %s' % res)
a33967c7
FC
134 #self._tasks += [(
135 # self._curr_time + time,
136 # cback,
137 # 'enforce res: %s' % res)]
138 #self._curr_time += time
361d3942 139
a33967c7
FC
140 async def _enforce_resolution(self, time, res):
141 await asyncio.sleep(time)
142 self._proxy.enforce_resolution(res)
143 #def cback():
144 # self._proxy.enforce_resolution(res)
145 # info('enforce_resolution %s (send)' % res)
146 #self._tasks += [(
147 # self._curr_time + time,
148 # cback,
149 # 'enforce resolution: %s' % res)]
150 #self._curr_time += time
74ed9732 151
a33967c7
FC
152 async def _verify(self, time):
153 await asyncio.sleep(time)
154 self._proxy.verify()
155 info('verify')
156 #def __verify():
157 # self._proxy.verify()
158 # info('verify')
159 #self._tasks += [(
160 # self._curr_time + 3,
161 # lambda: __verify(),
162 # 'verify')]
163 #self._curr_time += 3
361d3942 164
a33967c7
FC
165 async def _exit(self, time):
166 await asyncio.sleep(time)
167 try:
158b04a8 168 self._proxy.close()
a33967c7
FC
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))
172 exit()
173 #def do_exit():
174 # try:
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))
179 # exit()
180 #self._tasks += [(
181 # self._curr_time + 3,
182 # lambda: do_exit(),
183 # 'exit')]
361d3942 184
a33967c7
FC
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]))
190 # tsk[1]()
191 # self._prev_time = globalClock.getFrameTime() # self.eng.event.unpaused_time
192 # return task.cont
361d3942 193
a33967c7 194 async def _do_screenshots_1(self):
361d3942 195 info('_do_screenshots_1')
a33967c7
FC
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()
361d3942 200
a33967c7
FC
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')
361d3942 208
a33967c7
FC
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')
361d3942 213 # languages
a33967c7
FC
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')
361d3942 220 # volume
a33967c7
FC
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')
361d3942 224 # antialiasing
a33967c7
FC
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')
361d3942 228 # shadows
a33967c7
FC
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')
361d3942 232 # test aa and shadows
a33967c7
FC
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
361d3942 244
a33967c7
FC
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')
361d3942 249 # languages
a33967c7
FC
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')
361d3942 256 # volume
a33967c7
FC
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')
361d3942
FC
260 # fullscreen
261 # the first one is because of the windowed mode in test
a33967c7
FC
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')
361d3942 272 # resolution
a33967c7
FC
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')
361d3942 287 # antialiasing
a33967c7
FC
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')
361d3942 291 # shadows
a33967c7
FC
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'])
361d3942 297
a33967c7
FC
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
d68aeda7 361 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 365 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
361d3942 369 # scene 2
a33967c7
FC
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
d68aeda7 387 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 391 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
361d3942 395 # scene 3
a33967c7
FC
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
d68aeda7 411 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 415 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
361d3942 419 # scene 4
a33967c7
FC
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
d68aeda7 431 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 435 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
361d3942 439 # scene 5
a33967c7
FC
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
d68aeda7 459 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 463 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
39a6176f 467 # scene 6
a33967c7
FC
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
d68aeda7 481 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 485 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
39a6176f 489 # scene 7
a33967c7
FC
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
d68aeda7 503 await self._enforce_result(FunctionalTest.evt_time, 'win')
a33967c7
FC
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')
d68aeda7 507 await self._enforce_result(FunctionalTest.evt_time, '')
a33967c7
FC
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')
361d3942 511
a33967c7
FC
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)
361d3942 517
a33967c7 518 async def _do_screenshots_2(self):
361d3942 519 info('_do_screenshots_2')
a33967c7
FC
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()
361d3942 524
3466af49
FC
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')
72d7f4c5
FC
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')
3466af49
FC
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')
9b00776a 559 await self._event(FunctionalTest.evt_time, 'mouseclick', ['collapse_button_scene', 'left'])
3466af49
FC
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')
9b00776a 574 await self._event(FunctionalTest.evt_time, 'mouseclick', ['collapse_button_scene', 'left'])
3466af49
FC
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')
9b00776a 637 #await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_new', 'left'])
3466af49
FC
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')
2dec6110 713 await self._event(FunctionalTest.evt_time, 'mouseclick', ['collapse_button_scene', 'left'])
3466af49
FC
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'])
2dec6110 719 await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_save_dialog_yes', 'left'])
3466af49 720 await self._screenshot(FunctionalTest.start_time, 'editor_close')
2dec6110
FC
721 await self._event(FunctionalTest.evt_time, 'mouseclick', ['wrench', 'left'])
722 await self._event(FunctionalTest.evt_time, 'mouseclick', ['editor_new', 'left'])
3466af49
FC
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')
726
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()
732
361d3942 733 def _do_screenshots(self, idx):
a33967c7 734 asyncio.run(
3466af49 735 [self._do_screenshots_1, self._do_screenshots_2, self._do_screenshots_3][int(idx) - 1]()
a33967c7 736 )
361d3942
FC
737
738
739class TestApp(ShowBase):
740
741 def __init__(self):
742 ShowBase.__init__(self)
68f6c184 743 offset = int(argv[2]) if len(argv) >= 3 else 0
c991401b 744 FunctionalTest(int(argv[1]), offset)
361d3942
FC
745
746
747TestApp().run()