[Libreoffice-commits] core.git: sd/source uitest/impress_tests
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Dec 16 18:55:14 UTC 2020
sd/source/ui/uitest/uiobject.cxx | 2 +-
uitest/impress_tests/start.py | 14 +++++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
New commits:
commit e4fd4e9489ea3433b913e2774ea0bacac93bee5b
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Dec 16 16:16:58 2020 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Dec 16 19:54:26 2020 +0100
uitest: sd: fix GOTO
pages count starts from 0
Change-Id: I31ce182af1bccf9b129e9c0f2f409ee81419902b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107840
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sd/source/ui/uitest/uiobject.cxx b/sd/source/ui/uitest/uiobject.cxx
index 0b67f75c0ba2..87e9a137fcaa 100644
--- a/sd/source/ui/uitest/uiobject.cxx
+++ b/sd/source/ui/uitest/uiobject.cxx
@@ -110,7 +110,7 @@ void ImpressWindowUIObject::execute(const OUString& rAction, const StringMap& rP
auto itr = rParameters.find("PAGE");
OUString aVal = itr->second;
sal_Int32 nVal = aVal.toInt32();
- getViewShell(mxWindow)->SwitchPage(nVal);
+ getViewShell(mxWindow)->SwitchPage(nVal - 1);
}
}
else if (rAction == "SELECT")
diff --git a/uitest/impress_tests/start.py b/uitest/impress_tests/start.py
index de7a6ece7247..cf3610af3ab0 100644
--- a/uitest/impress_tests/start.py
+++ b/uitest/impress_tests/start.py
@@ -6,13 +6,9 @@
#
from uitest.uihelper.common import get_state_as_dict
-
from libreoffice.uno.propertyvalue import mkPropertyValues
-
from uitest.framework import UITestCase
-import time
-
class SimpleImpressTest(UITestCase):
def test_start_impress(self):
@@ -41,7 +37,15 @@ class SimpleImpressTest(UITestCase):
xEditWin = xImpressDoc.getChild("impress_win")
- xEditWin.executeAction("GOTO", mkPropertyValues({"PAGE": "2"}))
+ self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "1")
+
+ self.xUITest.executeCommand(".uno:InsertPage")
+
+ self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "2")
+
+ xEditWin.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
+
+ self.assertEqual(get_state_as_dict(xEditWin)["CurrentSlide"], "1")
self.ui_test.close_doc()
More information about the Libreoffice-commits
mailing list