The Base UI tests all need to open a window that operates on the same database, such as opening the table editor etc. There seems to be a few race conditions related to opening sub windows that occasionally make the tests fail so the idea with this patch is to make a central place in test.py to add code to handle opening the window and closing it when finished. That way we can add any synchronisation needed in a central place. For getting access to the new frame, the three current tests were all trying to handle this in different ways. insert_relation waits for the OnSubComponentOpened event, create_join_undo_redo was waiting until the current focus window changes and the edit_field test was just crossing its fingers and hoping that the timing worked. This last one is the likely culprit of the following Jenkins build error for the edit_field test: https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/193148/ The new helper method always listens for OnSubComponentOpened and then extracts the new frame from that event. When closing the window the shared code now always calls waitUntilAllIdlesDispatched. .uno:CloseWin ends up being executing asynchronously on the main thread which means that the later call to .uno:CloseDoc can happen simultaneously. If --oneprocess is not used then it will even end up directly calling dispose on the main frame instead of calling CloseDoc. I haven’t been able to replicate the crash locally, but is seems like this might be related to crashes like the one below: https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/193204/ Change-Id: Iab0a46c3ca9f8c9eb9ac7f4fecb07f633bd0b312 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194350 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
UI Testing Framework
The code for the UI testing framework and the UI tests.
The UI tests run on a dedicated desktop on Windows, to not interfere with the interactive session. To make them run on the current (active) desktop, define the following environment variable: LIBO_TEST_DEFAULT_DESKTOP