summaryrefslogtreecommitdiff
path: root/sfx2/qa
diff options
context:
space:
mode:
authorLaurent Godard <lgodard.libre@laposte.net>2015-09-01 15:28:39 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-02 08:25:18 +0000
commitc94a1fdc4443e11d19d12ac8888d8883f9b9494e (patch)
tree7df1a17c1fc62eb7a2ae78cbd5cf7d4f7cc6961d /sfx2/qa
parent043cd5a5cd88ffb01dbf974e77b7ee60a038d8d5 (diff)
sideber uno api test less dependant to panels order
Change-Id: I3a4ef006becbce70897505a6f3367c4b004e13b0 Reviewed-on: https://gerrit.libreoffice.org/18239 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sfx2/qa')
-rw-r--r--sfx2/qa/python/check_sidebar.py33
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()