[Libreoffice-qa] Converting a Python UI test into a cppunit test

Michael Stahl mst at libreoffice.org
Fri Jul 17 08:36:58 UTC 2020


On 17.07.20 08:53, Ilmari Lauhakangas wrote:
> Michael Stahl kirjoitti 16.7.2020 klo 20.43:
>> On 16.07.20 18:55, Ilmari Lauhakangas wrote:
>>> I created execute.sh for running the Python UI test:
>>>
>>> export PYTHONPATH=/home/tonttu/libreoffice/instdir/program/
>>> export 
>>> URE_BOOTSTRAP=file:///home/tonttu/libreoffice/instdir/program/fundamentalrc 
>>>
>>> export SAL_USE_VCLPLUGIN=gen
>>> rm -rf /tmp/libreoffice/4
>>> SRCDIR="${SRCDIR:-$(pwd)}"
>>> python "$SRCDIR"/uitest/test_main.py --debug 
>>> --soffice=path:"$SRCDIR"/instdir/program/soffice 
>>> --userdir=file:///tmp/libreoffice/4 
>>> --file="$SRCDIR"/sw/qa/uitest/writer_tests7/tdf127652.py
>>>
>>> I ran execute.sh while in the core directory and confirmed that the 
>>> UI test failed.
>>
>> why so complicated, try:
>>
>> (cd sw && make -srj8 UITest_writer_tests7 
>> UITEST_TEST_NAME="tdf127652.tdf127652.test_mark_delete_undo_delete_tdf127652") 
> 
> 
> The script method allows to see the UI while the test is executed, but 
> it would be good to have the example you quote documented in 
> https://wiki.documentfoundation.org/Development/UITests#Running_the_test

oh! i wondered if this would work, and it does work for me:

(cd sw && make -srj8 UITest_writer_tests7 
UITEST_TEST_NAME="tdf127652.tdf127652.test_mark_delete_undo_delete_tdf127652" 
SAL_USE_VCLPLUGIN=gen)


More information about the Libreoffice-qa mailing list