From 9a067900cccebe092e71d2dc540aaf0da3c7f091 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 17 Jul 2016 17:12:56 +0200 Subject: [PATCH] uitest: add a complex math test Change-Id: Ib246c3041f066ecedd1ebbe564566a1824d293bc --- uitest/math_tests/start.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py index 5b11ae768e79..66262072b255 100644 --- a/uitest/math_tests/start.py +++ b/uitest/math_tests/start.py @@ -11,8 +11,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.framework import UITestCase -import time -import unittest +from uitest.debug import sleep class SimpleMathTest(UITestCase): @@ -62,4 +61,29 @@ class SimpleMathTest(UITestCase): self.ui_test.close_doc() + def test_complete_math(self): + self.ui_test.create_doc_in_start_center("math") + + xMathDoc = self.xUITest.getTopFocusWindow() + + xList = xMathDoc.getChild("listbox") + state = get_state_as_dict(xList) + self.assertEqual(state["SelectEntryText"], "Unary/Binary Operators") + xList.executeAction("SELECT", mkPropertyValues({"POS": "1"})) + + xMathSelector = xMathDoc.getChild("element_selector") + + xElement = xMathSelector.getChild("1") + xElement.executeAction("SELECT", tuple()) + + xMathEdit = xMathDoc.getChild("math_edit") + xMathEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"1"})) + xMathEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"})) + xMathEdit.executeAction("TYPE", mkPropertyValues({"TEXT":"2"})) + + edit_state = get_state_as_dict(xMathEdit) + self.assertEqual("1 <> 2 ", edit_state["Text"]) + + self.ui_test.close_doc() + # vim:set shiftwidth=4 softtabstop=4 expandtab: */