Fix: Ensure exiting assignment report

This commit is contained in:
Zebartin 2023-09-28 17:35:25 +08:00
parent 23b210d820
commit f791265a4b
4 changed files with 8 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -58,10 +58,10 @@ ENTRY_LOADED = ButtonWrapper(
name='ENTRY_LOADED',
share=Button(
file='./assets/share/assignment/ui/ENTRY_LOADED.png',
area=(467, 235, 498, 619),
search=(447, 215, 518, 639),
color=(217, 214, 205),
button=(467, 235, 498, 619),
area=(474, 161, 491, 615),
search=(454, 141, 511, 635),
color=(197, 193, 186),
button=(474, 161, 491, 615),
),
)
EXP_MATERIALS_CREDITS_CHECK = ButtonWrapper(

View File

@ -80,9 +80,11 @@ class AssignmentClaim(AssignmentDispatch):
logger.info('Assignment report is closed')
break
# Close report
if self.appear(REPORT, interval=2):
if self.appear(REPORT, interval=1):
self.device.click(click_button)
continue
# Ensure report totally disappears
self._wait_until_entry_loaded()
def _is_duration_expected(self, duration: int) -> bool:
"""

View File

@ -196,8 +196,7 @@ class AssignmentUI(UI):
if timeout.reached():
logger.warning('Wait entry loaded timeout')
break
# Maybe not reliable
if self.image_color_count(ENTRY_LOADED, (35, 35, 35)):
if self.image_color_count(ENTRY_LOADED, (35, 35, 35), count=800):
logger.info('Entry loaded')
break