diff options
author | Ahmed ElShreif <aelshreif7@gmail.com> | 2019-08-16 21:56:42 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-19 22:56:39 +0800 |
commit | 1eead54fe7e264d854d5daaad610b20426143b9b (patch) | |
tree | a165daa91de6cdd9044ea965fcf543e1c502aaf5 /uitest | |
parent | cb84769f7c7197ddc5440a1e29cd80bc5184f06c (diff) |
uitest: ignore the logging part of the QuerySaveDialog while closing the app
Change-Id: I18fcc81fa54362dfaa574ec04125e66b37a5aad8
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/ui_logger_dsl/dsl_core.py | 88 |
1 files changed, 52 insertions, 36 deletions
diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py index b8e0b9b7269c..088fcf4a0d64 100644 --- a/uitest/ui_logger_dsl/dsl_core.py +++ b/uitest/ui_logger_dsl/dsl_core.py @@ -33,6 +33,7 @@ class ul_Compiler: current_app="" parent_hierarchy_count=0 last_parent=[] + flag_for_QuerySaveDialog=False def __init__(self , input_address , output_address): self.ui_dsl_mm = metamodel_from_file('ui_logger_dsl_grammar.tx') @@ -190,21 +191,27 @@ class ul_Compiler: def handle_Dialog(self, DialogCommand): if (DialogCommand.__class__.__name__ == "OpenModalDialog"): - old_line = self.variables.pop() - if (self.prev_command.__class__.__name__ == "UNOCommand"): - key_word=self.prev_command.uno_command_name[-6:] - else: - key_word=old_line[-9:-3] + if( DialogCommand.dialog_name != "QuerySaveDialog" ): + # This part is just to ignore saving the Save dialog while closing the app - if ( key_word == "Dialog"): - old_line= double_tab + "self.ui_test.execute_dialog_through_command(\""+\ - self.prev_command.uno_command_name+"\")\n" - self.variables.append(old_line) - line = double_tab + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" - self.variables.append(line) - self.last_parent.append(DialogCommand.dialog_name) - self.parent_hierarchy_count=self.parent_hierarchy_count+1 + old_line = self.variables.pop() + if (self.prev_command.__class__.__name__ == "UNOCommand"): + key_word=self.prev_command.uno_command_name[-6:] + else: + key_word=old_line[-9:-3] + + if ( key_word == "Dialog"): + old_line= double_tab + "self.ui_test.execute_dialog_through_command(\""+\ + self.prev_command.uno_command_name+"\")\n" + self.variables.append(old_line) + line = double_tab + DialogCommand.dialog_name + " = self.xUITest.getTopFocusWindow()\n" + self.variables.append(line) + self.last_parent.append(DialogCommand.dialog_name) + self.parent_hierarchy_count=self.parent_hierarchy_count+1 + + else: + self.flag_for_QuerySaveDialog=True elif (DialogCommand.__class__.__name__ == "OpenModelessDialog"): old_line = self.variables.pop() @@ -223,37 +230,46 @@ class ul_Compiler: self.parent_hierarchy_count=self.parent_hierarchy_count+1 elif (DialogCommand.__class__.__name__ == "CloseDialog"): - if (self.prev_command.__class__.__name__ == "ButtonUIObject"): - old_line = self.variables.pop() - line="" - if(keyword.iskeyword( self.prev_command.ui_button )): - line= double_tab + "self.ui_test.close_dialog_through_button(x"+\ - self.prev_command.ui_button+")\n" - else: - line= double_tab + "self.ui_test.close_dialog_through_button("+\ - self.prev_command.ui_button+")\n" - self.variables.append(line) - self.last_parent.pop() - self.parent_hierarchy_count=self.parent_hierarchy_count-1 + + if( not ( self.flag_for_QuerySaveDialog ) ): + # This part is just to ignore saving the Save dialog while closing the app + + if (self.prev_command.__class__.__name__ == "ButtonUIObject"): + old_line = self.variables.pop() + line="" + if(keyword.iskeyword( self.prev_command.ui_button )): + line= double_tab + "self.ui_test.close_dialog_through_button(x"+\ + self.prev_command.ui_button+")\n" + else: + line= double_tab + "self.ui_test.close_dialog_through_button("+\ + self.prev_command.ui_button+")\n" + self.variables.append(line) + self.last_parent.pop() + self.parent_hierarchy_count=self.parent_hierarchy_count-1 + else: + self.flag_for_QuerySaveDialog=False self.prev_command=DialogCommand def handle_button(self, ButtonUIObject): - name_of_obj="" - if(keyword.iskeyword( ButtonUIObject.ui_button )): - name_of_obj = "x" +ButtonUIObject.ui_button - else: - name_of_obj = ButtonUIObject.ui_button + if( ButtonUIObject.parent_id!="QuerySaveDialog" ): + # This part is just to ignore saving the Save dialog while closing the app - if ButtonUIObject.parent_id == "" : - self.init_Object( name_of_obj , ButtonUIObject.ui_button , self.last_parent[self.parent_hierarchy_count] ) - else: - self.init_Object( name_of_obj , ButtonUIObject.ui_button,ButtonUIObject.parent_id) + name_of_obj="" + if(keyword.iskeyword( ButtonUIObject.ui_button )): + name_of_obj = "x" +ButtonUIObject.ui_button + else: + name_of_obj = ButtonUIObject.ui_button - self.write_line_without_parameters(name_of_obj,"CLICK","tuple") + if ButtonUIObject.parent_id == "" : + self.init_Object( name_of_obj , ButtonUIObject.ui_button , self.last_parent[self.parent_hierarchy_count] ) + else: + self.init_Object( name_of_obj , ButtonUIObject.ui_button,ButtonUIObject.parent_id) + + self.write_line_without_parameters(name_of_obj,"CLICK","tuple") - self.prev_command=ButtonUIObject + self.prev_command=ButtonUIObject def handle_check_box(self, CheckBoxUIObject): |