Kaydet (Commit) a4be3ebd authored tarafından Saurav Chirania's avatar Saurav Chirania

uitest interpreter: add more features

1) Support UNO commands
2) Support closing dialog using buttons
3) Correct keyword for modless dialog
4) Introduce "Redundant Couple" for couples
from which only 1 statement can generate the log.

Change-Id: I3541fea6a0b72de2c03626476b8abb43a7324dab
Reviewed-on: https://gerrit.libreoffice.org/56776
Tested-by: Jenkins
Reviewed-by: 's avatarSaurav Chirania <saurav.chir@gmail.com>
üst d2a9fdda
......@@ -91,9 +91,18 @@ def get_coupling_type(line1, line2):
return "COMMAND_MODAL_COUPLE"
elif action_dict1["keyword"] == "CommandSent" and \
action_dict2["keyword"] == "ModelessDialogExecuted":
action_dict2["keyword"] == "ModelessDialogConstructed":
return "COMMAND_MODELESS_COUPLE"
elif action_dict1["keyword"] == "ButtonUIObject" and \
action_dict2["keyword"] == "DialogClosed":
return "BUTTON_DIALOGCLOSE_COUPLE"
elif "parameters" in action_dict1 and \
"KEYCODE" in action_dict1["parameters"] and \
action_dict2["keyword"] == "CommandSent":
return "REDUNDANT_COUPLE"
return "NOT_A_COUPLE"
def get_test_line_from_one_log_line(log_line):
......@@ -113,6 +122,10 @@ def get_test_line_from_one_log_line(log_line):
else:
test_line += ",tuple())\n"
return test_line
elif action_dict["keyword"] == "CommandSent":
test_line += "self.xUITest.executeCommand(\"" + \
action_dict["Name"] + "\")\n"
return test_line
return ""
......@@ -131,6 +144,11 @@ def get_test_line_from_two_log_lines(log_line1,log_line2):
"self.ui_test.execute_modeless_dialog_through_command(\"" + \
action_dict1["Name"] + "\")\n " + \
action_dict2["Id"] + " = self.xUITest.getTopFocusWindow()\n"
elif coupling_type == "BUTTON_DIALOGCLOSE_COUPLE":
test_line += \
action_dict1["Id"] + " = " + action_dict1["Parent"] + ".getChild(\"" + \
action_dict1["Id"] + "\")\n self.ui_test.close_dialog_through_button(" + \
action_dict1["Id"] + ")\n"
return test_line
def main():
......@@ -144,6 +162,8 @@ def main():
test_line = get_test_line_from_one_log_line(log_lines[line_number])
output_stream.write(test_line)
line_number += 1
elif get_coupling_type(log_lines[line_number],log_lines[line_number + 1]) == "REDUNDANT_COUPLE":
line_number += 1
else:
test_line = get_test_line_from_two_log_lines(log_lines[line_number],log_lines[line_number + 1])
output_stream.write(test_line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment