sleep(2940) kills test

Asked by Felix

Hi there,

I'm experiencing an issue with one of my tests. It tests the playback of several youtube videos (up to 1hour each).

code:

wait(Pattern("Youtube1.png").similar(0.80))
click(Pattern("Youtube1.png").similar(0.80))
#sleep video length
#sleep(2940)
sleep(400)

It clicks on the youtube image from the bookmarks list and opens the native youtube app on iOS. I intent to make sikuli sleep until the video playback is finished, e.g. 2940 seconds. But the following code does not get executed unfortunately. I changed the value to 400 seconds and it works fine.

Any help is on this issue is highly appreciated. Thanks in advance for sharing your experience.

regards,

Felix

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Felix
Solved:
Last query:
Last reply:
Revision history for this message
Roman Podolyan (podolyan-roman) said :
#1

The simple solution I think is:

def longsleep(longtime):
 i = longtime // 400
 for j in range(i):
  sleep(400)
 sleep(longtime % 400)

longsleep(2940)

If sleeping in long interval doesn't work, may be sleeping in shorter interval do? Alas, 2940 is a bit long to test it quickly.

Revision history for this message
Felix (felix2stoll) said :
#2

thanks roman for the hint. Build my own simple longsleep function and it's working fine.