diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2022-11-21 18:43:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-21 18:43:33 +0100 |
commit | debe1b93c9ec3651fbb57060468b9f78873468c8 (patch) | |
tree | 5037a3f652c689ffaf5beec77caa8492df825e74 | |
parent | 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8 (diff) | |
parent | 6f5527487c59421a553b76e12b4d30089a48a630 (diff) |
Merge pull request #202104 from dotlambda/robotframework-seleniumlibrary-fix
4 files changed, 141 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/pytest-mockito/default.nix b/pkgs/development/python-modules/pytest-mockito/default.nix new file mode 100644 index 0000000000000..240cf44343e21 --- /dev/null +++ b/pkgs/development/python-modules/pytest-mockito/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest +, mockito +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pytest-mockito"; + version = "0.0.4"; + + format = "setuptools"; + + src = fetchFromGitHub { + owner = "kaste"; + repo = "pytest-mockito"; + rev = version; + hash = "sha256-vY/i1YV1lo4mZvnxsXBOyaq31YTiF0BY6PTVwdVX10I="; + }; + + buildInputs = [ + pytest + ]; + + propagatedBuildInputs = [ + mockito + ]; + + checkInputs = [ + pytestCheckHook + ]; + + meta = { + description = "Base fixtures for mockito"; + homepage = "https://github.com/kaste/pytest-mockito"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/robotframework-pythonlibcore/default.nix b/pkgs/development/python-modules/robotframework-pythonlibcore/default.nix new file mode 100644 index 0000000000000..01e6a98c02280 --- /dev/null +++ b/pkgs/development/python-modules/robotframework-pythonlibcore/default.nix @@ -0,0 +1,53 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, fetchpatch +, pytest-mockito +, pytestCheckHook +, robotframework +}: + +buildPythonPackage rec { + pname = "robotframework-pythonlibcore"; + version = "4.0.0"; + + disabled = pythonOlder "3.7"; + + format = "setuptools"; + + src = fetchFromGitHub { + owner = "robotframework"; + repo = "PythonLibCore"; + rev = "v${version}"; + hash = "sha256-86o5Lh9zWo4vUF2186dN7e8tTUu5PIxM/ZukPwNl0S8="; + }; + + patches = [ + (fetchpatch { + name = "fix-finding-version.patch"; + url = "https://github.com/robotframework/PythonLibCore/commit/84c73979e309f59de057ae6a77725ab0f468b71f.patch"; + hash = "sha256-zrjsNvXpJDLpXql200NV+QGWFLtnRVZTeAjT52dRn2s="; + }) + ]; + + checkInputs = [ + pytest-mockito + pytestCheckHook + robotframework + ]; + + preCheck = '' + export PYTHONPATH="atest:utest/helpers:$PYTHONPATH" + ''; + + pythonImportsCheck = [ "robotlibcore" ]; + + meta = { + changelog = "https://github.com/robotframework/PythonLibCore/blob/${src.rev}/docs/PythonLibCore-${version}.rst"; + description = "Tools to ease creating larger test libraries for Robot Framework using Python"; + homepage = "https://github.com/robotframework/PythonLibCore"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/robotframework-seleniumlibrary/default.nix b/pkgs/development/python-modules/robotframework-seleniumlibrary/default.nix index 806387f1095e5..7f08c345bc6b8 100644 --- a/pkgs/development/python-modules/robotframework-seleniumlibrary/default.nix +++ b/pkgs/development/python-modules/robotframework-seleniumlibrary/default.nix @@ -1,4 +1,16 @@ -{ stdenv, lib, buildPythonPackage, fetchFromGitHub, python, robotframework, selenium, mockito, robotstatuschecker, approvaltests }: +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, python +, robotframework +, robotframework-pythonlibcore +, selenium +, approvaltests +, pytest-mockito +, pytestCheckHook +, robotstatuschecker +}: buildPythonPackage rec { version = "6.0.0"; @@ -12,17 +24,40 @@ buildPythonPackage rec { sha256 = "1rjzz6mrx4zavcck2ry8269rf3dkvvs1qfa9ra7dkppbarrjin3f"; }; - propagatedBuildInputs = [ robotframework selenium ]; - checkInputs = [ mockito robotstatuschecker approvaltests ]; + propagatedBuildInputs = [ + robotframework + robotframework-pythonlibcore + selenium + ]; - # Only execute Unit Tests. Acceptance Tests require headlesschrome, currently - # not available in nixpkgs - checkPhase = '' - ${python.interpreter} utest/run.py - ''; + checkInputs = [ + approvaltests + pytest-mockito + pytestCheckHook + robotstatuschecker + ]; + + disabledTestPaths = [ + # https://github.com/robotframework/SeleniumLibrary/issues/1804 + "utest/test/keywords/test_webdrivercache.py" + ]; + + disabledTests = [ + "test_create_opera_executable_path_not_set" + "test_create_opera_executable_path_set" + "test_create_opera_with_options" + "test_create_opera_with_service_log_path_real_path" + "test_get_executable_path" + "test_get_ff_profile_instance_FirefoxProfile" + "test_has_options" + "test_importer" + "test_log_file_with_index_exist" + "test_opera" + "test_single_method" + ]; meta = with lib; { - broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin; + changelog = "https://github.com/robotframework/SeleniumLibrary/blob/${src.rev}/docs/SeleniumLibrary-${version}.rst"; description = "Web testing library for Robot Framework"; homepage = "https://github.com/robotframework/SeleniumLibrary"; license = licenses.asl20; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dd1dca64c91ca..b05da5787304d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7059,6 +7059,8 @@ self: super: with self; { pysyncthru = callPackage ../development/python-modules/pysyncthru { }; + pytest-mockito = callPackage ../development/python-modules/pytest-mockito { }; + python-codon-tables = callPackage ../development/python-modules/python-codon-tables { }; python-crfsuite = callPackage ../development/python-modules/python-crfsuite { }; @@ -9812,6 +9814,8 @@ self: super: with self; { robotframework-databaselibrary = callPackage ../development/python-modules/robotframework-databaselibrary { }; + robotframework-pythonlibcore = callPackage ../development/python-modules/robotframework-pythonlibcore { }; + robotframework-requests = callPackage ../development/python-modules/robotframework-requests { }; robotframework-selenium2library = callPackage ../development/python-modules/robotframework-selenium2library { }; |