2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, playwright
|
2023-04-29 16:46:19 +00:00
|
|
|
, playwright-driver
|
2023-01-11 07:51:40 +00:00
|
|
|
, pytest
|
|
|
|
, pytest-base-url
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-slugify
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools-scm
|
|
|
|
, django
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-playwright";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.5.0";
|
2023-01-11 07:51:40 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "microsoft";
|
|
|
|
repo = "playwright-pytest";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-HS0Qpr5R4dAoXe0bpPGU7JABB7CmwugReRD75XeJ8l4=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
export PLAYWRIGHT_BROWSERS_PATH=${playwright-driver.browsers}
|
2023-01-11 07:51:40 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
|
|
|
changelog = "https://github.com/microsoft/playwright-pytest/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ sephi ];
|
|
|
|
};
|
|
|
|
}
|