Get the style color and number just once
[LibreOffice.git] / sw / qa / uitest / writer_tests / tdf81457.py
blob8928a2a96b09bfe2d8d12feaa47db2479f028ff2
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
12 from uitest.uihelper.common import select_pos
14 class tdf81457(UITestCase):
16 #tdf 81457
17 def test_open_documentProperties_tdf81457(self):
18 with self.ui_test.load_file(get_url_for_data_file("tdf81457.odt")):
19 with self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties") as xDialog:
20 xTabs = xDialog.getChild("tabcontrol")
21 select_pos(xTabs, "2") #tab Custom properties
23 # tdf#123919 - custom document properties are sorted now
24 aExpectedDocProp = {
25 2: {'aAndra': 'Ja'},
26 4: {'BookMarkCount': '78'},
27 5: {'BookMarkInfo1': '00FF0000FF010'},
28 6: {'BookMarkInfo2': '00FF0000FF030'}}
30 for pos, aDocProp in aExpectedDocProp.items():
31 xNameBox = xDialog.getChild("namebox" + str(pos))
32 xTypeBox = xDialog.getChild("typebox" + str(pos))
33 xValueEdit = xDialog.getChild("valueedit" + str(pos))
34 name, value = aDocProp.popitem()
35 self.assertEqual(name, get_state_as_dict(xNameBox)['Text'])
36 self.assertEqual('Text', get_state_as_dict(xTypeBox)['DisplayText'])
37 self.assertEqual(value, get_state_as_dict(xValueEdit)['Text'][:13])
41 # vim: set shiftwidth=4 softtabstop=4 expandtab: