diff --git a/pkgs/development/python-modules/pytest-selenium/default.nix b/pkgs/development/python-modules/pytest-selenium/default.nix new file mode 100644 index 000000000000..1cfb07705b9f --- /dev/null +++ b/pkgs/development/python-modules/pytest-selenium/default.nix @@ -0,0 +1,81 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatch-vcs, + hatchling, + pytest-base-url, + pytest-html, + pytest-mock, + pytest-variables, + pytest-xdist, + pytest, + pytestCheckHook, + pythonOlder, + requests, + selenium, + tenacity, +}: + +buildPythonPackage rec { + pname = "pytest-selenium"; + version = "4.1.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = "pytest-selenium"; + rev = "refs/tags/${version}"; + hash = "sha256-fIyos73haqTAgp5WVvMwJswQAtXnsnUeXKjPweXLGRM="; + }; + + build-system = [ + hatch-vcs + hatchling + ]; + + buildInput = [ pytest ]; + + dependencies = [ + pytest-base-url + pytest-html + pytest-variables + requests + selenium + tenacity + ]; + + nativeCheckInputs = [ + pytest-mock + pytest-xdist + pytestCheckHook + ]; + + pythonImportsCheck = [ "pytest_selenium" ]; + + disabledTests = [ + # Tests require additional setup and/or network features + "test_driver_quit" + "test_driver_retry_pass" + "test_event_listening_webdriver" + "test_invalid_credentials_env" + "test_invalid_credentials_file" + "test_invalid_host" + "test_launch_case_insensitive" + "test_launch" + "test_options" + "test_preferences_marker" + "test_profile" + "test_xdist" + ]; + + meta = { + description = "Plugin for running Selenium with pytest"; + homepage = "https://github.com/pytest-dev/pytest-selenium"; + changelog = "https://github.com/pytest-dev/pytest-selenium/releases/tag/${version}"; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 25207c9c143e..460034bbc77c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12611,6 +12611,8 @@ self: super: with self; { pytest-responses = callPackage ../development/python-modules/pytest-responses { }; + pytest-selenium = callPackage ../development/python-modules/pytest-selenium { }; + pytest-server-fixtures = callPackage ../development/python-modules/pytest-server-fixtures { }; pytest-services = callPackage ../development/python-modules/pytest-services { };