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