summaryrefslogtreecommitdiff
path: root/sw/qa/uitest/table/tdf128593.py
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-30 09:50:25 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-30 13:17:33 +0200
commitadf59322c651e8e6740a8d97d963dcf0972bdc54 (patch)
treea6728276e58544f87167a4bbb69a846584596afd /sw/qa/uitest/table/tdf128593.py
parentf7300b2f07f308118967c797206dbc4a1e9a61a4 (diff)
uitest: guard create_doc_in_start_center in sw
Mostly done by a script for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac < UITest: introduce guarded context managers > Change-Id: I513c76fe3536ce2d541b3588ce3f23990a0771be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118145 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/uitest/table/tdf128593.py')
-rwxr-xr-xsw/qa/uitest/table/tdf128593.py33
1 files changed, 16 insertions, 17 deletions
diff --git a/sw/qa/uitest/table/tdf128593.py b/sw/qa/uitest/table/tdf128593.py
index d7413a5ccc5f..435b155f4af7 100755
--- a/sw/qa/uitest/table/tdf128593.py
+++ b/sw/qa/uitest/table/tdf128593.py
@@ -9,25 +9,24 @@ from uitest.uihelper.common import get_state_as_dict
class tdf128593(UITestCase):
def test_tdf128593_table_background_color(self):
- MainDoc = self.ui_test.create_doc_in_start_center("writer")
- MainWindow = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center_guarded("writer"):
+ MainWindow = self.xUITest.getTopFocusWindow()
- with self.ui_test.execute_dialog_through_command(".uno:InsertTable"):
- pass
+ with self.ui_test.execute_dialog_through_command(".uno:InsertTable"):
+ pass
- self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }) )
- with self.ui_test.execute_dialog_through_command(".uno:TableDialog") as TablePropertiesDialog:
- writer_edit = MainWindow.getChild("writer_edit")
- writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "0"}))
- tabcontrol = TablePropertiesDialog.getChild("tabcontrol")
- tabcontrol.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
- Rcustom = TablePropertiesDialog.getChild("R_custom") #255
- self.assertEqual(get_state_as_dict(Rcustom)["Text"], "255")
- Gcustom = TablePropertiesDialog.getChild("G_custom") #255
- self.assertEqual(get_state_as_dict(Gcustom)["Text"], "255")
- Bcustom = TablePropertiesDialog.getChild("B_custom") #0
- self.assertEqual(get_state_as_dict(Bcustom)["Text"], "0")
+ self.xUITest.executeCommandWithParameters(".uno:TableCellBackgroundColor", mkPropertyValues({"TableCellBackgroundColor" : 16776960 }) )
+ with self.ui_test.execute_dialog_through_command(".uno:TableDialog") as TablePropertiesDialog:
+ writer_edit = MainWindow.getChild("writer_edit")
+ writer_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "0"}))
+ tabcontrol = TablePropertiesDialog.getChild("tabcontrol")
+ tabcontrol.executeAction("SELECT", mkPropertyValues({"POS": "4"}))
+ Rcustom = TablePropertiesDialog.getChild("R_custom") #255
+ self.assertEqual(get_state_as_dict(Rcustom)["Text"], "255")
+ Gcustom = TablePropertiesDialog.getChild("G_custom") #255
+ self.assertEqual(get_state_as_dict(Gcustom)["Text"], "255")
+ Bcustom = TablePropertiesDialog.getChild("B_custom") #0
+ self.assertEqual(get_state_as_dict(Bcustom)["Text"], "0")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab: