1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest
.framework
import UITestCase
8 from uitest
.uihelper
.common
import get_state_as_dict
9 from uitest
.uihelper
.common
import select_pos
10 from uitest
.uihelper
.calc
import enter_text_to_cell
11 from libreoffice
.calc
.document
import get_cell_by_position
12 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
13 #Bug 105268 - Auto Fill: The Next Value for "001-001-001" is "001-001-002" Rather than "001-001000"
15 class tdf105268(UITestCase
):
16 def test_tdf105268(self
):
17 calc_doc
= self
.ui_test
.create_doc_in_start_center("calc")
18 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
19 gridwin
= xCalcDoc
.getChild("grid_window")
20 document
= self
.ui_test
.get_component()
21 enter_text_to_cell(gridwin
, "A1", "001-001-001")
22 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
23 self
.ui_test
.execute_dialog_through_command(".uno:FillSeries")
24 xDialog
= self
.xUITest
.getTopFocusWindow()
25 xautofill
= xDialog
.getChild("autofill")
26 xautofill
.executeAction("CLICK", tuple())
27 xOK
= xDialog
.getChild("ok")
28 self
.ui_test
.close_dialog_through_button(xOK
)
29 self
.assertEqual(get_cell_by_position(document
, 0, 0, 0).getString(), "001-001-001")
30 self
.assertEqual(get_cell_by_position(document
, 0, 0, 1).getString(), "001-001-002")
31 self
.assertEqual(get_cell_by_position(document
, 0, 0, 2).getString(), "001-001-003")
33 self
.ui_test
.close_doc()
35 # vim: set shiftwidth=4 softtabstop=4 expandtab: