diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-24 01:53:06 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-24 02:40:43 +0200 |
commit | 9a89eea4c3c58d2efce8afe709c0317869839ff9 (patch) | |
tree | f235036802674593f9cf6253f2f6363664494233 /sw/qa/uitest/styleInspector | |
parent | 6805efdecb240fad8c82a5c1756a2a0e92f12b7d (diff) |
Revert "uitest: guard create_doc_in_start_center"
This reverts commit 374baf308979306aa35575118c40ccd7caae1e29.
Many uitests are failing randomly in jenkins for no apparent
reason
Change-Id: I5960330fab4967518bfeea32b3b8c5f8bfbea57e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117752
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/styleInspector')
-rw-r--r-- | sw/qa/uitest/styleInspector/tdf137105.py | 48 | ||||
-rw-r--r-- | sw/qa/uitest/styleInspector/tdf137513.py | 66 |
2 files changed, 59 insertions, 55 deletions
diff --git a/sw/qa/uitest/styleInspector/tdf137105.py b/sw/qa/uitest/styleInspector/tdf137105.py index 7b080b3a6485..b0a6b709d1e8 100644 --- a/sw/qa/uitest/styleInspector/tdf137105.py +++ b/sw/qa/uitest/styleInspector/tdf137105.py @@ -9,28 +9,30 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file class tdf137105(UITestCase): def test_tdf137105(self): - with self.ui_test.create_doc_in_start_center("writer"): - xWriterDoc = self.xUITest.getTopFocusWindow() - document = self.ui_test.get_component() - text = document.getText() - cursor = text.createTextCursor() - textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject') - provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider') - graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")})) - textGraphic.Graphic = graphic - text.insertTextContent(cursor, textGraphic, False) - #select image - document.getCurrentController().select(document.getDrawPage()[0]) - - xWriterEdit = xWriterDoc.getChild("writer_edit") - - self.xUITest.executeCommand(".uno:Sidebar") - # Without the fix in place, this test would have crashed here - xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"})) - - # if the image is selected, there is nothing in the panel - self.assertEqual('0', get_state_as_dict(xWriterEdit.getChild('listbox_fonts'))['Children']) - - self.xUITest.executeCommand(".uno:Sidebar") + writer_doc = self.ui_test.create_doc_in_start_center("writer") + xWriterDoc = self.xUITest.getTopFocusWindow() + document = self.ui_test.get_component() + text = document.getText() + cursor = text.createTextCursor() + textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject') + provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider') + graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")})) + textGraphic.Graphic = graphic + text.insertTextContent(cursor, textGraphic, False) + #select image + document.getCurrentController().select(document.getDrawPage()[0]) + + xWriterEdit = xWriterDoc.getChild("writer_edit") + + self.xUITest.executeCommand(".uno:Sidebar") + # Without the fix in place, this test would have crashed here + xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"})) + + # if the image is selected, there is nothing in the panel + self.assertEqual('0', get_state_as_dict(xWriterEdit.getChild('listbox_fonts'))['Children']) + + self.xUITest.executeCommand(".uno:Sidebar") + + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sw/qa/uitest/styleInspector/tdf137513.py b/sw/qa/uitest/styleInspector/tdf137513.py index fedc3d48c569..6c216b40f33a 100644 --- a/sw/qa/uitest/styleInspector/tdf137513.py +++ b/sw/qa/uitest/styleInspector/tdf137513.py @@ -9,48 +9,50 @@ from uitest.uihelper.common import get_state_as_dict, type_text class tdf137513(UITestCase): def test_tdf137513(self): - with self.ui_test.create_doc_in_start_center("writer"): + self.ui_test.create_doc_in_start_center("writer") - self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2") + self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2") - xWriterDoc = self.xUITest.getTopFocusWindow() - xWriterEdit = xWriterDoc.getChild("writer_edit") - type_text(xWriterEdit, "test") + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + type_text(xWriterEdit, "test") - self.xUITest.executeCommand(".uno:SelectAll") + self.xUITest.executeCommand(".uno:SelectAll") - self.xUITest.executeCommand(".uno:Bold") + self.xUITest.executeCommand(".uno:Bold") - self.xUITest.executeCommand(".uno:Sidebar") - xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"})) + self.xUITest.executeCommand(".uno:Sidebar") + xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"})) - xListBox = xWriterEdit.getChild('listbox_fonts') + xListBox = xWriterEdit.getChild('listbox_fonts') - # The cursor is on text inside the table with direct formatting - self.assertEqual(2, len(xListBox.getChild('0').getChildren())) - self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual("Table Contents\t", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text']) - self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren())) + # The cursor is on text inside the table with direct formatting + self.assertEqual(2, len(xListBox.getChild('0').getChildren())) + self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) + self.assertEqual("Table Contents\t", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text']) + self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren())) - xTableContent = xListBox.getChild('0').getChild('1') - self.assertEqual(5, len(xTableContent.getChildren())) - self.assertEqual("Follow Style\tTable Contents", get_state_as_dict(xTableContent.getChild('0'))['Text']) - self.assertEqual("Para Line Number Count\tFalse", get_state_as_dict(xTableContent.getChild('1'))['Text']) - self.assertEqual("Para Line Number Start Value\t0", get_state_as_dict(xTableContent.getChild('2'))['Text']) - self.assertEqual("Para Orphans\t0", get_state_as_dict(xTableContent.getChild('3'))['Text']) - self.assertEqual("Para Widows\t0", get_state_as_dict(xTableContent.getChild('4'))['Text']) + xTableContent = xListBox.getChild('0').getChild('1') + self.assertEqual(5, len(xTableContent.getChildren())) + self.assertEqual("Follow Style\tTable Contents", get_state_as_dict(xTableContent.getChild('0'))['Text']) + self.assertEqual("Para Line Number Count\tFalse", get_state_as_dict(xTableContent.getChild('1'))['Text']) + self.assertEqual("Para Line Number Start Value\t0", get_state_as_dict(xTableContent.getChild('2'))['Text']) + self.assertEqual("Para Orphans\t0", get_state_as_dict(xTableContent.getChild('3'))['Text']) + self.assertEqual("Para Widows\t0", get_state_as_dict(xTableContent.getChild('4'))['Text']) - xParDirFormatting = xListBox.getChild('1') + xParDirFormatting = xListBox.getChild('1') - # Without the fix in place, this test would have failed here with - # AssertionError: 3 != 0 - self.assertEqual(3, len(xParDirFormatting.getChildren())) - self.assertEqual("Char Weight\tBold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text']) - self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text']) - self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text']) - self.assertEqual(0, len(xListBox.getChild('2').getChildren())) - self.assertEqual(0, len(xListBox.getChild('3').getChildren())) + # Without the fix in place, this test would have failed here with + # AssertionError: 3 != 0 + self.assertEqual(3, len(xParDirFormatting.getChildren())) + self.assertEqual("Char Weight\tBold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text']) + self.assertEqual("Char Weight Asian\tBold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text']) + self.assertEqual("Char Weight Complex\tBold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text']) + self.assertEqual(0, len(xListBox.getChild('2').getChildren())) + self.assertEqual(0, len(xListBox.getChild('3').getChildren())) - self.xUITest.executeCommand(".uno:Sidebar") + self.xUITest.executeCommand(".uno:Sidebar") + + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: |