summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorChenxiong Qi <qcxhome@gmail.com>2023-12-20 20:54:05 +0800
committerHossein <hossein@libreoffice.org>2024-01-23 14:00:46 +0100
commit74de0ebb810f3e13c45f01c63067cb8de794ce3c (patch)
treeb5f069ad74d12b5ce095b4ad9159861fd1445614 /cui
parent3a20c691ab1d6a16ad0fc144926b22c098552be4 (diff)
tdf#97361 Make unittests more pythonic: XIndexAccess
Change-Id: I05ef274dd0ad5dc35b5455cfc01feabc6c0820a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161276 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'cui')
-rw-r--r--cui/qa/uitest/dialogs/chardlg.py6
-rw-r--r--cui/qa/uitest/tabpages/tpcolor.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/cui/qa/uitest/dialogs/chardlg.py b/cui/qa/uitest/dialogs/chardlg.py
index 6da1e21e2162..686cb6472ac8 100644
--- a/cui/qa/uitest/dialogs/chardlg.py
+++ b/cui/qa/uitest/dialogs/chardlg.py
@@ -54,7 +54,7 @@ class Test(UITestCase):
editWin = doc.getChild("impress_win")
# Set theme colors.
- drawPage = component.getDrawPages().getByIndex(0)
+ drawPage = component.getDrawPages()[0]
master = drawPage.MasterPage
theme = mkPropertyValues({
"Name": "nameA",
@@ -98,8 +98,8 @@ class Test(UITestCase):
colorSet.executeAction("CHOOSE", mkPropertyValues({"POS": "16"}))
# Then make sure the doc model has the correct color theme index:
- drawPage = component.getDrawPages().getByIndex(0)
- shape = drawPage.getByIndex(0)
+ drawPage = component.getDrawPages()[0]
+ shape = drawPage[0]
paragraphs = shape.createEnumeration()
paragraph = paragraphs.nextElement()
portions = paragraph.createEnumeration()
diff --git a/cui/qa/uitest/tabpages/tpcolor.py b/cui/qa/uitest/tabpages/tpcolor.py
index 820ffa634eb1..4e7b8261ff83 100644
--- a/cui/qa/uitest/tabpages/tpcolor.py
+++ b/cui/qa/uitest/tabpages/tpcolor.py
@@ -21,7 +21,7 @@ class Test(UITestCase):
doc = self.xUITest.getTopFocusWindow()
editWin = doc.getChild("impress_win")
# Set theme colors.
- drawPage = component.getDrawPages().getByIndex(0)
+ drawPage = component.getDrawPages()[0]
master = drawPage.MasterPage
theme = mkPropertyValues({
"Name": "nameA",
@@ -59,7 +59,7 @@ class Test(UITestCase):
colorSelector.executeAction("CHOOSE", mkPropertyValues({"POS": "4"}))
# Then make sure the doc model is updated accordingly:
- shape = drawPage.getByIndex(0)
+ shape = drawPage[0]
# Without the accompanying fix in place, this test would have failed with:
# AssertionError: -1 != 3
# i.e. the theme metadata of the selected fill color was lost.