Closed lf2a closed 2 years ago
Describe the bug It is not waiting for the download to finish because there is no 100MB.bin.part file, Firefox creates a 100MB.<hash>.bin.part file
100MB.bin.part
100MB.<hash>.bin.part
https://github.com/botcity-dev/botcity-framework-web-python/blob/b62372c68b8212519eb20093dfabbfb1287f36e9/botcity/web/bot.py#L2001
Expected behavior Wait for the download to finish and the .part file to be deleted.
Steps to Reproduce
from botcity.web import WebBot, Browser, By, browsers from webdriver_manager.firefox import GeckoDriverManager web = WebBot() web.driver_path = GeckoDriverManager().install() web.browser = Browser.FIREFOX web.headless = False web.browse("https://speed.hetzner.de/") element = web.find_element(by=By.XPATH, selector="/html/body/p[1]/a") element.click() self.wait(2_000) if not web.wait_for_file('/home/luiz/Downloads/100MB.bin', 5_000): print('tiemout')
Possible Solution It could be checked if the file has more than 0 bytes.
My Platform
botcity-framework-core>=0.2.9 botcity-framework-web>=0.5.2 botcity-maestro-sdk>=0.1.5 webdriver-manager==3.5.4
Describe the bug It is not waiting for the download to finish because there is no
100MB.bin.part
file, Firefox creates a100MB.<hash>.bin.part
filehttps://github.com/botcity-dev/botcity-framework-web-python/blob/b62372c68b8212519eb20093dfabbfb1287f36e9/botcity/web/bot.py#L2001
Expected behavior Wait for the download to finish and the .part file to be deleted.
Steps to Reproduce
Possible Solution It could be checked if the file has more than 0 bytes.
My Platform