2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, geckodriver
|
2022-06-26 10:26:21 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, trio
|
|
|
|
, trio-websocket
|
2020-04-24 23:36:52 +00:00
|
|
|
, urllib3
|
2021-05-20 23:08:51 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "selenium";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "4.2.0";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SeleniumHQ";
|
|
|
|
repo = "selenium";
|
|
|
|
rev = "selenium-${version}"; # check if there is a newer tag with -python suffix
|
|
|
|
sha256 = "sha256-KhBCMsWGRD7hJqumA1+K8AVhJ7hq26XkEa1QbgY0Q0w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace py/selenium/webdriver/firefox/service.py \
|
|
|
|
--replace 'DEFAULT_EXECUTABLE_PATH = "geckodriver"' 'DEFAULT_EXECUTABLE_PATH = "${geckodriver}/bin/geckodriver"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd py
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
trio
|
|
|
|
trio-websocket
|
|
|
|
urllib3
|
|
|
|
] ++ urllib3.optional-dependencies.secure
|
|
|
|
++ urllib3.optional-dependencies.socks;
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru.tests = {
|
2021-07-04 02:40:35 +00:00
|
|
|
testing-vaultwarden = nixosTests.vaultwarden;
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-06-26 10:26:21 +00:00
|
|
|
description = "Bindings for Selenium WebDriver";
|
|
|
|
homepage = "https://selenium.dev/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jraygauthier ];
|
|
|
|
};
|
|
|
|
}
|