• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python common.get_state_as_dict函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中uitest.uihelper.common.get_state_as_dict函数的典型用法代码示例。如果您正苦于以下问题:Python get_state_as_dict函数的具体用法?Python get_state_as_dict怎么用?Python get_state_as_dict使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_state_as_dict函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_tdf119462_find_format

    def test_tdf119462_find_format(self):
        writer_doc = self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()
        xWriterEdit = xWriterDoc.getChild("writer_edit")
        #1. Choose Edit > Find & Replace
        self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        #2. Choose Format
        format = xDialog.getChild("format")
        def handle_format_dlg(dialog):

            #3. Choose Bold
            xTabs = dialog.getChild("tabcontrol")
            select_pos(xTabs, "0")
            xweststylelbcjk = dialog.getChild("weststylelb-cjk")
            xweststylelbcjk.executeAction("TYPE", mkPropertyValues({"TEXT":"Bold"}))
            xOkBtn = dialog.getChild("ok")
            self.ui_test.close_dialog_through_button(xOkBtn)

        self.ui_test.execute_blocking_action(format.executeAction, args=('CLICK', ()),
                dialog_handler=handle_format_dlg)
        #verify label searchdesc
        searchdesc = xDialog.getChild("searchdesc")
        self.assertEqual(get_state_as_dict(searchdesc)["Text"], "bold")
        noformat = xDialog.getChild("noformat")
        noformat.executeAction("CLICK", tuple())   #click No format button
        self.assertEqual(get_state_as_dict(searchdesc)["Text"], "")
        xcloseBtn = xDialog.getChild("close")
        self.ui_test.close_dialog_through_button(xcloseBtn)

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:32,代码来源:tdf119462.py


示例2: test_master_elements

   def test_master_elements(self):
        self.ui_test.create_doc_in_start_center("impress")
        xTemplateDlg = self.xUITest.getTopFocusWindow()
        xCancelBtn = xTemplateDlg.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCancelBtn)
        document = self.ui_test.get_component()

        self.ui_test.execute_dialog_through_command(".uno:MasterLayouts")
        xDialog = self.xUITest.getTopFocusWindow()

        xpagenumber = xDialog.getChild("pagenumber")
        xfooter = xDialog.getChild("footer")
        datetime = xDialog.getChild("datetime")
        xpagenumber.executeAction("CLICK", tuple())
        xfooter.executeAction("CLICK", tuple())
        datetime.executeAction("CLICK", tuple())

        xOKButton = xDialog.getChild("ok")
        xOKButton.executeAction("CLICK", tuple())

        #verify
        self.ui_test.execute_dialog_through_command(".uno:MasterLayouts")
        xDialog = self.xUITest.getTopFocusWindow()
        xfooter = xDialog.getChild("footer")
        datetime = xDialog.getChild("datetime")
        xpagenumber = xDialog.getChild("pagenumber")

        self.assertEqual(get_state_as_dict(xfooter)["Selected"], "false")
        self.assertEqual(get_state_as_dict(datetime)["Selected"], "false")
        self.assertEqual(get_state_as_dict(xpagenumber)["Selected"], "false")

        xOKButton = xDialog.getChild("ok")
        xOKButton.executeAction("CLICK", tuple())

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:35,代码来源:masterElements.py


示例3: testGetFormat

    def testGetFormat(self):
        # Copy a string in Impress.
        self.ui_test.create_doc_in_start_center("impress")
        template = self.xUITest.getTopFocusWindow()
        self.ui_test.close_dialog_through_button(template.getChild("cancel"))
        doc = self.xUITest.getTopFocusWindow()
        editWin = doc.getChild("impress_win")
        # Select the title shape.
        editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
        editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
        self.xUITest.executeCommand(".uno:SelectAll")
        self.xUITest.executeCommand(".uno:Copy")

        # Now use paste special to see what formats are offered.
        self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
        pasteSpecial = self.xUITest.getTopFocusWindow()
        formats = pasteSpecial.getChild("list")
        entryCount = int(get_state_as_dict(formats)["EntryCount"])
        items = []
        for index in range(entryCount):
            formats.executeAction("SELECT", mkPropertyValues({"POS": str(index)}))
            items.append(get_state_as_dict(formats)["SelectEntryText"])

        # Make sure there is no RTF vs Richtext duplication.
        self.assertTrue("Rich text formatting (RTF)" in items)
        self.assertFalse("Rich text formatting (Richtext)" in items)

        # Close the dialog and the document.
        self.ui_test.close_dialog_through_button(pasteSpecial.getChild("cancel"))
        self.ui_test.close_doc()
开发者ID:chrissherlock,项目名称:libreoffice-experimental,代码行数:30,代码来源:pastedlg.py


示例4: test_track_headings_outline

    def test_track_headings_outline(self):
        writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf114724.odt"))
        xWriterDoc = self.xUITest.getTopFocusWindow()
        xWriterEdit = xWriterDoc.getChild("writer_edit")

        self.xUITest.executeCommand(".uno:Sidebar")
        xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))

        xNavigatorPanel = xWriterEdit.getChild("NavigatorPanel")
        xNavigatorPanel.executeAction("ROOT", tuple())

        xWriterEdit.executeAction("FOCUS", tuple())
        time.sleep(2)
        self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
        for _ in range(0,3):
            xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
            time.sleep(2)
            self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
        for _ in range(0,3):
            xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
            time.sleep(2)
            self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")

        self.xUITest.executeCommand(".uno:Sidebar")
        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:25,代码来源:tdf114724.py


示例5: test_insert_horizontal_line

    def test_insert_horizontal_line(self):
        self.ui_test.create_doc_in_start_center("writer")
        xWriterDoc = self.xUITest.getTopFocusWindow()
        xWriterEdit = xWriterDoc.getChild("writer_edit")

        type_text(xWriterEdit, "Test horizontal line")     #write the text

        self.xUITest.executeCommand(".uno:StyleApply?Style:string=Horizontal%20Line&FamilyName:string=ParagraphStyles") #insert horizontal line

        self.ui_test.execute_dialog_through_command(".uno:EditStyle")  #open style dialog
        xDialog = self.xUITest.getTopFocusWindow()
        xStyleNametxt = xDialog.getChild("namerw")
        self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
        xCancBtn = xDialog.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCancBtn)

        self.xUITest.executeCommand(".uno:Undo")
        self.xUITest.executeCommand(".uno:Redo")

        self.ui_test.execute_dialog_through_command(".uno:EditStyle")  #open style dialog
        xDialog = self.xUITest.getTopFocusWindow()
        xStyleNametxt = xDialog.getChild("namerw")
        self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line")  #check style name
        xCancBtn = xDialog.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCancBtn)

        self.ui_test.close_doc()
开发者ID:chrissherlock,项目名称:libreoffice-experimental,代码行数:27,代码来源:horizontalLine.py


示例6: test_tdf122449_crash_edit_index_entry

    def test_tdf122449_crash_edit_index_entry(self):
        writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf122449.odt"))
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()
        xWriterEdit = xWriterDoc.getChild("writer_edit")
        #search word Autocorrect (second find)   .uno:SearchDialog
        self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
        xDialog = self.xUITest.getTopFocusWindow()

        searchterm = xDialog.getChild("searchterm")
        searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"Autocorrection"}))
        xsearch = xDialog.getChild("search")
        xsearch.executeAction("CLICK", tuple())  #first search
        xsearch.executeAction("CLICK", tuple())  #2nd search
        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "6")
        xcloseBtn = xDialog.getChild("close")
        self.ui_test.close_dialog_through_button(xcloseBtn)
        xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"}))
        # invoke Index dialog Index entry   .uno:IndexEntryDialog
        self.ui_test.execute_dialog_through_command(".uno:IndexEntryDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xcloseBtn = xDialog.getChild("close")
        self.ui_test.close_dialog_through_button(xcloseBtn)
        # close
        # Go to page 2
        self.ui_test.execute_dialog_through_command(".uno:GotoPage")
        xDialog = self.xUITest.getTopFocusWindow()
        xPageText = xDialog.getChild("page")
        xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
        xOkBtn = xDialog.getChild("ok")
        xOkBtn.executeAction("CLICK", tuple())
        # verify
        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:35,代码来源:tdf122449.py


示例7: test_row_hide_show

    def test_row_hide_show(self):
        calc_doc = self.ui_test.create_doc_in_start_center("calc")
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        #select A3
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
        self.xUITest.executeCommand(".uno:HideRow") #uno command moves focus one cell down
        #verify A4
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "3")
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
        #verify A2 (row 3 is hidden)
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "1")
        #Show hidden row: select A2:A4
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A4"}))
        self.xUITest.executeCommand(".uno:ShowRow")
        #verify
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"}))
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "3")
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
        #verify A3 (row 3 is not hidden)
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "2")

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:28,代码来源:rows.py


示例8: test_down

    def test_down(self):

        self.ui_test.create_doc_in_start_center("calc")

        self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
        xCellsDlg = self.xUITest.getTopFocusWindow()

        # select the numbers tab page
        select_pos(xCellsDlg, "0")
        
        xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
        xDecimalPlaces.executeAction("UP", tuple())
        xDecimalPlaces.executeAction("UP", tuple())

        decimal_places_state = get_state_as_dict(xDecimalPlaces)
        assert(decimal_places_state["Text"] == "3")
        
        xDecimalPlaces.executeAction("DOWN", tuple())

        decimal_places_state = get_state_as_dict(xDecimalPlaces)
        assert(decimal_places_state["Text"] == "2")

        okBtn = xCellsDlg.getChild("ok")
        self.ui_test.close_dialog_through_button(okBtn)

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:26,代码来源:spinfield.py


示例9: test_column_hide_show

    def test_column_hide_show(self):
        calc_doc = self.ui_test.create_doc_in_start_center("calc")
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        #select A3
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
        self.xUITest.executeCommand(".uno:HideColumn") #uno command moves focus one cell down
        #verify D1
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentColumn"], "3")
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
        #verify B (column C is hidden)
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentColumn"], "1")
        #Show hidden column: select B1:D1
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:D1"}))
        self.xUITest.executeCommand(".uno:ShowColumn")
        #verify
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentColumn"], "3")
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
        #verify C1 (COlumn C is not hidden)
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentColumn"], "2")

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:28,代码来源:columns.py


示例10: test_search_filter

    def test_search_filter(self):
        self.ui_test.create_doc_in_start_center("writer")
        self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog")
        xDialog = self.xUITest.getTopFocusWindow()

        xfunc = xDialog.getChild("functions")
        xSearch = xDialog.getChild("searchEntry")

        initialEntryCount = get_state_as_dict(xfunc)["Children"]
        self.assertTrue(initialEntryCount is not 0)

        xSearch.executeAction("SET", mkPropertyValues({"TEXT":"format"}))

        # Wait for the search/filter op to be completed
        time.sleep(1)

        filteredEntryCount = get_state_as_dict(xfunc)["Children"]
        self.assertTrue(filteredEntryCount < initialEntryCount)

        xSearch.executeAction("CLEAR", tuple())

        # Wait for the search/filter op to be completed
        time.sleep(1)

        finalEntryCount = get_state_as_dict(xfunc)["Children"]
        self.assertEqual(initialEntryCount, finalEntryCount)


        xcancBtn = xDialog.getChild("cancel")  #button Cancel
        xcancBtn.executeAction("CLICK", tuple())  #click the button

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:32,代码来源:customizeDialog.py


示例11: test_exchange_database2

    def test_exchange_database2(self):

        self.ui_test.create_doc_in_start_center("writer")

        self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
        xExDBDlg = self.xUITest.getTopFocusWindow()
        xTreelist = xExDBDlg.getChild("availablelb")

        xLabeldb = xExDBDlg.getChild("dbnameft")
        self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "[None]")

        xTreeEntry = xTreelist.getChild('0')                 #Available Databases
        xTreeEntry.executeAction("EXPAND", tuple())          #Click on the Bibliography
        xTreeEntry.executeAction("COLLAPSE", tuple())
        xTreeEntry.executeAction("EXPAND", tuple())
        xTreeEntry2 = xTreeEntry.getChild('0')                 #Available Databases
        xTreeEntry2.executeAction("SELECT", tuple())          #Click on the biblio

        xDefineBtn = xExDBDlg.getChild("ok")
        xDefineBtn.executeAction("CLICK", tuple())

        self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
        xExDBDlg = self.xUITest.getTopFocusWindow()
        xLabeldb = xExDBDlg.getChild("dbnameft")
        self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "Bibliography.biblio")

        xCloseBtn = xExDBDlg.getChild("close")
        self.ui_test.close_dialog_through_button(xCloseBtn)

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:30,代码来源:exchangeDatabase.py


示例12: test_tdf62267

    def test_tdf62267(self):
        calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf62267.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()

        #* Copy A1, then paste special to C1;
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        self.xUITest.executeCommand(".uno:Copy")
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
        self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
        xDialog = self.xUITest.getTopFocusWindow()
        #it's the default - text, numbers and dates
        xOkBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOkBtn)

        #--> Cell formatting should stay as before
        self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")

        xCondFormatMgr = self.xUITest.getTopFocusWindow()

        # check that we have exactly 1 conditional format
        xList = xCondFormatMgr.getChild("CONTAINER")
        list_state = get_state_as_dict(xList)
        self.assertEqual(list_state['Children'], '1')

        xTreeEntry = xList.getChild('0')
        self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1\tCell value is = 1")

        xCancelBtn = xCondFormatMgr.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCancelBtn)

        self.ui_test.close_doc()

# vim: set shiftwidth=4 softtabstop=4 expandtab:
开发者ID:LibreOffice,项目名称:core,代码行数:35,代码来源:tdf62267.py


示例13: test_tdf98417_find_previous_writer

    def test_tdf98417_find_previous_writer(self):
        writer_doc = self.ui_test.load_file(get_url_for_data_file("findReplace.odt"))
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()
        xWriterEdit = xWriterDoc.getChild("writer_edit")
        self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
        xDialog = self.xUITest.getTopFocusWindow()

        searchterm = xDialog.getChild("searchterm")
        searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"third"}))
        xsearch = xDialog.getChild("search")
        xsearch.executeAction("CLICK", tuple())
        #verify
        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3")
        xsearch.executeAction("CLICK", tuple())
        #verify
        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "4")   #page 4
        backsearch = xDialog.getChild("backsearch")
        backsearch.executeAction("CLICK", tuple())
        #verify
        self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3")

        xcloseBtn = xDialog.getChild("close")
        self.ui_test.close_dialog_through_button(xcloseBtn)

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:26,代码来源:findReplace.py


示例14: test_tdf55712

   def test_tdf55712(self):
        calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf55712.ods"))
        document = self.ui_test.get_component()
        calcDoc = self.xUITest.getTopFocusWindow()
        xGridWindow = calcDoc.getChild("grid_window")

        xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
        xFloatWindow = self.xUITest.getFloatWindow()
        xTreeList = xFloatWindow.getChild("check_list_box")
        x1Entry = xTreeList.getChild("0")
        x2Entry = xTreeList.getChild("1")
        x3Entry = xTreeList.getChild("2")
        x4Entry = xTreeList.getChild("3")
        x5Entry = xTreeList.getChild("4")
        x6Entry = xTreeList.getChild("5")
        x7Entry = xTreeList.getChild("6")
        x8Entry = xTreeList.getChild("7")
        x9Entry = xTreeList.getChild("8")

        self.assertEqual(get_state_as_dict(x1Entry)["Text"], "0")
        self.assertEqual(get_state_as_dict(x2Entry)["Text"], "0.1")
        self.assertEqual(get_state_as_dict(x3Entry)["Text"], "0.2")
        self.assertEqual(get_state_as_dict(x4Entry)["Text"], "0.3")
        self.assertEqual(get_state_as_dict(x5Entry)["Text"], "0.5")
        self.assertEqual(get_state_as_dict(x6Entry)["Text"], "0.8")
        self.assertEqual(get_state_as_dict(x7Entry)["Text"], "0.9")
        self.assertEqual(get_state_as_dict(x8Entry)["Text"], "1")
        self.assertEqual(get_state_as_dict(x9Entry)["Text"], "(empty)")
        self.assertEqual(get_state_as_dict(xTreeList)["Children"], "9")

        xCancel = xFloatWindow.getChild("cancel")
        xCancel.executeAction("CLICK", tuple())

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:34,代码来源:autofilterBugs.py


示例15: test_tdf123479_Crash_ScFormulaResult_GetMatrixFormulaCellToken

    def test_tdf123479_Crash_ScFormulaResult_GetMatrixFormulaCellToken(self):
        #numberingformatpage.ui
        calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf123479.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        #Select D14:D16
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D14:D16"}))
        #Open Formula Wizard (Ctrl+F2)
        self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        edArg1 = xDialog.getChild("ED_ARG1")
        edArg2 = xDialog.getChild("ED_ARG2")
        formulaRes = xDialog.getChild("formula_result")

        #check formula wizard data
        self.assertEqual(get_state_as_dict(edArg1)["Text"], "CHAR(10)")
        self.assertEqual(get_state_as_dict(edArg2)["Text"], "OFFSET($Data.$A$2:$Data.$A$4,0,COLUMN()-3)")
        self.assertEqual(get_state_as_dict(formulaRes)["Text"], "{4;4;4}")

        xOk = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOk)
        #verify; no crashes
        self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Pass/Fail")

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:26,代码来源:tdf123479.py


示例16: test_tdf92423_text_to_columns

    def test_tdf92423_text_to_columns(self):
        calc_doc = self.ui_test.create_doc_in_start_center("calc")
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()

        #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
        self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")  #optionsdialog
        xDialogOpt = self.xUITest.getTopFocusWindow()

        xPages = xDialogOpt.getChild("pages")
        xWriterEntry = xPages.getChild('3')                 # Calc
        xWriterEntry.executeAction("EXPAND", tuple())
        xWriterGeneralEntry = xWriterEntry.getChild('0')
        xWriterGeneralEntry.executeAction("SELECT", tuple())          #General / replwarncb
        xreplwarncb = xDialogOpt.getChild("replwarncb")
        if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
            xreplwarncb.executeAction("CLICK", tuple())
        xOKBtn = xDialogOpt.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #enter data
        enter_text_to_cell(gridwin, "A1", "1;2")
        enter_text_to_cell(gridwin, "A2", "2;3")
        enter_text_to_cell(gridwin, "A3", "3;4")
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
        #copy data
        self.xUITest.executeCommand(".uno:Copy")
        #move down
        self.xUITest.executeCommand(".uno:GoDown")
        self.xUITest.executeCommand(".uno:GoDown")
        self.xUITest.executeCommand(".uno:GoDown")
        self.xUITest.executeCommand(".uno:GoDown")
        self.xUITest.executeCommand(".uno:GoDown")
        self.xUITest.executeCommand(".uno:GoDown")
        #paste data, should be selected
        self.xUITest.executeCommand(".uno:Paste") #A7:A9
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A7:Sheet1.A9")
        # Data - Text to Columns
        self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
        xDialog = self.xUITest.getTopFocusWindow()
        xSemicolon = xDialog.getChild("semicolon")  #check semicolon checkbox
        if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
            xSemicolon.executeAction("CLICK", tuple())
        # Click Ok
        xOK = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOK)

        #Verify
        self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 1)
        self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 2)
        self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 3)
        self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 2)
        self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 3)
        self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 4)

        self.ui_test.close_doc()

# vim: set shiftwidth=4 softtabstop=4 expandtab:
开发者ID:LibreOffice,项目名称:core,代码行数:59,代码来源:tdf92423.py


示例17: test_clear_cells_formats

    def test_clear_cells_formats(self):
        calc_doc = self.ui_test.create_doc_in_start_center("calc")
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        enter_text_to_cell(gridwin, "A1", "aa")
        enter_text_to_cell(gridwin, "A2", "1")

        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
        self.xUITest.executeCommand(".uno:Bold")
        self.ui_test.execute_dialog_through_command(".uno:Delete")
        xDialog = self.xUITest.getTopFocusWindow()
        xdeleteall = xDialog.getChild("deleteall")
        xtext = xDialog.getChild("text")
        xdatetime = xDialog.getChild("datetime")
        xcomments = xDialog.getChild("comments")
        xobjects = xDialog.getChild("objects")
        xnumbers = xDialog.getChild("numbers")
        xformulas = xDialog.getChild("formulas")
        xformats = xDialog.getChild("formats")

        if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
            xdeleteall.executeAction("CLICK", tuple())
        if (get_state_as_dict(xtext)["Selected"]) == "true":
            xtext.executeAction("CLICK", tuple())
        if (get_state_as_dict(xdatetime)["Selected"]) == "true":
            xdatetime.executeAction("CLICK", tuple())
        if (get_state_as_dict(xcomments)["Selected"]) == "true":
            xcomments.executeAction("CLICK", tuple())
        if (get_state_as_dict(xobjects)["Selected"]) == "true":
            xobjects.executeAction("CLICK", tuple())
        if (get_state_as_dict(xnumbers)["Selected"]) == "true":
            xnumbers.executeAction("CLICK", tuple())
        if (get_state_as_dict(xformulas)["Selected"]) == "true":
            xformulas.executeAction("CLICK", tuple())
        if (get_state_as_dict(xformats)["Selected"]) == "false":
            xformats.executeAction("CLICK", tuple())

        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #Verify
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "1")  #tab Font

        xstylelb = xDialog.getChild("weststylelb-cjk")
        print(get_state_as_dict(xstylelb))


        self.assertEqual(get_state_as_dict(xstylelb)["Text"], "Regular")

        xOK = xDialog.getChild("ok")
        xOK.executeAction("CLICK", tuple())

        self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:57,代码来源:clearCells.py


示例18: test_bullets_and_numbering_dialog_tab_position

   def test_bullets_and_numbering_dialog_tab_position(self):
        self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()
        xWriterEdit = xWriterDoc.getChild("writer_edit")

        self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")  #optionsdialog
        xDialog = self.xUITest.getTopFocusWindow()
        xPages = xDialog.getChild("pages")
        xWriterEntry = xPages.getChild('3')                 # Writer
        xWriterEntry.executeAction("EXPAND", tuple())
        xWriterGeneralEntry = xWriterEntry.getChild('0')
        xWriterGeneralEntry.executeAction("SELECT", tuple())          #General - set millimeters
        xMetric = xDialog.getChild("metric")
        props = {"TEXT": "Millimeter"}
        actionProps = mkPropertyValues(props)
        xMetric.executeAction("SELECT", actionProps)
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")
        xalignedatmf = xDialog.getChild("alignedatmf")
        xnum2alignlb = xDialog.getChild("num2alignlb")
        xatmf = xDialog.getChild("atmf")
        xindentatmf = xDialog.getChild("indentatmf")
        xokbtn = xDialog.getChild("ok")

        xalignedatmf.executeAction("UP", tuple())
        props = {"TEXT": "Centered"}
        actionProps = mkPropertyValues(props)
        xnum2alignlb.executeAction("SELECT", actionProps)
        xatmf.executeAction("UP", tuple())
        xindentatmf.executeAction("UP", tuple())

        self.ui_test.close_dialog_through_button(xokbtn)

        self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")
        xalignedatmf = xDialog.getChild("alignedatmf")
        xnum2alignlb = xDialog.getChild("num2alignlb")
        xatmf = xDialog.getChild("atmf")
        xindentatmf = xDialog.getChild("indentatmf")

        self.assertEqual(get_state_as_dict(xalignedatmf)["Text"], "6.5 mm")
        self.assertEqual(get_state_as_dict(xnum2alignlb)["SelectEntryText"], "Centered")
        self.assertEqual(get_state_as_dict(xatmf)["Text"], "12.8 mm")
        self.assertEqual(get_state_as_dict(xindentatmf)["Text"], "12.8 mm")

        xcancbtn = xDialog.getChild("cancel")
        self.ui_test.close_dialog_through_button(xcancbtn)

        self.ui_test.close_doc()
开发者ID:chrissherlock,项目名称:libreoffice-experimental,代码行数:57,代码来源:formatBulletsNumbering.py


示例19: test_tdf124111_chart_x_negative_cross

   def test_tdf124111_chart_x_negative_cross(self):
    calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf124111.ods"))
    xCalcDoc = self.xUITest.getTopFocusWindow()
    gridwin = xCalcDoc.getChild("grid_window")
    document = self.ui_test.get_component()

    gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
    gridwin.executeAction("ACTIVATE", tuple())
    xChartMainTop = self.xUITest.getTopFocusWindow()
    xChartMain = xChartMainTop.getChild("chart_window")
    xSeriesObj =  xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
    self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))  # X Axis...
    xDialog = self.xUITest.getTopFocusWindow()
    #Click on tab "positioning".
    tabcontrol = xDialog.getChild("tabcontrol")
    select_pos(tabcontrol, "1")

    crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
    crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
    placeLabels = xDialog.getChild("LB_PLACE_LABELS")
    innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
    outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
    innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
    outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
    placeMarks = xDialog.getChild("LB_PLACE_TICKS")
    crossAxisValue.executeAction("DOWN", tuple())  #-1

    xOKBtn = xDialog.getChild("ok")
    self.ui_test.close_dialog_through_button(xOKBtn)

    #reopen and verify tab "positioning".
    gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
    gridwin.executeAction("ACTIVATE", tuple())
    xChartMainTop = self.xUITest.getTopFocusWindow()
    xChartMain = xChartMainTop.getChild("chart_window")
    xSeriesObj =  xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
    self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
    xDialog = self.xUITest.getTopFocusWindow()

    tabcontrol = xDialog.getChild("tabcontrol")
    select_pos(tabcontrol, "1")

    crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
    crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
    placeLabels = xDialog.getChild("LB_PLACE_LABELS")
    innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
    outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
    innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
    outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
    placeMarks = xDialog.getChild("LB_PLACE_TICKS")

    self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
    self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "-1")

    xOKBtn = xDialog.getChild("ok")
    self.ui_test.close_dialog_through_button(xOKBtn)
    self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:57,代码来源:tdf124111.py


示例20: test_row_height_insert_below

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python common.select_pos函数代码示例发布时间:2022-05-27
下一篇:
Python calc.enter_text_to_cell函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap