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";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "0.4.3";
|
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}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-5qjfZGDM1OqXXNyj81O49ClKKGiAPdgyZZu6TgpskGs=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 = ''
|
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 ];
|
|
|
|
};
|
|
|
|
}
|