[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - uitest/ui_logger_dsl vcl/source
Ahmed ElShreif (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 29 05:30:52 UTC 2019
uitest/ui_logger_dsl/Special_commands.tx | 19 +++++++++++++++++--
uitest/ui_logger_dsl/dsl_core.py | 14 +++++++++++++-
vcl/source/uitest/logger.cxx | 3 +++
3 files changed, 33 insertions(+), 3 deletions(-)
New commits:
commit af7f51648553b2e6c66439921574dd474bf01447
Author: Ahmed ElShreif <aelshreif7 at gmail.com>
AuthorDate: Mon Jul 29 00:29:24 2019 -0500
Commit: Ahmed ElShreif <aelshreif7 at gmail.com>
CommitDate: Mon Jul 29 00:29:24 2019 -0500
Start logging draw Events
Change-Id: I1b77b106db181a8cadc1ff0b2a5de6ad19fe6762
diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx
index fc1940c7ef91..5fbd9972a275 100644
--- a/uitest/ui_logger_dsl/Special_commands.tx
+++ b/uitest/ui_logger_dsl/Special_commands.tx
@@ -6,7 +6,7 @@ import type_options
*/
SpecialCommand:
- writer_command | calc_command | impress_command | math_command
+ writer_command | calc_command | impress_command | math_command | draw_command
;
/*
@@ -144,7 +144,7 @@ impress_Type_command:
This part for all the math log statments:
1) element selector
- 2) Type
+ 2) Type
then we can add whatever we need in the future
*/
@@ -156,4 +156,19 @@ math_element_selector:
;
math_Type_command:
'Type on math ' what_to_type=Type_options
+;
+
+//=================================================================//
+/*
+ This part for all the draw log statments:
+
+ 1) Type
+
+ then we can add whatever we need in the future
+*/
+draw_command:
+ draw_Type_command
+;
+draw_Type_command:
+ 'Type on draw ' what_to_type=Type_options
;
\ 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 ab198a6d234f..8d5a8a82ac0b 100644
--- a/uitest/ui_logger_dsl/dsl_core.py
+++ b/uitest/ui_logger_dsl/dsl_core.py
@@ -87,6 +87,7 @@ class ul_Compiler:
'math_element_selector':self.handle_math_element_selector,
'math_Type_command':self.handle_math_Type_command,
'setZoom_command':self.handle_setZoom_command,
+ 'draw_Type_command':self.handle_draw_Type_command,
'writer_Copy_Text':self.do_nothing,
'writer_Cut_Text':self.do_nothing,
@@ -165,7 +166,7 @@ class ul_Compiler:
line="\t\tMainWindow = self.xUITest.getTopFocusWindow()\n"
self.variables.append(line)
app={"writer":"writer_edit","calc":"grid_window","impress":"impress_win"\
- ,"math":"math_edit"}
+ ,"math":"math_edit","draw":"draw_win"}
self.current_app=app[StarterCommand.program_name]
self.prev_command=StarterCommand
@@ -391,6 +392,17 @@ class ul_Compiler:
self.prev_command=math_Type_command
+ def handle_draw_Type_command (self,draw_Type_command):
+
+ self.init_app()
+ if(draw_Type_command.what_to_type.__class__.__name__=="char"):
+ self.write_line_with_one_parameters(self.current_app,"TYPE","TEXT",draw_Type_command.what_to_type.input_char)
+
+ elif(draw_Type_command.what_to_type.__class__.__name__=="KeyCode"):
+ self.write_line_with_one_parameters(self.current_app,"TYPE","KEYCODE",draw_Type_command.what_to_type.input_key_code)
+
+ self.prev_command=draw_Type_command
+
def handle_math_element_selector (self,math_element_selector):
line="\t\t"+str(math_element_selector.element_no)+" = element_selector.getChild(\""+\
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 2713188c104f..bd0d91940b1e 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -230,6 +230,9 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
else if(pUIObject->get_type()=="WindowUIObject" && rID=="math_edit"){
aContent = "Type on math " + aKeyCode ;
}
+ else if(rID=="draw_win"){
+ aContent = "Type on draw " + aKeyCode ;
+ }
else{
aContent = "Type on '" + rID + "' " + aKeyCode + " from " + aParentID ;
}
More information about the Libreoffice-commits
mailing list