diff options
Diffstat (limited to '.local/bin/development/ipytest')
-rwxr-xr-x | .local/bin/development/ipytest | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.local/bin/development/ipytest b/.local/bin/development/ipytest new file mode 100755 index 0000000..17a5a55 --- /dev/null +++ b/.local/bin/development/ipytest @@ -0,0 +1,23 @@ +#!/bin/sh +# create a 'dev' firefox profile and use it in selenium + +[ -z "$FF_DEV_PROFILE" ] && [ -d ~/.librewolf ] && + FF_DEV_PROFILE="$(find ~/.librewolf/ -maxdepth 1 -type d -name '????????.dev')" + +[ -z "$FF_DEV_PROFILE" ] && [ -d ~/.librewolf ] && + FF_DEV_PROFILE="$(find ~/.mozilla/ -maxdepth 1 -type d -name '????????.dev')" + +ipy -i -c " +from selenium import webdriver +from selenium.webdriver.common.by import By + +options = webdriver.FirefoxOptions() +options.binary_location = '/usr/bin/librewolf' +options.profile = webdriver.FirefoxProfile(\"$FF_DEV_PROFILE\") + +d = webdriver.Firefox(options=options) +d.get(\"${1:-http://127.0.0.1}\") + +import atexit +atexit.register(d.quit) +" |