setup_args1.py 464 B

12345678910111213141516171819
  1. #!/usr/bin/env python3
  2. """Prepare the dashboard action-button screenshot."""
  3. import time
  4. from selenium.webdriver.common.by import By
  5. from selenium.webdriver.support.ui import WebDriverWait
  6. def _wait_for_body_attr(driver, attr, timeout=15):
  7. WebDriverWait(driver, timeout).until(
  8. lambda d: bool(d.find_element(By.TAG_NAME, "body").get_attribute(attr))
  9. )
  10. def run(driver):
  11. _wait_for_body_attr(driver, "loaded-dashboard")
  12. time.sleep(0.2)