2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
2022-11-21 17:40:18 +00:00
|
|
|
, certifi
|
2020-04-24 23:36:52 +00:00
|
|
|
, 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";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "4.8.0";
|
2022-11-21 17:40:18 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SeleniumHQ";
|
|
|
|
repo = "selenium";
|
2022-10-21 18:38:19 +00:00
|
|
|
# check if there is a newer tag with or without -python suffix
|
|
|
|
rev = "refs/tags/selenium-${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
hash = "sha256-YTi6SNtTWuEPlQ3PTeis9osvtnWmZ7SRQbne9fefdco=";
|
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-11-21 17:40:18 +00:00
|
|
|
certifi
|
2022-06-26 10:26:21 +00:00
|
|
|
trio
|
|
|
|
trio-websocket
|
|
|
|
urllib3
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ urllib3.optional-dependencies.socks;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-26 10:26:21 +00:00
|
|
|
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;
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ jraygauthier SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|