Pixelfed on Firefox

This commit is contained in:
Nicolas Jeannerod 2024-11-26 15:28:31 +01:00
parent 1f67866982
commit 8e001c5dc6
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8

View file

@ -17,17 +17,16 @@ let
import sys import sys
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options from selenium.webdriver.firefox.options import Options
''; '';
seleniumSetup = '' seleniumSetup = ''
print("Create and configure driver...", file=sys.stderr) print("Create and configure driver...", file=sys.stderr)
options = Options() options = Options()
# options.add_argument("--headless=new") options.add_argument("--headless")
service = webdriver.ChromeService(executable_path="${lib.getExe pkgs.chromedriver}") # noqa: E501 service = webdriver.FirefoxService(executable_path="${lib.getExe pkgs.geckodriver}") # noqa: E501
driver = webdriver.Chrome(options=options, service=service) driver = webdriver.Firefox(options=options, service=service)
driver.implicitly_wait(30) driver.implicitly_wait(30)
driver.set_window_size(1280, 960)
''; '';
seleniumPixelfedLogin = '' seleniumPixelfedLogin = ''
@ -154,8 +153,8 @@ pkgs.nixosTest {
# TODO: pair down # TODO: pair down
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
python3 python3
chromium firefox-unwrapped
chromedriver geckodriver
xh xh
seleniumScriptPostPicture seleniumScriptPostPicture
seleniumScriptGetSrc seleniumScriptGetSrc
@ -168,7 +167,7 @@ pkgs.nixosTest {
## without this we get frivolous errors in the logs ## without this we get frivolous errors in the logs
MC_REGION = "garage"; MC_REGION = "garage";
}; };
# chrome does not like being run as root # Do not run Selenium scripts as root
users.users.selenium = { users.users.selenium = {
isNormalUser = true; isNormalUser = true;
}; };