diff options
author | Ahmed ElShreif <aelshreif7@gmail.com> | 2019-07-29 00:29:24 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-19 22:56:38 +0800 |
commit | 3c5fe9ae9f15fccecdd91b32c225c3cbd854eff0 (patch) | |
tree | 3c9c5243150820ff9ee8a4078c774e4239206de6 /uitest | |
parent | 00323f94615ac987123be8f83990028147656457 (diff) |
uitest: start logging draw events
Change-Id: I1b77b106db181a8cadc1ff0b2a5de6ad19fe6762
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/ui_logger_dsl/Special_commands.tx | 19 | ||||
-rw-r--r-- | uitest/ui_logger_dsl/dsl_core.py | 14 |
2 files changed, 30 insertions, 3 deletions
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(\""+\ |