diff options
author | Ahmed ElShreif <aelshreif7@gmail.com> | 2020-08-25 23:35:08 +0200 |
---|---|---|
committer | Ahmed ElShreif <aelshreif7@gmail.com> | 2020-09-01 01:24:53 +0200 |
commit | fe3d005155a8670d02ff1a8d17f1bcff74a44cab (patch) | |
tree | cce513ef383adf5087780d41df1256454aac33b7 /uitest | |
parent | 35585f85049fd20719c42d7d7433859df59a0967 (diff) |
uilogger : Add support in the Logger and DSL for Calc-Comments
For example the DSL syntax will be:
>>Open Comment
>>Close Comment
The set text is already added by default to the system
Change-Id: Ic06e00e75e202eece82fa6265e1bb4083fd8c337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101502
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/ui_logger_dsl/Special_commands.tx | 12 | ||||
-rw-r--r-- | uitest/ui_logger_dsl/dsl_core.py | 28 |
2 files changed, 39 insertions, 1 deletions
diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx index 601a600f4bdb..9a8dc4cff6c4 100644 --- a/uitest/ui_logger_dsl/Special_commands.tx +++ b/uitest/ui_logger_dsl/Special_commands.tx @@ -69,6 +69,8 @@ writer_Insert_BreakPage: 10) Paste Cells 11) Merge Cells 12) Unmerge Cells + 13) Open Comment + 14) Close Comment then we can add whatever we need in the future */ @@ -76,7 +78,8 @@ calc_command: calc_Type_command | calc_switch_sheet | calc_Select_cell | calc_AutoFill_filter | calc_SelectMenu_filter | calc_Delete_Cells | calc_Remove_Content | calc_insert_cells | calc_Cut_Cells | calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | - calc_Merge_Cells | calc_Rename_Sheet | calc_Insert_sheet + calc_Merge_Cells | calc_Rename_Sheet | calc_Insert_sheet | calc_Open_Comment | + calc_Close_Comment ; calc_Type_command: 'Type on current cell' what_to_type=Type_options @@ -129,6 +132,13 @@ calc_Rename_Sheet: calc_Insert_sheet: 'Insert New Tab ' ; +calc_Open_Comment: + 'Open Comment' (txt=STRING)? +; +calc_Close_Comment: + 'Close Comment' (txt=STRING)? +; + //this is the select options select_options: one_cell | range_of_cells diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index 8fa7d141c2c3..062415f00fb1 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -113,6 +113,8 @@ class ul_Compiler: "calc_Type_command": self.handle_calc_Type_command, "calc_AutoFill_filter": self.handle_calc_AutoFill_filter, "calc_SelectMenu_filter": self.handle_calc_SelectMenu_filter, + "calc_Open_Comment": self.handle_calc_Open_Comment, + "calc_Close_Comment": self.handle_calc_Close_Comment, "impress_Type_command": self.handle_impress_Type_command, "math_element_selector": self.handle_math_element_selector, "math_Type_command": self.handle_math_Type_command, @@ -780,6 +782,32 @@ class ul_Compiler: self.variables.append(line) self.prev_command = calc_AutoFill_filter + def handle_calc_Open_Comment(self, calc_Open_Comment): + + line = ( + double_tab + + self.current_app + + '.executeAction("COMMENT", mkPropertyValues' + + '({"OPEN": " "}))\n' + ) + + self.variables.append(line) + + self.prev_command = calc_Open_Comment + + def handle_calc_Close_Comment(self, calc_Close_Comment): + + line = ( + double_tab + + self.current_app + + '.executeAction("COMMENT", mkPropertyValues' + + '({"CLOSE": " "}))\n' + ) + + self.variables.append(line) + + self.prev_command = calc_Close_Comment + def handle_calc_SelectMenu_filter(self, calc_SelectMenu_filter): self.init_app() |