Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Why do we need time.sleep(XXX)?

Content by Label
showLabelsfalse
max5
spacesQuakeCore
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "kb-how-to-article" and type = "page" and space = "QuakeCore"
labelskb-how-to-article

...

hiddentrue


Lines 38 and 48 have time.sleep(XXX), which can be added from Selenium IDE using "pause" command, which waits for a specified number of seconds unconditionally.

Image Added

This is a simple way to fix a timing issue. For example, line 38 is necessary because "Seismic Hazard" link can be already enabled if the user comes back to the "Site Selection" tab from the "Seismic Hazard" tab. When the "Set" button is clicked, there is a very short delay before "Seismic Hazard" link gets disabled. Without the time.sleep(3), it checks that the link is active, but when it clicks the link when it has already disabled - and the test gets stuck!

At the end of the test, Pytest kills the browser. The sleep at line 48 is necessary as the test immediately exits as soon as it "clicks" the download link - no download is actually taking place.

It is certainly better to check the existence of download file and check its correctness. 

...