Revision e1282a63
Added by koszko almost 2 years ago
test/unit/conftest.py | ||
---|---|---|
78 | 78 |
|
79 | 79 |
def _execute_in_page_context(driver, script, args): |
80 | 80 |
script = script + '\n;\nwindow.haketilo_selenium_exception = false;' |
81 |
driver.loaded_scripts.append(script) |
|
81 | 82 |
try: |
82 | 83 |
return driver.execute_script(script_injecting_script, script, args) |
83 | 84 |
except Exception as e: |
84 | 85 |
import sys |
85 |
lines = enumerate(script.split('\n'), 1) |
|
86 |
for err_info in [('Failing script\n',), *lines]: |
|
87 |
print(*err_info, file=sys.stderr) |
|
86 |
|
|
87 |
print("Scripts loaded since driver's last get() method call:", |
|
88 |
file=sys.stderr) |
|
89 |
|
|
90 |
for script in driver.loaded_scripts: |
|
91 |
lines = enumerate(script.split('\n'), 1) |
|
92 |
for err_info in [('===',), *lines]: |
|
93 |
print(*err_info, file=sys.stderr) |
|
88 | 94 |
|
89 | 95 |
raise e from None |
90 | 96 |
|
Also available in: Unified diff
finish implementing more efficient querying of URL patterns
The algorithm is implemented and tested. However, it is yet to be hooked into the actual extension.