sfx2/qa/python/check_sidebar.py | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-)
New commits: commit c94a1fdc4443e11d19d12ac8888d8883f9b9494e Author: Laurent Godard <lgodard.li...@laposte.net> Date: Tue Sep 1 15:28:39 2015 +0200 sideber uno api test less dependant to panels order Change-Id: I3a4ef006becbce70897505a6f3367c4b004e13b0 Reviewed-on: https://gerrit.libreoffice.org/18239 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sfx2/qa/python/check_sidebar.py b/sfx2/qa/python/check_sidebar.py index 26a76bd..7599e4d 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() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits