diff options
author | Ahmed ElShreif <aelshreif7@gmail.com> | 2020-08-16 10:24:20 +0200 |
---|---|---|
committer | Ahmed ElShreif <aelshreif7@gmail.com> | 2020-08-24 00:26:03 +0200 |
commit | 3ceccd384cb61686a96e73821035c6ac5d0d1604 (patch) | |
tree | 6cbd6e26627ed71149f56f3338a0ad99ae0d2ef8 /uitest | |
parent | 57520e35bb250eff60bd8e3dcdd3d7ef1129e1b5 (diff) |
uilogger : Add support in the Logger and DSL for the ToolBox
The support is tested on the FindBar and it works well .
For example the DSL syntax in the FindBar should be like:
>>"Click on item number 3 in FindBar"
Change-Id: I3ec5f5afc260df4b38dc4e420fcc48d9c774c29f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100811
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/ui_logger_dsl/UI_Object_commands.tx | 6 | ||||
-rw-r--r-- | uitest/ui_logger_dsl/dsl_core.py | 20 |
2 files changed, 25 insertions, 1 deletions
diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx b/uitest/ui_logger_dsl/UI_Object_commands.tx index 2d3724f2d11e..a3fe81b72b2b 100644 --- a/uitest/ui_logger_dsl/UI_Object_commands.tx +++ b/uitest/ui_logger_dsl/UI_Object_commands.tx @@ -10,12 +10,13 @@ import type_options 6) ComboBoxUIObject ( Select event ) 7) SpinUIObject ( Increase event - Decrease event ) 8) TabControlUIObject ( Change tab event ) + 9) ToolBoxUIObject ( Click on item event ) */ UIObjectCommand: ButtonUIObject | CheckBoxUIObject | EditUIObject | RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | - SpinFieldUIObject | TabControlUIObject + SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject ; ButtonUIObject: @@ -42,6 +43,9 @@ SpinFieldUIObject: ListBoxUIObject: 'Select element with position ' POS=INT 'in' list_id=STRING ('from' parent_id=ID)? ; +ToolBoxUIObject: + 'Click on item number' POS=INT 'in' toolbox_id=ID +; //============================================================= //helper grammar for EditUIObject action_on_UIObject: diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index ebe936bba76a..feb69b76a320 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -103,6 +103,7 @@ class ul_Compiler: "ListBoxUIObject": self.handle_List_box, "SpinFieldUIObject": self.handle_spin_field, "EditUIObject": self.handle_Edit_uiObject, + "ToolBoxUIObject": self.handle_ToolBox_uiObject, "writer_Type_command": self.handle_writer_type, "writer_Select_command": self.handle_writer_select, "writer_GOTO_command": self.handle_writer_goto, @@ -607,6 +608,25 @@ class ul_Compiler: self.prev_command = EditUIObject + def handle_ToolBox_uiObject(self, ToolBoxUIObject): + name_of_obj = "" + if keyword.iskeyword(ToolBoxUIObject.toolbox_id): + name_of_obj = "x" + ToolBoxUIObject.toolbox_id + else: + name_of_obj = ToolBoxUIObject.toolbox_id + + self.init_Object( + name_of_obj, + ToolBoxUIObject.toolbox_id, + self.last_parent[self.parent_hierarchy_count], + ) + + self.write_line_with_one_parameters( + name_of_obj, "CLICK", "POS", ToolBoxUIObject.POS + ) + + self.prev_command = ToolBoxUIObject + def handle_writer_type(self, writer_Type_command): self.init_app() |