Re: Problem debugging UITests with PyCharm Community

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hossein,

In your manual [1] is passed the variable $SRCDIR. I think in this
case I have error:
/home/lera/.virtualenvs/libreoffice/bin/python
$SRCDIR/uitest/test_main.py
--soffice=path:$SRCDIR/instdir/program/soffice
--userdir=file:///tmp/libreoffice/4 --file=
/home/lera/.virtualenvs/libreoffice/bin/python: can't open file
'/home/lera/$SRCDIR/uitest/test_main.py': [Errno 2] No such file or
directory

Process finished with exit code 2

If I change all occurrences of the $SRCDIR variable to a path, I get an error:

/home/lera/.virtualenvs/libreoffice/bin/python
project/libreoffice/uitest/test_main.py
--soffice=path:home/lera/project/libreoffice/instdir/program/soffice
--userdir=file:///tmp/libreoffice/4
--file=/home/lera/project/libreoffice/sc/qa/uitest/calc_tests3/clearCells.py
Traceback (most recent call last):
  File "/home/lera/project/libreoffice/uitest/test_main.py", line 16,
in <module>
    from uitest.framework import UITestCase
ModuleNotFoundError: No module named 'uitest.framework'

Process finished with exit code 1

The script runs ok [2]. Now I run tests with help it.

One more question: what flags do you use to build Libreoffice python?
I have Ubuntu 20.04 and I can't find the python file in the
instdir/program folder.

[1] https://wiki.documentfoundation.org/Development/IDE#PyCharm
[2] https://wiki.documentfoundation.org/Development/UITests#Running_the_test

Best Regards,
Lera

пт, 20 мая 2022 г. в 12:38, Hossein Nourikhah <hossein@xxxxxxxxxxxxxxx>:
>
> Hello,
>
> I have been asked about how to run the UITests and Python scripts that
> use UNO API in general in PyCharm. I have documented the process in this
> section of the IDE article:
>
> Developmenet/IDE
> https://wiki.documentfoundation.org/Development/IDE#PyCharm
>
> This is the command line for running a UITTest as you see in PyCharm
> console, in which works fine for me:
>
> --------------------------------------------------------------------------------
> /usr/bin/python3.8
> /home/hossein/Projects/libreoffice/core/uitest/test_main.py
> --soffice=path:/home/hossein/Projects/libreoffice/core/instdir/program/soffice
> --userdir=file:///tmp/libreoffice/4
> --file=/home/hossein/core/sc/qa/uitest/sort/stableSorting.py
> --------------------------------------------------------------------------------
>
> The same process works for debugging Python scripts that work with UNO
> API. You just have to press the debug button from the toolbar. On the
> other hand, one can not use the "Debug" button in PyCharm to debug the
> script, as it leads to error:
>
> --------------------------------------------------------------------------------
> /usr/bin/python3.8
> /snap/pycharm-community/278/plugins/python-ce/helpers/pydev/pydevd.py
> --multiprocess --qt-support=auto --client 127.0.0.1 --port 34797 --file
> /home/hossein/Projects/libreoffice/core/uitest/test_main.py
> --soffice=path:/home/hossein/Projects/libreoffice/core/instdir/program/soffice
> --userdir=file:///tmp/libreoffice/4
> --file=/home/hossein/Projects/libreoffice/core/sc/qa/uitest/sort/stableSorting.py
> Connected to pydev debugger (build 221.5591.52)
> Traceback (most recent call last):
>    File "<frozen importlib._bootstrap>", line 991, in _find_and_load
>    File "<frozen importlib._bootstrap>", line 973, in
> _find_and_load_unlocked
> ModuleNotFoundError: No module named 'uitest.framework'
>
> Process finished with exit code 1
> --------------------------------------------------------------------------------
>
> As you can see, there are several Python scripts involved here:
>
> 1) plugins/python-ce/helpers/pydev/pydevd.py   for debugging
> 2) uitest/test_main.py                         for running the UITest
> 3) sc/qa/uitest/sort/stableSorting.py          the actual UITest
>
> Any idea how to fix this problem?
>
> Regards,
> Hossein




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux