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 libreoffice
.uno
.propertyvalue
import mkPropertyValues
13 class insertSignatureLine(UITestCase
):
15 def test_insert_signature_line(self
):
16 with self
.ui_test
.create_doc_in_start_center("writer") as document
:
18 # set the signature line
19 with self
.ui_test
.execute_dialog_through_command(".uno:InsertSignatureLine") as xDialog
:
21 xName
= xDialog
.getChild("edit_name")
22 xTitle
= xDialog
.getChild("edit_title")
23 xEmail
= xDialog
.getChild("edit_email")
24 xComment
= xDialog
.getChild("checkbox_can_add_comments")
25 xInstructions
= xDialog
.getChild("edit_instructions")
27 xName
.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
28 xTitle
.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
29 xEmail
.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
30 xComment
.executeAction("CLICK", tuple())
31 xInstructions
.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
33 #check the signature Line in the document
34 element
= document
.DrawPage
[0]
35 self
.assertEqual(element
.SignatureLineSuggestedSignerName
, "Name")
36 self
.assertEqual(element
.SignatureLineSuggestedSignerTitle
, "Title")
37 self
.assertEqual(element
.SignatureLineSuggestedSignerEmail
, "Email")
38 self
.assertEqual(element
.SignatureLineSuggestedSignerTitle
, "Title")
39 self
.assertEqual(element
.SignatureLineCanAddComment
, False)
40 self
.assertEqual(element
.SignatureLineShowSignDate
, True)
41 self
.assertEqual(element
.SignatureLineSigningInstructions
, "Instructions")
43 # vim: set shiftwidth=4 softtabstop=4 expandtab: