[Libreoffice-commits] core.git: uitest/loginterpreter.py

Saurav Chirania saurav.chir at gmail.com
Mon Jul 2 04:45:05 UTC 2018


 uitest/loginterpreter.py |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit ad511ce89c3ceddd3a8c6d650ce81df1e35bc48f
Author: Saurav Chirania <saurav.chir at gmail.com>
Date:   Mon Jul 2 08:46:06 2018 +0530

    uitest interpreter: add support for starting apps
    
    Change-Id: Iaab98515d2046aaff1e3da4f80de192ebc01a9eb
    Reviewed-on: https://gerrit.libreoffice.org/56789
    Tested-by: Jenkins
    Reviewed-by: Saurav Chirania <saurav.chir at gmail.com>

diff --git a/uitest/loginterpreter.py b/uitest/loginterpreter.py
index 9da08dd0acb9..ccc805056a7b 100644
--- a/uitest/loginterpreter.py
+++ b/uitest/loginterpreter.py
@@ -98,12 +98,27 @@ def get_coupling_type(line1, line2):
 
     return "NOT_A_COUPLE"
 
+def check_app_starting_action(action_dict):
+    app_starter_button_ids = \
+    set(["draw_all", "impress_all", "calc_all" , "writer_all", "database_all", "math_all"])
+
+    if action_dict["keyword"] == "ButtonUIObject" and action_dict["Action"] == "CLICK" and \
+    action_dict["Id"] in app_starter_button_ids:
+        return True
+    return False
+
 def get_test_line_from_one_log_line(log_line):
     action_dict = parse_line(log_line)
     test_line = "        "
     if action_dict["keyword"].endswith("UIObject"):
         parent = action_dict["Parent"]
-        if (parent != ""):
+        if (check_app_starting_action(action_dict)):
+            test_line +=\
+            "MainDoc = self.ui_test.create_doc_in_start_center(\"" + \
+            action_dict["Id"][:-4] +"\")\n        MainWindow = " + \
+            "self.xUITest.getTopFocusWindow()\n"
+            return test_line
+        elif (parent != ""):
             test_line += \
             action_dict["Id"] + " = " + parent + ".getChild(\"" + \
             action_dict["Id"] + "\")\n        " + \


More information about the Libreoffice-commits mailing list