diff options
Diffstat (limited to 'sfx2/qa/python/check_sidebar.py')
-rw-r--r-- | sfx2/qa/python/check_sidebar.py | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py index 26a76bd23c1c..7599e4dbb179 100644 --- a/sfx2/qa/python/check_sidebar.py +++ b/sfx2/qa/python/check_sidebar.py @@ -96,7 +96,7 @@ class CheckSidebar(unittest.TestCase): panelsCount = xPanels.getCount() self.assertEqual ( panelsCount, 5 ) - firstPanelName = "StylesPropertyPanel" + firstPanelName = self.getFirstPanel(xPanels) panelElementNames = xPanels.getElementNames() assert ( firstPanelName in panelElementNames ) @@ -110,10 +110,7 @@ class CheckSidebar(unittest.TestCase): xPanel.setTitle(newTitle) assert ( xPanel.getTitle() == newTitle ) - xPanel.moveFirst() initialIndex = xPanel.getOrderIndex() - assert ( initialIndex == 100 ) - xPanel.moveLast() assert ( xPanel.getOrderIndex() > initialIndex ) @@ -132,7 +129,9 @@ class CheckSidebar(unittest.TestCase): xPanel.collapse() assert( not xPanel.isExpanded() ) - otherPanel = xPanels.getByName("NumberFormatPropertyPanel") + lastPanelName = self.getLastPanel(xPanels) + + otherPanel = xPanels.getByName(lastPanelName) otherPanel.expand(False) assert( otherPanel.isExpanded() ) @@ -143,6 +142,30 @@ class CheckSidebar(unittest.TestCase): # close the document xDoc.dispose() + def getFirstPanel(self, xPanels): + + panelName = "" + curIndex = 10000 + + for panel in xPanels: + if panel.getOrderIndex() < curIndex: + panelName = panel.getId() + curIndex = panel.getOrderIndex() + + return panelName + + def getLastPanel(self, xPanels): + + panelName = "" + curIndex = 0 + + for panel in xPanels: + if panel.getOrderIndex() > curIndex: + panelName = panel.getId() + curIndex = panel.getOrderIndex() + + return panelName + if __name__ == "__main__": unittest.main() |