summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/navigator/tdf40427.py
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/uitest/navigator/tdf40427.py')
-rw-r--r--sw/qa/uitest/navigator/tdf40427.py103
1 files changed, 51 insertions, 52 deletions
diff --git a/sw/qa/uitest/navigator/tdf40427.py b/sw/qa/uitest/navigator/tdf40427.py
index 9b125ff941ec..a3aa1dfa8d10 100644
--- a/sw/qa/uitest/navigator/tdf40427.py
+++ b/sw/qa/uitest/navigator/tdf40427.py
@@ -14,68 +14,67 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class tdf40427(UITestCase):
def test_tdf40427(self):
- self.ui_test.load_file(get_url_for_data_file("tdf40427_SectionPositions.odt"))
- xMainWindow = self.xUITest.getTopFocusWindow()
- xWriterEdit = xMainWindow.getChild("writer_edit")
+ with self.ui_test.load_file(get_url_for_data_file("tdf40427_SectionPositions.odt")):
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
- self.assertEqual(2, self.ui_test.get_component().CurrentController.PageCount)
+ self.assertEqual(2, self.ui_test.get_component().CurrentController.PageCount)
- # Make sure that the view is 2 pages side-by-side - look at dialog View-Zoom-Zoom
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Make sure that the view is 2 pages side-by-side - look at dialog View-Zoom-Zoom
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
- columnssb = xDialog.getChild("columnssb")
- columns = xDialog.getChild("columns")
- bookmode = xDialog.getChild("bookmode")
- self.assertEqual("true", get_state_as_dict(columns)["Checked"])
- self.assertEqual("2", get_state_as_dict(columnssb)["Text"])
- self.assertEqual("false", get_state_as_dict(bookmode)["Selected"])
+ columnssb = xDialog.getChild("columnssb")
+ columns = xDialog.getChild("columns")
+ bookmode = xDialog.getChild("bookmode")
+ self.assertEqual("true", get_state_as_dict(columns)["Checked"])
+ self.assertEqual("2", get_state_as_dict(columnssb)["Text"])
+ self.assertEqual("false", get_state_as_dict(bookmode)["Selected"])
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- # In this view, the sections "SectionB" and "SectionC" on second page are positioned on screen
- # higher than "SectionY" and "SectionA" respectively; there are nested and anchored sections.
- # Make sure that order in Navigator follows their relative position in document, not vertical
- # position on screen, nor sorted alphabetically. Sections in flying frames are sorted by their
- # anchor position in the document.
+ # In this view, the sections "SectionB" and "SectionC" on second page are positioned on screen
+ # higher than "SectionY" and "SectionA" respectively; there are nested and anchored sections.
+ # Make sure that order in Navigator follows their relative position in document, not vertical
+ # position on screen, nor sorted alphabetically. Sections in flying frames are sorted by their
+ # anchor position in the document.
- self.xUITest.executeCommand(".uno:Sidebar")
- xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- # wait until the navigator panel is available
- xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
+ # wait until the navigator panel is available
+ xNavigatorPanel = self.ui_test.wait_until_child_is_available('NavigatorPanel')
- xContentTree = xNavigatorPanel.getChild("contenttree")
- xSections = xContentTree.getChild('6')
- self.assertEqual('Sections', get_state_as_dict(xSections)['Text'])
- xSections.executeAction("EXPAND", ())
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xSections = xContentTree.getChild('6')
+ self.assertEqual('Sections', get_state_as_dict(xSections)['Text'])
+ xSections.executeAction("EXPAND", ())
- refSectionNames = [
- 'SectionZ',
- 'SectionY', # SectionB should not get before this, despite its Y position on screen is higher
- 'SectionT3', # Sections in tables go in rows, then across rows
- 'SectionT1',
- 'SectionT2',
- 'SectionT0',
- 'SectionF2', # Goes before SectionF1, because their fly anchors go in that order
- 'SectionF3', # Same as SectionF1, but anchor section is in fly itself
- 'SectionFinF3', # Check order of nested sections inside fly
- 'SectionA',
- 'SectionF1', # Section in fly anchored in a section goes immediately after its anchor section
- 'SectionB', # High on screen, but late in list because it's on second page
- 'SectionC',
- ]
- self.assertEqual(len(refSectionNames), len(xSections.getChildren()))
+ refSectionNames = [
+ 'SectionZ',
+ 'SectionY', # SectionB should not get before this, despite its Y position on screen is higher
+ 'SectionT3', # Sections in tables go in rows, then across rows
+ 'SectionT1',
+ 'SectionT2',
+ 'SectionT0',
+ 'SectionF2', # Goes before SectionF1, because their fly anchors go in that order
+ 'SectionF3', # Same as SectionF1, but anchor section is in fly itself
+ 'SectionFinF3', # Check order of nested sections inside fly
+ 'SectionA',
+ 'SectionF1', # Section in fly anchored in a section goes immediately after its anchor section
+ 'SectionB', # High on screen, but late in list because it's on second page
+ 'SectionC',
+ ]
+ self.assertEqual(len(refSectionNames), len(xSections.getChildren()))
- actSectionNames = []
- for i in range(len(refSectionNames)):
- actSectionNames.append(get_state_as_dict(xSections.getChild(str(i)))['Text'])
- # Without the fix in place, this would fail with
- # AssertionError: Lists differ: ['SectionZ', 'SectionY', 'SectionT3', 'SectionT1', 'SectionT2'[100 chars]onC'] != ['SectionZ', 'SectionB', 'SectionF3', 'SectionFinF3', 'Section[100 chars]onA']
- self.assertEqual(refSectionNames, actSectionNames)
+ actSectionNames = []
+ for i in range(len(refSectionNames)):
+ actSectionNames.append(get_state_as_dict(xSections.getChild(str(i)))['Text'])
+ # Without the fix in place, this would fail with
+ # AssertionError: Lists differ: ['SectionZ', 'SectionY', 'SectionT3', 'SectionT1', 'SectionT2'[100 chars]onC'] != ['SectionZ', 'SectionB', 'SectionF3', 'SectionFinF3', 'Section[100 chars]onA']
+ self.assertEqual(refSectionNames, actSectionNames)
- self.xUITest.executeCommand(".uno:Sidebar")
- self.ui_test.close_doc()
+ self.xUITest.executeCommand(".uno:Sidebar")
# vim: set shiftwidth=4 softtabstop=4 expandtab: