summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorAhmed ElShreif <aelshreif7@gmail.com>2020-08-28 03:11:44 +0200
committerAhmed ElShreif <aelshreif7@gmail.com>2020-09-01 03:36:53 +0200
commit2e635d22cdbfcfe163b46427d04ebce9fe21a61e (patch)
tree0ac776e61de726df32931f82d2ea464f90aec193 /uitest
parentfe3d005155a8670d02ff1a8d17f1bcff74a44cab (diff)
uilogger : Add support in the Logger and DSL for Writer-Comments
For example the DSL syntax will be: >>Delete Comment1 >>Leave Comment1 >>Show Comment1 >>Hide Comment1 >>Resolve Comment1 Change-Id: Ibdd52f3a12f1679f80e9f3290868c77fbf942d6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101513 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/ui_logger_dsl/Special_commands.tx34
-rw-r--r--uitest/ui_logger_dsl/dsl_core.py75
2 files changed, 108 insertions, 1 deletions
diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx
index 9a8dc4cff6c4..9d37029a5e95 100644
--- a/uitest/ui_logger_dsl/Special_commands.tx
+++ b/uitest/ui_logger_dsl/Special_commands.tx
@@ -26,7 +26,7 @@ SpecialCommand:
writer_command:
writer_Type_command | writer_Select_command | writer_GOTO_command |
writer_Create_table | writer_Copy_Text | writer_Cut_Text |
- writer_Paste_Text | writer_Insert_BreakPage
+ writer_Paste_Text | writer_Insert_BreakPage | writer_Comment_command
;
writer_Type_command:
'Type on writer' what_to_type=Type_options
@@ -220,4 +220,36 @@ draw_Delete_Page:
;
draw_Rename_Page:
'Rename The Selected Page from ' old_name=STRING 'to' new_name=STRING
+;
+
+//=================================================================//
+/*
+ This part for all the Writer Comment statements:
+
+ 1) Leave
+ 2) Hide
+ 3) Show
+ 4) Delete
+ 5) Set Resolved
+
+ then we can add whatever we need in the future
+*/
+writer_Comment_command:
+ writer_Comment_leave | writer_Comment_show | writer_Comment_hide |
+ writer_Comment_delete | writer_Comment_setresolved
+;
+writer_Comment_leave:
+ 'Leave ' comment_id=STRING
+;
+writer_Comment_show:
+ 'Show ' comment_id=STRING
+;
+writer_Comment_hide:
+ 'Hide ' comment_id=STRING
+;
+writer_Comment_delete:
+ 'Delete ' comment_id=STRING
+;
+writer_Comment_setresolved:
+ 'Resolve' comment_id=STRING
; \ No newline at end of file
diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py
index 062415f00fb1..fa17391eafa7 100644
--- a/uitest/ui_logger_dsl/dsl_core.py
+++ b/uitest/ui_logger_dsl/dsl_core.py
@@ -121,6 +121,11 @@ class ul_Compiler:
"setZoom_command": self.handle_setZoom_command,
"draw_Type_command": self.handle_draw_Type_command,
"SideBar": self.handle_SideBar,
+ "writer_Comment_leave":self.handle_writer_Comment_leave,
+ "writer_Comment_show":self.handle_writer_Comment_show,
+ "writer_Comment_hide":self.handle_writer_Comment_hide,
+ "writer_Comment_delete":self.handle_writer_Comment_delete,
+ "writer_Comment_setresolved":self.handle_writer_Comment_setresolved,
"writer_Copy_Text": self.do_nothing,
"writer_Cut_Text": self.do_nothing,
"writer_Paste_Text": self.do_nothing,
@@ -916,6 +921,76 @@ class ul_Compiler:
self.prev_command = math_element_selector
+ def handle_writer_Comment_leave(self,writer_Comment_leave):
+
+ self.init_app()
+
+ self.init_Object(
+ writer_Comment_leave.comment_id, writer_Comment_leave.comment_id, "MainWindow"
+ )
+
+ self.write_line_with_one_parameters(
+ writer_Comment_leave.comment_id, "LEAVE", "", ""
+ )
+
+ self.prev_command = writer_Comment_leave
+
+ def handle_writer_Comment_show(self,writer_Comment_show):
+
+ self.init_app()
+
+ self.init_Object(
+ writer_Comment_show.comment_id, writer_Comment_show.comment_id, "MainWindow"
+ )
+
+ self.write_line_with_one_parameters(
+ writer_Comment_show.comment_id, "SHOW", "", ""
+ )
+
+ self.prev_command = writer_Comment_show
+
+ def handle_writer_Comment_hide(self,writer_Comment_hide):
+
+ self.init_app()
+
+ self.init_Object(
+ writer_Comment_hide.comment_id, writer_Comment_hide.comment_id, "MainWindow"
+ )
+
+ self.write_line_with_one_parameters(
+ writer_Comment_hide.comment_id, "HIDE", "", ""
+ )
+
+ self.prev_command = writer_Comment_hide
+
+ def handle_writer_Comment_delete(self,writer_Comment_delete):
+
+ self.init_app()
+
+ self.init_Object(
+ writer_Comment_delete.comment_id, writer_Comment_delete.comment_id, "MainWindow"
+ )
+
+ self.write_line_with_one_parameters(
+ writer_Comment_delete.comment_id, "DELETE", "", ""
+ )
+
+ self.prev_command = writer_Comment_delete
+
+ def handle_writer_Comment_setresolved(self,writer_Comment_setresolved):
+
+ self.init_app()
+
+ self.init_Object(
+ writer_Comment_setresolved.comment_id, writer_Comment_setresolved.comment_id, "MainWindow"
+ )
+
+ self.write_line_with_one_parameters(
+ writer_Comment_setresolved.comment_id, "RESOLVE", "", ""
+ )
+
+ self.prev_command = writer_Comment_setresolved
+
def handle_setZoom_command(self, setZoom_command):
self.init_app()