From 195eb9e77836b894667571c5bedd67c4c2d30989 Mon Sep 17 00:00:00 2001 From: Sylvain Fankhauser Date: Fri, 23 Dec 2022 14:31:22 +0100 Subject: [PATCH] python3Packages.pytest-playwright: init at 0.3.0 --- .../pytest-playwright/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-playwright/default.nix diff --git a/pkgs/development/python-modules/pytest-playwright/default.nix b/pkgs/development/python-modules/pytest-playwright/default.nix new file mode 100644 index 000000000000..033205af05b4 --- /dev/null +++ b/pkgs/development/python-modules/pytest-playwright/default.nix @@ -0,0 +1,51 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +, playwright +, pytest +, pytest-base-url +, pytestCheckHook +, python-slugify +, pythonOlder +, setuptools-scm +, python +, django +}: + +buildPythonPackage rec { + pname = "pytest-playwright"; + version = "0.3.0"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "playwright-pytest"; + rev = "v${version}"; + hash = "sha256-fHzQxbQBSEkCFu/ualjzSmIt3SiEa2ktTvIJKPZLT9Q="; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ setuptools-scm ]; + + buildInputs = [ pytest ]; + + propagatedBuildInputs = [ playwright pytest-base-url python-slugify ]; + + # Most of the tests rely on network access, or on unavailable browsers such as + # msedge, chrome or webkit + doCheck = false; + + preCheck = '' + export PLAYWRIGHT_BROWSERS_PATH=${playwright.browsers} + ''; + + pythonImportsCheck = [ "pytest_playwright" ]; + + meta = with lib; { + description = "Pytest plugin to write end-to-end browser tests with Playwright"; + homepage = "https://github.com/microsoft/playwright-pytest"; + license = licenses.asl20; + maintainers = with maintainers; [ sephi ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2cb9f5396f70..38103581da5a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8924,6 +8924,8 @@ self: super: with self; { pytest-param-files = callPackage ../development/python-modules/pytest-param-files { }; + pytest-playwright = callPackage ../development/python-modules/pytest-playwright {}; + pytest-plt = callPackage ../development/python-modules/pytest-plt { }; pytest-pylint = callPackage ../development/python-modules/pytest-pylint { };