2022-12-23 14:31:22 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, playwright
|
|
|
|
, pytest
|
|
|
|
, pytest-base-url
|
|
|
|
, pytestCheckHook
|
|
|
|
, python-slugify
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools-scm
|
|
|
|
, django
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-playwright";
|
|
|
|
version = "0.3.0";
|
2023-01-10 14:22:49 +01:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-12-23 14:31:22 +01:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "microsoft";
|
|
|
|
repo = "playwright-pytest";
|
2023-01-10 14:22:49 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-23 14:31:22 +01:00
|
|
|
hash = "sha256-fHzQxbQBSEkCFu/ualjzSmIt3SiEa2ktTvIJKPZLT9Q=";
|
|
|
|
};
|
|
|
|
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2023-01-10 14:22:49 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2022-12-23 14:31:22 +01:00
|
|
|
|
2023-01-10 14:22:49 +01:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
2022-12-23 14:31:22 +01:00
|
|
|
|
2023-01-10 14:22:49 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
playwright
|
|
|
|
pytest-base-url
|
|
|
|
python-slugify
|
|
|
|
];
|
2022-12-23 14:31:22 +01:00
|
|
|
|
|
|
|
# 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}
|
|
|
|
'';
|
|
|
|
|
2023-01-10 14:22:49 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pytest_playwright"
|
|
|
|
];
|
2022-12-23 14:31:22 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Pytest plugin to write end-to-end browser tests with Playwright";
|
|
|
|
homepage = "https://github.com/microsoft/playwright-pytest";
|
2023-01-10 14:22:49 +01:00
|
|
|
changelog = "https://github.com/microsoft/playwright-pytest/releases/tag/v${version}";
|
2022-12-23 14:31:22 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ sephi ];
|
|
|
|
};
|
|
|
|
}
|