GSoC final report
Overview
The idea of this GSoC project was to implement new Domain-Specific language for LibreOffice to be used in UI testing by logging the user interactions with LO applications then generate the python code needed for the python UI framework which will make testing easier. Also, the project aims to improve the logger that logs all the user interaction to be logged in the new DSL syntax to be more readable. Then we can use this replaying all the user interactions as a UI test.Achievements
Grammar of new DSL done for
- starter_commands
- uno_commands
- dialog_commands
- General_commands Grammar that are general for all application.
- UI_Object_commands This support:
- Special_commands This is for the logging of different applications actions:
Rewrite all the logging messages with the new syntax.
Some of these events was already supported to be logged while working by the old logger so for this part I change all the logging message by writing message that can be read with the new compiler and has enough data to be converted to UItest.
The log Compiler [ dsl_core.py ]
This python file is the implementation of the compiler this compiler is defined in the class : ul_compiler . It works by making an object from this class and it start read the log file that is already created and each line represent a type from commands. While reading these lines this class start calling the handler of each line depending on it's type and the handler is just a function that take information from line and start to convert it to python line that do the same action but can be run with the python UI framework.log More Events
after finishing the implementation of all of these I worked on adding support foe unsupported events from different applications. for any new event I add the grammar then the handler then added the part in the code that log this event.
for example the new supported events are:- Writer
- Create Table
- Copy Text
- Cut Text
- Paste Text
- Insert Break Page
- Calc
- Impress
- Draw
for more details you can see this post in the same blog: ui logger
Code
I was working on in the start in this branch : private/EL-SHREIF/ui_logger So most of the coding and solving bugs can be found on it in this link.
all my merged patches can be found here : merged patches
For more details :
all my merged patches can be found here : merged patches
For more details :
- uitest: Rewrite all the logger statements with the new grammar syntax
- uitest: new logger DSL grammar
- uitest: update the DSL grammar
- uitest: just update zoom statement
- uitest: Some new features in ui_logger project
- uitest: change small parts of the grammar and dialog logger
- uitest: start the implementation of the new DSL compiler
- uitest: add DSL compiler support for more UI items
- uitest: implement the missing part of the dialog compiler
- uitest: add special commands of writer app implementation
- uitest: add more DSL commands
- uitest: add general functions to remove redundunt lines
- uitest: solve some bugs in the ui logger
- uitest: log more events
- uitest: update UI logger grammar
- uitest: start logging draw events
- uitest: add more events to ui logger
- uitest: log more events
- uitest: log more events in Calc:
- uitest: solve problem with un-named parents
- uitest: add footer line support
- uitest: replace tabs with spaces
- uitest: use prefix for names that has conflict with python's keywords
- uitest: ignore the logging part of the QuerySaveDialog while closing the app
- uitest: add the SideBar implementation
- uitest: Reformat the python script of the Compiler
- uitest: Fix typos
Using the logger
First you should update the master branch:
1) Launch LibreOffice like
2) Simulate what you want to do with the mouse
1) Launch LibreOffice like
LO_COLLECT_UIINFO="test.log" SAL_USE_VCLPLUGIN=gen instdir/program/soffice
2) Simulate what you want to do with the mouse
3) Close LibreOffice
4) Open the resulting file in instdir/uitest/test.log
5) Enter the UI logger directory with this Command:
cd uitest/ui_logger_dsl/
6) Use the following Command
python dsl_core.py <path_to_log_file> <path_to_a_new_python_file>
and <path_to_a_new_python_file> can be a location of your choice where you would like to see the generated code.
Also, old Reports has a video doing these steps.
Remaining Tasks
Mainly thier is no remaining task for my project. But I made this section as a idea about how to extend the project in the future. It can be done by start adding more events to be logged in LO apps. This can be happend by read this project description and start add new grammar for new event and log it with new syntax by same methods. Also we have some limitations that the UI python framework doesn't support everything so it will be better to extend it first.
Thank You!
Thank you for giving me the opportunity to work on this project. I learned a lot from this project. I will definitely like to spend more time with LibreOffice community in future. I like to thank also my mentors they help me and guide me to learn a lot and the community was always active and helpfull.
This comment has been removed by the author.
ReplyDeleteAmazing job Ahmed!
DeleteThank You
DeleteGood job ahmed el shreif!
ReplyDeleteThank You :)
Delete