mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-05 14:22:33 +00:00
fix(tests): avoid race condition when generating UI test screenshots
This commit is contained in:
parent
b1e4246b46
commit
c233b796df
@ -99,13 +99,18 @@ def screen_recording(client, request):
|
|||||||
try:
|
try:
|
||||||
client.debug.start_recording(str(screen_path))
|
client.debug.start_recording(str(screen_path))
|
||||||
yield
|
yield
|
||||||
if test_ui == "record":
|
|
||||||
_process_recorded(screen_path, test_name)
|
|
||||||
else:
|
|
||||||
_process_tested(screens_test_path, test_name)
|
|
||||||
finally:
|
finally:
|
||||||
|
# Wait for response to Initialize, which gives the emulator time to catch up
|
||||||
|
# and redraw the homescreen. Otherwise there's a race condition between that
|
||||||
|
# and stopping recording.
|
||||||
|
client.init_device()
|
||||||
client.debug.stop_recording()
|
client.debug.stop_recording()
|
||||||
|
|
||||||
|
if test_ui == "record":
|
||||||
|
_process_recorded(screen_path, test_name)
|
||||||
|
else:
|
||||||
|
_process_tested(screens_test_path, test_name)
|
||||||
|
|
||||||
|
|
||||||
def list_missing():
|
def list_missing():
|
||||||
return set(FILE_HASHES.keys()) - PROCESSED
|
return set(FILE_HASHES.keys()) - PROCESSED
|
||||||
|
Loading…
Reference in New Issue
Block a user