(request)
| 91 | |
| 92 | @pytest.fixture |
| 93 | def wdriver(request): |
| 94 | options = Options() |
| 95 | options.add_argument("-headless") |
| 96 | driver = Driver(options=options) |
| 97 | try: |
| 98 | driver.get(f"http://localhost:{PORT}") |
| 99 | WebDriverWait(driver, 5).until( |
| 100 | EC.presence_of_element_located((By.ID, "rp_loaded")) |
| 101 | ) |
| 102 | except JavascriptException: |
| 103 | driver._print_panic() |
| 104 | driver.quit() |
| 105 | raise |
| 106 | except Exception as e: |
| 107 | print(f"Error waiting for page to load: {e}") |
| 108 | # Check the page source to see what's loaded |
| 109 | print("Page source:", driver.page_source[:500]) |
| 110 | driver.quit() |
| 111 | raise |
| 112 | |
| 113 | yield driver |
| 114 | |
| 115 | driver.quit() |
nothing calls this directly
no test coverage detected