summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorSaurav Chirania <saurav.chir@gmail.com>2018-06-29 12:33:21 +0530
committerSaurav Chirania <saurav.chir@gmail.com>2018-07-01 15:23:18 +0200
commita4be3ebd4daddab219c347af8583bfbb9d63a843 (patch)
treeb57d625268322d6cc37fca393b79d451bb838188 /uitest
parentd2a9fdda9af20954d16e1bb05e106a384a608351 (diff)
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: Saurav Chirania <saurav.chir@gmail.com>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/loginterpreter.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/uitest/loginterpreter.py b/uitest/loginterpreter.py
index 252fc4bd6c42..efdef95c6473 100644
--- a/uitest/loginterpreter.py
+++ b/uitest/loginterpreter.py
@@ -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)