MCPcopy Index your code
hub / github.com/RustPython/RustPython / wdriver

Function wdriver

wasm/tests/conftest.py:93–115  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

91
92@pytest.fixture
93def 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()

Callers

nothing calls this directly

Calls 7

_print_panicMethod · 0.95
DriverClass · 0.85
OptionsClass · 0.50
printFunction · 0.50
add_argumentMethod · 0.45
getMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected