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 type_text
13 class insertQrCode(UITestCase
):
15 def test_insert_qr_code(self
):
16 with self
.ui_test
.create_doc_in_start_center("writer") as document
:
18 with self
.ui_test
.execute_dialog_through_command(".uno:InsertQrCode") as xDialog
:
20 # Get elements in the Dialog Box
21 xURL
= xDialog
.getChild("edit_text")
22 xECC_Low
= xDialog
.getChild("button_low") #How radio button input is written in text.
23 xBorder
= xDialog
.getChild("edit_margin")
25 type_text(xURL
, "www.libreoffice.org") #set the QR code
26 xECC_Low
.executeAction("CLICK", tuple())
27 xBorder
.executeAction("UP", tuple())
28 xBorder
.executeAction("DOWN", tuple())
30 # check the QR code in the document
31 element
= document
.DrawPage
[0]
32 self
.assertEqual(element
.BarCodeProperties
.Payload
, "www.libreoffice.org")
33 self
.assertEqual(element
.BarCodeProperties
.ErrorCorrection
, 1)
34 self
.assertEqual(element
.BarCodeProperties
.Border
, 1)
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: