summaryrefslogtreecommitdiff
path: root/.local/bin/development/ipytest
blob: 17a5a557e1bcaa14070290aa2ad070aad4f0ab37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)
"