1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7 urllib3,
8 selenium,
9 cssselect,
10 django,
11 flask,
12 lxml,
13 pytestCheckHook,
14 zope-testbrowser,
15}:
16
17buildPythonPackage rec {
18 pname = "splinter";
19 version = "0.21.0";
20
21 disabled = pythonOlder "3.8";
22
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "cobrateam";
27 repo = "splinter";
28 tag = version;
29 hash = "sha256-PGGql8yI1YosoUBAyDoI/8k7s4sVYnXEV7eow3GHH88=";
30 };
31
32 nativeBuildInputs = [ setuptools ];
33
34 propagatedBuildInputs = [ urllib3 ];
35
36 optional-dependencies = {
37 "zope.testbrowser" = [
38 zope-testbrowser
39 lxml
40 cssselect
41 ];
42 django = [
43 django
44 lxml
45 cssselect
46 ];
47 flask = [
48 flask
49 lxml
50 cssselect
51 ];
52 selenium = [ selenium ];
53 };
54
55 nativeCheckInputs = [
56 pytestCheckHook
57 ]
58 ++ lib.flatten (lib.attrValues optional-dependencies);
59
60 disabledTests = [
61 # driver is present and fails with a different error during loading
62 "test_browser_local_driver_not_present"
63 "test_browser_log_missing_drivers"
64 "test_local_driver_not_present"
65 ];
66
67 disabledTestPaths = [
68 "samples"
69 # We run neither Chromium nor Firefox nor ...
70 "tests/test_async_finder.py"
71 "tests/test_element_is_visible.py"
72 "tests/test_html_snapshot.py"
73 "tests/test_iframes.py"
74 "tests/test_mouse_interaction.py"
75 "tests/test_popups.py"
76 "tests/test_screenshot.py"
77 "tests/test_shadow_root.py"
78 "tests/test_webdriver.py"
79 "tests/test_webdriver_chrome.py"
80 "tests/test_webdriver_edge_chromium.py"
81 "tests/test_webdriver_firefox.py"
82 "tests/test_webdriver_remote.py"
83 ];
84
85 pythonImportsCheck = [ "splinter" ];
86
87 meta = with lib; {
88 changelog = "https://splinter.readthedocs.io/en/latest/news.html";
89 description = "Browser abstraction for web acceptance testing";
90 homepage = "https://github.com/cobrateam/splinter";
91 license = licenses.bsd3;
92 maintainers = with maintainers; [ dotlambda ];
93 };
94}