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 /cui/qa | |
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 'cui/qa')
-rw-r--r-- | cui/qa/uitest/dialogs/chardlg.py | 139 | ||||
-rw-r--r-- | cui/qa/uitest/dialogs/pastedlg.py | 57 | ||||
-rw-r--r-- | cui/qa/uitest/dialogs/shortcuts.py | 34 |
3 files changed, 118 insertions, 112 deletions
diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py index 01c372ce9780..fb1c1286cbae 100644 --- a/cui/qa/uitest/dialogs/chardlg.py +++ b/cui/qa/uitest/dialogs/chardlg.py @@ -14,87 +14,90 @@ class Test(UITestCase): def testSvxCharEffectsPage(self): # Start Impress. - with self.ui_test.create_doc_in_start_center("impress"): - template = self.xUITest.getTopFocusWindow() - self.ui_test.close_dialog_through_button(template.getChild("close")) - doc = self.xUITest.getTopFocusWindow() - editWin = doc.getChild("impress_win") - # Select the title shape. - editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) - editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) - self.xUITest.executeCommand(".uno:SelectAll") + self.ui_test.create_doc_in_start_center("impress") + template = self.xUITest.getTopFocusWindow() + self.ui_test.close_dialog_through_button(template.getChild("close")) + doc = self.xUITest.getTopFocusWindow() + editWin = doc.getChild("impress_win") + # Select the title shape. + editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) + editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) + self.xUITest.executeCommand(".uno:SelectAll") - # Now use Format -> Character. - self.ui_test.execute_dialog_through_command(".uno:FontDialog") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - # Select RID_SVXPAGE_CHAR_EFFECTS. - select_pos(xTabs, "1") - xFontTransparency = xDialog.getChild("fonttransparencymtr") - for _ in range(5): - xFontTransparency.executeAction("UP", tuple()) - self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) + # Now use Format -> Character. + self.ui_test.execute_dialog_through_command(".uno:FontDialog") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + # Select RID_SVXPAGE_CHAR_EFFECTS. + select_pos(xTabs, "1") + xFontTransparency = xDialog.getChild("fonttransparencymtr") + for _ in range(5): + xFontTransparency.executeAction("UP", tuple()) + self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) - # Verify the result. - component = self.ui_test.get_component() - drawPage = component.getDrawPages().getByIndex(0) - shape = drawPage.getByIndex(0) + # Verify the result. + component = self.ui_test.get_component() + drawPage = component.getDrawPages().getByIndex(0) + shape = drawPage.getByIndex(0) - # Without the accompanying fix in place, this test would have failed with: - # AssertionError: 100 != 5 - # i.e. the dialog did not set transparency to 5%, instead it left the character color at - # COL_AUTO. - self.assertEqual(shape.CharTransparence, 5) + # Without the accompanying fix in place, this test would have failed with: + # AssertionError: 100 != 5 + # i.e. the dialog did not set transparency to 5%, instead it left the character color at + # COL_AUTO. + self.assertEqual(shape.CharTransparence, 5) + self.ui_test.close_doc() def testSvxCharEffectsPageWriter(self): # Start Writer. - with self.ui_test.create_doc_in_start_center("writer"): - doc = self.xUITest.getTopFocusWindow() - editWin = doc.getChild("writer_edit") - # Type a character and select it. - editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) - editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) - self.xUITest.executeCommand(".uno:SelectAll") + self.ui_test.create_doc_in_start_center("writer") + doc = self.xUITest.getTopFocusWindow() + editWin = doc.getChild("writer_edit") + # Type a character and select it. + editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) + editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) + self.xUITest.executeCommand(".uno:SelectAll") - # Now use Format -> Character. - self.ui_test.execute_dialog_through_command(".uno:FontDialog") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - # Select RID_SVXPAGE_CHAR_EFFECTS. - select_pos(xTabs, "1") - xFontTransparency = xDialog.getChild("fonttransparencymtr") - # Without the accompanying fix in place, this test would have failed with: - # AssertionError: 'false' != 'true' - # i.e. the transparency widget was hidden. - self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true") - for _ in range(5): - xFontTransparency.executeAction("UP", tuple()) - self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) + # Now use Format -> Character. + self.ui_test.execute_dialog_through_command(".uno:FontDialog") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + # Select RID_SVXPAGE_CHAR_EFFECTS. + select_pos(xTabs, "1") + xFontTransparency = xDialog.getChild("fonttransparencymtr") + # Without the accompanying fix in place, this test would have failed with: + # AssertionError: 'false' != 'true' + # i.e. the transparency widget was hidden. + self.assertEqual(get_state_as_dict(xFontTransparency)["Visible"], "true") + for _ in range(5): + xFontTransparency.executeAction("UP", tuple()) + self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) - # Verify the result. - component = self.ui_test.get_component() - paragraph = component.Text.createEnumeration().nextElement() + # Verify the result. + component = self.ui_test.get_component() + paragraph = component.Text.createEnumeration().nextElement() - self.assertEqual(paragraph.CharTransparence, 5) + self.assertEqual(paragraph.CharTransparence, 5) + self.ui_test.close_doc() def testSvxCharEffectsPageWriterAutomatic(self): # Start Writer. - with self.ui_test.create_doc_in_start_center("writer"): - doc = self.xUITest.getTopFocusWindow() - editWin = doc.getChild("writer_edit") + self.ui_test.create_doc_in_start_center("writer") + doc = self.xUITest.getTopFocusWindow() + editWin = doc.getChild("writer_edit") - # Use Format -> Character. - self.ui_test.execute_dialog_through_command(".uno:FontDialog") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - # Select RID_SVXPAGE_CHAR_EFFECTS. - select_pos(xTabs, "1") - xFontColorLB = xDialog.getChild("fontcolorlb") - # Without the accompanying fix in place, this test would have failed with: - # AssertionError: 'White' != 'Automatic' - # i.e. the auto color lost its alpha component and appeared as white. - self.assertEqual(get_state_as_dict(xFontColorLB)["Text"], "Automatic") + # Use Format -> Character. + self.ui_test.execute_dialog_through_command(".uno:FontDialog") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + # Select RID_SVXPAGE_CHAR_EFFECTS. + select_pos(xTabs, "1") + xFontColorLB = xDialog.getChild("fontcolorlb") + # Without the accompanying fix in place, this test would have failed with: + # AssertionError: 'White' != 'Automatic' + # i.e. the auto color lost its alpha component and appeared as white. + self.assertEqual(get_state_as_dict(xFontColorLB)["Text"], "Automatic") - self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) + self.ui_test.close_dialog_through_button(xDialog.getChild("ok")) + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/cui/qa/uitest/dialogs/pastedlg.py b/cui/qa/uitest/dialogs/pastedlg.py index f186a28c3e7a..9ac40c55d2b6 100644 --- a/cui/qa/uitest/dialogs/pastedlg.py +++ b/cui/qa/uitest/dialogs/pastedlg.py @@ -14,33 +14,34 @@ class Test(UITestCase): def testGetFormat(self): # Copy a string in Impress. - with self.ui_test.create_doc_in_start_center("impress"): - template = self.xUITest.getTopFocusWindow() - self.ui_test.close_dialog_through_button(template.getChild("close")) - doc = self.xUITest.getTopFocusWindow() - editWin = doc.getChild("impress_win") - # Select the title shape. - editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) - editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) - self.xUITest.executeCommand(".uno:SelectAll") - self.xUITest.executeCommand(".uno:Copy") - - # Now use paste special to see what formats are offered. - self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") - pasteSpecial = self.xUITest.getTopFocusWindow() - formats = pasteSpecial.getChild("list") - entryCount = int(get_state_as_dict(formats)["Children"]) - items = [] - for index in range(entryCount): - entry = formats.getChild(str(index)) - entry.executeAction("SELECT", tuple()) - items.append(get_state_as_dict(formats)["SelectEntryText"]) - - # Make sure there is no RTF vs Richtext duplication. - self.assertTrue("Rich text formatting (RTF)" in items) - self.assertFalse("Rich text formatting (Richtext)" in items) - - # Close the dialog and the document. - self.ui_test.close_dialog_through_button(pasteSpecial.getChild("cancel")) + self.ui_test.create_doc_in_start_center("impress") + template = self.xUITest.getTopFocusWindow() + self.ui_test.close_dialog_through_button(template.getChild("close")) + doc = self.xUITest.getTopFocusWindow() + editWin = doc.getChild("impress_win") + # Select the title shape. + editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) + editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"})) + self.xUITest.executeCommand(".uno:SelectAll") + self.xUITest.executeCommand(".uno:Copy") + + # Now use paste special to see what formats are offered. + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + pasteSpecial = self.xUITest.getTopFocusWindow() + formats = pasteSpecial.getChild("list") + entryCount = int(get_state_as_dict(formats)["Children"]) + items = [] + for index in range(entryCount): + entry = formats.getChild(str(index)) + entry.executeAction("SELECT", tuple()) + items.append(get_state_as_dict(formats)["SelectEntryText"]) + + # Make sure there is no RTF vs Richtext duplication. + self.assertTrue("Rich text formatting (RTF)" in items) + self.assertFalse("Rich text formatting (Richtext)" in items) + + # Close the dialog and the document. + self.ui_test.close_dialog_through_button(pasteSpecial.getChild("cancel")) + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/cui/qa/uitest/dialogs/shortcuts.py b/cui/qa/uitest/dialogs/shortcuts.py index 3b5810757566..8a52ee42315a 100644 --- a/cui/qa/uitest/dialogs/shortcuts.py +++ b/cui/qa/uitest/dialogs/shortcuts.py @@ -13,29 +13,31 @@ from uitest.uihelper.common import get_state_as_dict class Test(UITestCase): def test_tab_navigation(self): - with self.ui_test.create_doc_in_start_center("writer"): - xWriterDoc = self.xUITest.getTopFocusWindow() - xWriterEdit = xWriterDoc.getChild("writer_edit") + self.ui_test.create_doc_in_start_center("writer") + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") - self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog - xDialog = self.xUITest.getTopFocusWindow() + self.ui_test.execute_dialog_through_command(".uno:EditStyle") #open style dialog + xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "0") + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "0") - for i in range(16): - self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i)) + for i in range(16): + self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i)) - xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEDOWN"})) + xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEDOWN"})) - self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], "0") + self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], "0") - for i in reversed(range(16)): - xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEUP"})) + for i in reversed(range(16)): + xTabs.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+PAGEUP"})) - self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i)) + self.assertEqual(get_state_as_dict(xTabs)["CurrPagePos"], str(i)) - xOkBtn = xDialog.getChild("ok") - xOkBtn.executeAction("CLICK", tuple()) + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab: |