Skip to content

Commit

Permalink
Adding the parent to the ContextNode as it provides enough info when …
Browse files Browse the repository at this point in the history
…creating correc hierarchies
  • Loading branch information
custompointofview committed Mar 13, 2024
1 parent 885cf0e commit d97e9fb
Show file tree
Hide file tree
Showing 6 changed files with 1,859 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Java Access Bridge Wrapper changelog

## 1.2.0 (date: 13.03.2024)

- Added parent Node to ContextNode - useful for creating correct hierarchies between nodes

## 1.1.0 (date: 03.10.2023)

- Add node/element refresh capability
Expand Down
1,760 changes: 1,760 additions & 0 deletions output/log.html

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions output/output.robolog
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
V 0.0.4
T 2024-03-13T11:58:55.570+00:00
ID 1|11582398-e131-11ee-ae52-0e4daf9a7381
I "sys.platform=darwin"
I "python=3.10.13 (main, Feb 12 2024, 18:19:15) [Clang 15.0.0 (clang-1500.1.0.2.5)]"
M a:"pytest"
SR a|0.002
M c:"config and collect"
M d:""
P b:c|d|d|d|0
ST b|0.002
M e:"stdout"
M f:"============================= test session starts =============================="
C e|f|0.01
M g:"\n"
C e|g|0.01
M h:"platform darwin -- Python 3.10.13, pytest-7.4.2, pluggy-1.3.0"
C e|h|0.01
C e|g|0.01
M i:"rootdir: /Users/cosminpopa/Work/RoboCorp/code/java-access-bridge-wrapper"
C e|i|0.015
C e|g|0.015
M j:"plugins: robocorp-log-pytest-0.0.3, datadir-1.5.0, timeout-2.2.0, regressions-1.0.6, xdist-3.5.0"
C e|j|0.015
C e|g|0.015
M k:"collected 0 items / 1 error"
C e|k|0.11
C e|g|0.11
M l:"PASS"
ET l|d|0.11
M n:"run finished (print results)"
P m:n|d|d|d|0
ST m|0.11
C e|g|0.131
M o:"==================================== ERRORS ===================================="
C e|o|0.131
C e|g|0.132
M p:"__________________ ERROR collecting tests/test_jab_wrapper.py __________________"
C e|p|0.132
C e|g|0.132
M q:"ImportError while importing test module '/Users/cosminpopa/Work/RoboCorp/code/java-access-bridge-wrapper/tests/test_jab_wrapper.py'.\nHint: make sure your test modules/packages have valid Python names.\nTraceback:\n../../../../.pyenv/versions/3.10.13/lib/python3.10/importlib/__init__.py:126: in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n../../../PYVEnvs/pyenv3.10.13.robocorp.vscode/lib/python3.10/site-packages/robocorp/log/_rewrite_importhook.py:197: in exec_module\n exec(co, module.__dict__)\ntests/test_jab_wrapper.py:12: in <module>\n from JABWrapper.context_tree import ContextNode, ContextTree, SearchElement\n../../../PYVEnvs/pyenv3.10.13.robocorp.vscode/lib/python3.10/site-packages/robocorp/log/_rewrite_importhook.py:197: in exec_module\n exec(co, module.__dict__)\nsrc/JABWrapper/context_tree.py:8: in <module>\n from JABWrapper.jab_wrapper import JavaAccessBridgeWrapper\n../../../PYVEnvs/pyenv3.10.13.robocorp.vscode/lib/python3.10/site-packages/robocorp/log/_rewrite_importhook.py:197: in exec_module\n exec(co, module.__dict__)\nsrc/JABWrapper/jab_wrapper.py:5: in <module>\n from ctypes import (\nE ImportError: cannot import name 'WINFUNCTYPE' from 'ctypes' (/Users/cosminpopa/.pyenv/versions/3.10.13/lib/python3.10/ctypes/__init__.py)"
C e|q|0.132
C e|g|0.132
M r:"=========================== short test summary info ============================"
C e|r|0.132
C e|g|0.132
M s:"ERROR tests/test_jab_wrapper.py"
C e|s|0.132
C e|g|0.132
M t:"!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!"
C e|t|0.132
C e|g|0.132
M u:"=============================== 1 error in 0.12s ==============================="
C e|u|0.132
C e|g|0.132
ET l|d|0.132
M v:"FAIL"
ER v|0.132
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "java-access-bridge-wrapper"
version = "1.1.0"
version = "1.2.0"
description = "Python wrapper for the Windows Java Access Bridge"
license = "Apache-2.0"
readme = "README.md"
Expand Down
5 changes: 5 additions & 0 deletions src/JABWrapper/context_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
ancestry: int = 0,
parse_children: bool = True,
max_depth: Optional[int] = None,
parent: Optional["ContextNode"] = None,
) -> None:
self._jab_wrapper = jab_wrapper
self._lock = lock
Expand All @@ -55,6 +56,8 @@ def __init__(
self.virtual_accessible_name = None
self._children: list[ContextNode] = []

self.parent: Optional[ContextNode] = parent

# Populate the element with data and its children if enabled.
self.refresh()

Expand Down Expand Up @@ -134,6 +137,7 @@ def _parse_children(self) -> None:
self.ancestry + 1,
parse_children=self._should_parse_children,
max_depth=self._max_depth,
parent=self,
)
self._children.append(child_node)

Expand Down Expand Up @@ -335,6 +339,7 @@ def get_visible_children(self) -> List:
self._lock,
self.ancestry + 1,
parse_children=False,
parent=self,
)
visible_children.append(visible_child)
return visible_children
Expand Down
31 changes: 31 additions & 0 deletions tests/rcc_py_env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
SET PYTHON_EXE=c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\python.exe
SET PYTHONDONTWRITEBYTECODE=x
SET PYTHONPYCACHEPREFIX=C:\Users\cosminpopa\AppData\Local\robocorp\temp\44296f6d9d0a20e2
SET TEMP=C:\Users\cosminpopa\AppData\Local\robocorp\temp\44296f6d9d0a20e2
SET TMP=C:\Users\cosminpopa\AppData\Local\robocorp\temp\44296f6d9d0a20e2
SET CONDA_DEFAULT_ENV=rcc
SET CONDA_PREFIX=c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534
SET CONDA_PROMPT_MODIFIER=(rcc)
SET CONDA_SHLVL=1
SET PYTHONHOME=
SET PYTHONSTARTUP=
SET PYTHONEXECUTABLE=
SET PYTHONNOUSERSITE=1
SET ROBOCORP_HOME=C:\Users\cosminpopa\AppData\Local\robocorp
SET RCC_ENVIRONMENT_HASH=2f4a48b6e779bb2e
SET RCC_INSTALLATION_ID=ddf0dbe5-c5f4-a533-f5e6-ef5d07b04ec9
SET RCC_HOLOTREE_SPACE_ROOT=c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534
SET RCC_TRACKING_ALLOWED=true
SET RCC_EXE=C:\Users\cosminpopa\Downloads\rcc.exe
SET RCC_VERSION=v17.12.0
SET PATH=c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534;c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Library\mingw-w64\bin;c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Library\usr\bin;c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Library\bin;c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Scripts;c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\bin;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Users\cosminpopa\Downloads\%NVM_HOME%;C:\Users\cosminpopa\Downloads\%NVM_SYMLINK%;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Users\cosminpopa\AppData\Local\Microsoft\WindowsApps;C:\Users\cosminpopa\AppData\Local\Yarn\bin;C:\Users\cosminpopa\AppData\Roaming\npm;C:\ProgramData\nvm;C:\Program Files (x86)\nodejs;C:\Users\cosminpopa\AppData\Local\Programs\Microsoft VS Code\bin
SET CONDA_PREFIX=C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534
SET CONDA_PREFIX_1=c:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534
SET CONDA_PROMPT_MODIFIER=(C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534)
SET CONDA_SHLVL=2
SET MAMBA_ROOT_PREFIX=C:\Users\cosminpopa\AppData\Local\robocorp
SET PATH=C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534;C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Library\mingw-w64\bin;C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Library\usr\bin;C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Library\bin;C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\Scripts;C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534\bin;C:\Program Files\Parallels\Parallels Tools\Applications;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Yarn\bin;C:\Users\cosminpopa\Downloads\C:\ProgramData\nvm;C:\Users\cosminpopa\Downloads\C:\Program Files (x86)\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Users\cosminpopa\AppData\Local\Microsoft\WindowsApps;C:\Users\cosminpopa\AppData\Local\Yarn\bin;C:\Users\cosminpopa\AppData\Roaming\npm;C:\ProgramData\nvm;C:\Program Files (x86)\nodejs;C:\Users\cosminpopa\AppData\Local\Programs\Microsoft VS Code\bin
SET PROMPT=$P$G
SET CONDA_DEFAULT_ENV=C:\ProgramData\robocorp\ht\cd7858c_5a1fac3_9fcd2534

SET RC_JAVA_ACCESS_BRIDGE_DLL=C:\\Program Files\\Java\\jdk1.8.0_211\\jre\\bin\\WindowsAccessBridge-64.dll

0 comments on commit d97e9fb

Please sign in to comment.