コード例 #1
0
ファイル: sort.py プロジェクト: mrkara/core
    def test_sort_numerical(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")

        type_text(xWriterEdit, "1;2;3")
        xWriterEdit.executeAction("TYPE",
                                  mkPropertyValues({"KEYCODE": "RETURN"}))
        type_text(xWriterEdit, "2;8;3")

        selection = self.xUITest.executeCommand(
            ".uno:SelectAll")  #select whole text
        #Tools - Sort
        self.ui_test.execute_dialog_through_command(".uno:SortDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xDown = xDialog.getChild("down1")
        xcolsb1 = xDialog.getChild("colsb1")
        xtypelb1 = xDialog.getChild("typelb1")
        xcharacter = xDialog.getChild("character")
        xseparator = xDialog.getChild("separator")
        xDown.executeAction("CLICK", tuple())
        select_by_text(xtypelb1, "Numerical")
        xcharacter.executeAction("CLICK", tuple())
        xseparator.executeAction("TYPE", mkPropertyValues({"TEXT": ";"}))
        xOK = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOK)
        #check
        self.assertEqual(document.Text.String[0:5], "2;8;3")

        self.ui_test.close_doc()
コード例 #2
0
    def test_bullets_and_numbering_dialog_tab_position2(self):
        self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()

        self.ui_test.execute_dialog_through_command(
            ".uno:BulletsAndNumberingDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")
        xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
        select_by_text(xnumfollowedbylb, "Space")

        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")
        xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
        self.assertEqual(
            get_state_as_dict(xnumfollowedbylb)["SelectEntryText"], "Space")

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

        self.ui_test.close_doc()
コード例 #3
0
ファイル: tdf124586.py プロジェクト: mrkara/core
    def test_tdf124586_crash_switch_outline_numbering(self):
        writer_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf124586.odt"))
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()

        #Goto Tools > Chapter Numbering.
        self.ui_test.execute_dialog_through_command(
            ".uno:ChapterNumberingDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xstyle = xDialog.getChild("style")
        select_by_text(xstyle, "MyHeading")
        xOK = xDialog.getChild("ok")
        xOK.executeAction("CLICK", tuple())

        self.assertEqual(document.Text.String[0:8], "Schritte")

        self.ui_test.execute_dialog_through_command(
            ".uno:ChapterNumberingDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xstyle = xDialog.getChild("style")
        self.assertEqual(
            get_state_as_dict(xstyle)["SelectEntryText"], "MyHeading")
        xOK = xDialog.getChild("ok")
        xOK.executeAction("CLICK", tuple())
        self.ui_test.close_doc()
コード例 #4
0
ファイル: subtotals.py プロジェクト: testitesti22/core
    def test_tdf88735(self):
        calc_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf88735.ods"))
        XcalcDoc = self.xUITest.getTopFocusWindow()
        document = self.ui_test.get_component()
        gridwin = XcalcDoc.getChild("grid_window")
        # 1 select all cells
        self.xUITest.executeCommand(
            ".uno:SelectAll")  #use uno command Menu Edit->Select All
        # 2 invoke sub-total menu and select none
        self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
        xDialog = self.xUITest.getTopFocusWindow()
        xGroupBy = xDialog.getChild("group_by")
        select_by_text(xGroupBy, "- none -")
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        # 2 invoke sort menu and... crash
        self.ui_test.execute_dialog_through_command(".uno:DataSort")
        xDialog = self.xUITest.getTopFocusWindow()
        xCancelBtn = xDialog.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCancelBtn)

        self.assertEqual(
            get_cell_by_position(document, 0, 0, 8).getString(), "z")
        self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 8)
        self.ui_test.close_doc()
コード例 #5
0
ファイル: subtotals.py プロジェクト: testitesti22/core
    def test_tdf88792(self):
        calc_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf88792.ods"))
        XcalcDoc = self.xUITest.getTopFocusWindow()
        document = self.ui_test.get_component()
        gridwin = XcalcDoc.getChild("grid_window")

        # go to cell A1
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        # Select from the menu bar Data
        # Select option subtotal
        # Subtotal dialog displays
        self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
        xDialog = self.xUITest.getTopFocusWindow()
        # Select group by: Category
        xGroupBy = xDialog.getChild("group_by")
        select_by_text(xGroupBy, "Category")
        # Select calculate subtotals for the months -  selected by default
        # Select tab options
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "3")
        # select option include formats
        xformats = xDialog.getChild("formats")
        xformats.executeAction("CLICK", tuple())
        # apply with OK
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        self.assertEqual(
            get_cell_by_position(document, 0, 3, 5).getValue(), 28000)
        self.ui_test.close_doc()
コード例 #6
0
ファイル: tdf104117.py プロジェクト: testitesti22/core
    def test_tdf104117(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()
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
        self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xcellrangeedit = xDialog.getChild("cell-range-edit")
        xdistributioncombo = xDialog.getChild("distribution-combo")
        xparameter1spin = xDialog.getChild("parameter1-spin")
        xparameter2spin = xDialog.getChild("parameter2-spin")
        xenableseedcheck = xDialog.getChild("enable-seed-check")
        xseedspin = xDialog.getChild("seed-spin")
        xenableroundingcheck = xDialog.getChild("enable-rounding-check")
        xdecimalplacesspin = xDialog.getChild("decimal-places-spin")

        xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
        select_by_text(xdistributioncombo, "Uniform Integer")
        xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
        xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
        xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"1000000000000000000000000000000000000000000000"}))

        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #Verify
        self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), True)
        self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), True)
        #undo
        self.xUITest.executeCommand(".uno:Undo")
        self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
        self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
        self.ui_test.close_doc()
コード例 #7
0
   def test_tdf39959_find_replace_all_sheets(self):
        calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf35020.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()

        self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        searchterm = xDialog.getChild("searchterm")
        searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
        searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
        searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"X6"}))
        replaceterm = xDialog.getChild("replaceterm")
        replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"A6"})) #replace textbox
        allsheets = xDialog.getChild("allsheets")
        allsheets.executeAction("CLICK", tuple())
        calcsearchin = xDialog.getChild("calcsearchin")
        select_by_text(calcsearchin, "Formulas")
        replaceall = xDialog.getChild("replaceall")
        replaceall.executeAction("CLICK", tuple())
        xcloseBtn = xDialog.getChild("close")
        self.ui_test.close_dialog_through_button(xcloseBtn)

        #verify Sheet1.A13 A14 = 2
        self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 2)
        self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 2)
        #Undo
        self.xUITest.executeCommand(".uno:Undo")
        self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 1)
        self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 1)
        self.ui_test.close_doc()
コード例 #8
0
ファイル: classification.py プロジェクト: mrkara/core
    def test_paragraph_classification_dialog_text(self):
        writer_doc = self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()
        #+ new file and do it only for Paragraph classification (no watermark!)
        self.ui_test.execute_dialog_through_command(".uno:ParagraphClassificationDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        classificationEditWindow = xDialog.getChild("classificationEditWindow")
        recentlyUsedCB = xDialog.getChild("recentlyUsedCB")
        classificationCB = xDialog.getChild("classificationCB")
        internationalClassificationCB = xDialog.getChild("internationalClassificationCB")
        intellectualPropertyPartEntry = xDialog.getChild("intellectualPropertyPartEntry")
        intellectualPropertyPartAddButton = xDialog.getChild("intellectualPropertyPartAddButton")
        #type text AA
        intellectualPropertyPartEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"AA"}))
        intellectualPropertyPartAddButton.executeAction("CLICK", tuple())
        select_by_text(classificationCB, "Internal Only")
        #verify International is set too
        self.assertEqual(get_state_as_dict(internationalClassificationCB)["SelectEntryText"], "Internal Only")
        #verify textBox Content  TODO  - texbox not supported yet
        # self.assertEqual(get_state_as_dict(classificationEditWindow)["Text"], "Conf")

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

        controller = self.ui_test.get_component().getCurrentController()
        self.assertEqual(document.Text.String[0:6], "(AAIO)")
        self.assertFalse(controller.hasInfobar("classification"))
        self.assertFalse(document.StyleFamilies.PageStyles.Standard.HeaderIsOn)

        self.ui_test.close_doc()
コード例 #9
0
ファイル: tdf53920.py プロジェクト: testitesti22/core
    def test_tdf53920_validity_multiple_cells(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()
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        #. Provide the desired values in a range of cells
        enter_text_to_cell(gridwin, "C1", "A")
        enter_text_to_cell(gridwin, "C2", "B")
        enter_text_to_cell(gridwin, "C3", "C")
        #Select the cells to be validated
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"}))
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5", "EXTEND":"1"}))
        #Apply Data > Validity ... > Cell Range
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "0")
        xallow = xDialog.getChild("allow")
        xmin = xDialog.getChild("min")

        select_by_text(xallow, "Cell range")
        xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$C$1:$C$3"}))
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        #Expected behavior: All selected cells validate data.
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xallow = xDialog.getChild("allow")
        xmin = xDialog.getChild("min")
        self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
        self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xallow = xDialog.getChild("allow")
        xmin = xDialog.getChild("min")
        self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
        self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5"}))
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xallow = xDialog.getChild("allow")
        xmin = xDialog.getChild("min")
        self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
        self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        self.ui_test.close_doc()
コード例 #10
0
ファイル: tdf106099.py プロジェクト: mrkara/core
 def handle_format_dlg(dialog):
     #Font effects - Underline Single. OK.
     xTabs = dialog.getChild("tabcontrol")
     select_pos(xTabs, "1")  #tab font effects
     underlinelb = dialog.getChild("underlinelb")
     select_by_text(underlinelb, "Single")
     xOkBtn = dialog.getChild("ok")
     self.ui_test.close_dialog_through_button(xOkBtn)
コード例 #11
0
ファイル: standardFilter.py プロジェクト: testitesti22/core
    def test_standard_filter_condition_contains(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", "first")
        enter_text_to_cell(gridwin, "B1", "second")
        enter_text_to_cell(gridwin, "A2", "aa")
        enter_text_to_cell(gridwin, "A3", "aaa")
        enter_text_to_cell(gridwin, "A4", "abbb")
        enter_text_to_cell(gridwin, "A5", "accc")
        enter_text_to_cell(gridwin, "A6", "a*")
        enter_text_to_cell(gridwin, "B2", "1")
        enter_text_to_cell(gridwin, "B3", "2")
        enter_text_to_cell(gridwin, "B4", "3")
        enter_text_to_cell(gridwin, "B5", "4")
        enter_text_to_cell(gridwin, "B6", "5")
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
        self.ui_test.execute_modeless_dialog_through_command(
            ".uno:DataFilterStandardFilter")
        xDialog = self.xUITest.getTopFocusWindow()
        xfield1 = xDialog.getChild("field1")
        xval1 = xDialog.getChild("val1")
        xregexp = xDialog.getChild("regexp")

        select_by_text(xfield1, "first")
        xval1.executeAction("TYPE", mkPropertyValues({"TEXT": "a*"}))
        xregexp.executeAction("CLICK", tuple())
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #3x down - should be on row 7
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "6")
        #reopen filter and verify
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
        self.ui_test.execute_modeless_dialog_through_command(
            ".uno:DataFilterStandardFilter")
        xDialog = self.xUITest.getTopFocusWindow()
        xfield1 = xDialog.getChild("field1")
        xval1 = xDialog.getChild("val1")
        xregexp = xDialog.getChild("regexp")

        self.assertEqual(
            get_state_as_dict(xfield1)["SelectEntryText"], "first")
        self.assertEqual(get_state_as_dict(xval1)["Text"], "a*")
        self.assertEqual(get_state_as_dict(xregexp)["Selected"], "true")
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        self.ui_test.close_doc()
コード例 #12
0
    def test_tdf39650_F4_R1C1(self):
        #Bug 39650 - Shift+F4 conversion from relative to absolute does not work for R1C1 syntax
        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()
        #* Tools --> Options --> Calc --> Formula -->  Syntax = Excel R1C1
        self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")  #optionsdialog
        xDialogOpt = self.xUITest.getTopFocusWindow()

        xPages = xDialogOpt.getChild("pages")
        xCalcEntry = xPages.getChild('3')                 # Calc
        xCalcEntry.executeAction("EXPAND", tuple())
        xCalcFormulaEntry = xCalcEntry.getChild('4')
        xCalcFormulaEntry.executeAction("SELECT", tuple())          #Formula

        formulasyntax = xDialogOpt.getChild("formulasyntax")
        #Excel R1C1
        select_by_text(formulasyntax, "Excel R1C1")

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

        #In cell R3C3 enter "xxx".
        enter_text_to_cell(gridwin, "C3", "xxx")
        # In cell R2C2 type = and then click on the xxx in R3C3.
        enter_text_to_cell(gridwin, "B2", "=R[1]C[1]")
        # With cell R2C2 still selected, type Shift-F4.
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))

        #F4
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))

        #This should change the formula in R2C2 from =R[1]C[1] to =R3C3.
        self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "xxx")
        enter_text_to_cell(gridwin, "A1", "=FORMULA(R[1]C[1])")
        self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "=R3C3")

        #Give it back Tools --> Options --> Calc --> Formula -->  Syntax = Calc A1
        self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")  #optionsdialog
        xDialogOpt = self.xUITest.getTopFocusWindow()

        xPages = xDialogOpt.getChild("pages")
        xCalcEntry = xPages.getChild('3')                 # Calc
        xCalcEntry.executeAction("EXPAND", tuple())
        xCalcFormulaEntry = xCalcEntry.getChild('4')
        xCalcFormulaEntry.executeAction("SELECT", tuple())          #Formula

        formulasyntax = xDialogOpt.getChild("formulasyntax")
        #Excel R1C1
        select_by_text(formulasyntax, "Calc A1")

        xOKBtn = xDialogOpt.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        self.ui_test.close_doc()
コード例 #13
0
ファイル: tdf134439.py プロジェクト: mrkara/core
    def test_tdf134439(self):

        self.ui_test.load_file(get_url_for_data_file("tdf134439.odt"))

        document = self.ui_test.get_component()

        self.assertEqual(document.CurrentController.PageCount, 3)

        xCursor = document.CurrentController.ViewCursor
        self.assertEqual("Chap 1", xCursor.PageStyleName)

        xPageBreak = self.ui_test.wait_until_child_is_available('PageBreak')
        self.ui_test.execute_dialog_through_action(xPageBreak, "EDIT")

        xDialog = self.xUITest.getTopFocusWindow()

        self.assertEqual(
            "Page",
            get_state_as_dict(
                xDialog.getChild("comboBreakType"))["SelectEntryText"])
        self.assertEqual(
            "Before",
            get_state_as_dict(
                xDialog.getChild("comboBreakPosition"))["SelectEntryText"])

        xPageStyle = xDialog.getChild("comboPageStyle")
        self.assertEqual("Chap 2",
                         get_state_as_dict(xPageStyle)["SelectEntryText"])

        select_by_text(xPageStyle, "Chap 3")

        self.assertEqual("Chap 3",
                         get_state_as_dict(xPageStyle)["SelectEntryText"])

        # tdf#116070: Without the fix in place, this test would have crashed here
        okBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(okBtn)

        # Without the fix in place, this test would have failed with
        # AssertionError: 'Chap 1' != 'Chap 3'
        self.assertEqual("Chap 1", xCursor.PageStyleName)

        self.assertEqual(document.CurrentController.PageCount, 3)

        xCursor.jumpToNextPage()
        self.assertEqual("Chap 3", xCursor.PageStyleName)

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

        self.assertEqual("Chap 2", xCursor.PageStyleName)

        self.ui_test.close_doc()
コード例 #14
0
ファイル: formatCharacter.py プロジェクト: mrkara/core
    def test_format_character_tab_hyperlink(self):
        self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()

        self.ui_test.execute_dialog_through_command(".uno:FontDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")

        xURL = xDialog.getChild("urled")
        xURL.executeAction("TYPE",
                           mkPropertyValues({"TEXT": "libreoffice.org"}))
        xTexted = xDialog.getChild("texted")
        xTexted.executeAction("TYPE", mkPropertyValues({"TEXT":
                                                        "LibreOffice"}))
        xName = xDialog.getChild("nameed")
        xName.executeAction("TYPE", mkPropertyValues({"TEXT": "hyperlink"}))

        xVisited = xDialog.getChild("visitedlb")
        select_by_text(xVisited, "Bullets")
        xUnVisited = xDialog.getChild("unvisitedlb")
        select_by_text(xUnVisited, "Bullets")

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

        self.xUITest.executeCommand(".uno:GoLeft")
        self.assertEqual(document.Text.String[0:11], "LibreOffice")

        self.ui_test.execute_dialog_through_command(".uno:FontDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")
        xURL = xDialog.getChild("urled")
        xTexted = xDialog.getChild("texted")
        xName = xDialog.getChild("nameed")
        xVisited = xDialog.getChild("visitedlb")
        xUnVisited = xDialog.getChild("unvisitedlb")

        self.assertEqual(
            get_state_as_dict(xURL)["Text"], "http://libreoffice.org/")
        self.assertEqual(get_state_as_dict(xTexted)["Text"], "LibreOffice")
        self.assertEqual(get_state_as_dict(xName)["Text"], "hyperlink")
        self.assertEqual(
            get_state_as_dict(xVisited)["SelectEntryText"], "Bullets")
        self.assertEqual(
            get_state_as_dict(xUnVisited)["SelectEntryText"], "Bullets")

        xCanc = xDialog.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCanc)
        self.ui_test.close_doc()
コード例 #15
0
ファイル: tdf140257.py プロジェクト: mrkara/core
    def change_outline_level(self, sText):

        self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")

        xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")

        select_by_text(xOutline, sText)

        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
コード例 #16
0
    def test_td49531_sort_undo_crash(self):
        calc_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf49531.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        #select A3:C147
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A3:C147"}))

        #Menu 'Data -> Sort -> Top to bottom - all otheroptions unchecked
        #Column B - Ascending' <ok>
        self.ui_test.execute_dialog_through_command(".uno:DataSort")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "1")
        xNatural = xDialog.getChild("naturalsort")
        xtopdown = xDialog.getChild("topdown")
        xHeader = xDialog.getChild("header")
        if (get_state_as_dict(xNatural)["Selected"]) == "true":
            xNatural.executeAction("CLICK", tuple())
        if (get_state_as_dict(xHeader)["Selected"]) == "true":
            xHeader.executeAction("CLICK", tuple())
        xtopdown.executeAction("CLICK", tuple())
        select_pos(xTabs, "0")
        xSortKey1 = xDialog.getChild("sortlb")
        xAsc = xDialog.getChild("up")
        select_by_text(xSortKey1, "Column B")
        xAsc.executeAction("CLICK", tuple())
        xOk = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOk)
        #Verify
        self.assertEqual(
            get_cell_by_position(document, 0, 0, 0).getString(), "x")
        self.assertEqual(
            get_cell_by_position(document, 0, 0, 1).getString(), "0")
        self.assertEqual(
            get_cell_by_position(document, 0, 2, 2).getValue(), 111)
        self.assertEqual(
            get_cell_by_position(document, 0, 2, 3).getValue(), 48)
        # UNDO Bug 49520 - EDITING: CRASH when undo sort with chart
        self.xUITest.executeCommand(".uno:Undo")
        # Verify
        self.assertEqual(
            get_cell_by_position(document, 0, 0, 0).getString(), "x")
        self.assertEqual(
            get_cell_by_position(document, 0, 0, 1).getString(), "0")
        self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 2)
        self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
        self.ui_test.close_doc()
コード例 #17
0
    def test_format_paragraph_tab_drop_caps(self):
        self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()

        self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "6")

        xDisplay = xDialog.getChild("checkCB_SWITCH")
        xWholeWord = xDialog.getChild("checkCB_WORD")
        xLines = xDialog.getChild("spinFLD_LINES")
        xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
        xText = xDialog.getChild("entryEDT_TEXT")
        xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")

        xDisplay.executeAction("CLICK", tuple())
        xWholeWord.executeAction("CLICK", tuple())
        xLines.executeAction("UP", tuple())
        xSpaceToText.executeAction("UP", tuple())
        xText.executeAction("TYPE", mkPropertyValues({"TEXT": "A"}))
        select_by_text(xCharStyle, "Definition")
        xOK = xDialog.getChild("ok")
        xOK.executeAction("CLICK", tuple())

        self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "6")

        xDisplay = xDialog.getChild("checkCB_SWITCH")
        xWholeWord = xDialog.getChild("checkCB_WORD")
        xLines = xDialog.getChild("spinFLD_LINES")
        xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
        xText = xDialog.getChild("entryEDT_TEXT")
        xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")

        self.assertEqual(get_state_as_dict(xDisplay)["Selected"], "true")
        self.assertEqual(get_state_as_dict(xWholeWord)["Selected"], "true")
        self.assertEqual(get_state_as_dict(xText)["Text"], "A")
        self.assertEqual(
            get_state_as_dict(xCharStyle)["SelectEntryText"], "Definition")

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

        self.ui_test.close_doc()
コード例 #18
0
    def test_td89958_standard_filter(self):
        calc_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf89958.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        #select A1-> Column .uno:SelectColumn
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        self.xUITest.executeCommand(".uno:SelectColumn")

        #Menu: Data->Filter->Standard Filter ...
        #Field Name "Column A", Condition "Does not end with", Value: "CTORS"
        self.ui_test.execute_modeless_dialog_through_command(
            ".uno:DataFilterStandardFilter")
        xDialog = self.xUITest.getTopFocusWindow()
        xfield1 = xDialog.getChild("field1")
        xval1 = xDialog.getChild("val1")
        xcond1 = xDialog.getChild("cond1")

        select_by_text(xfield1, "Column A")
        select_by_text(xcond1, "Does not end with")
        xval1.executeAction("TYPE", mkPropertyValues({"TEXT": "CTORS"}))
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        #Expected behaviours: A2 is not filtered as it does not end with "CTORS".
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "1")
        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
        gridWinState = get_state_as_dict(gridwin)
        self.assertEqual(gridWinState["CurrentRow"], "3")
        #        #reopen filter and verify - doesn't works
        #        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
        #        gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
        #        self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
        #        xDialog = self.xUITest.getTopFocusWindow()
        #        xfield1 = xDialog.getChild("field1")
        #        xval1 = xDialog.getChild("val1")
        #        xcond1 = xDialog.getChild("cond1")
        #        self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "Column A")
        #        self.assertEqual(get_state_as_dict(xval1)["Text"], "CTORS")
        #        self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not end with")
        #        xCancelBtn = xDialog.getChild("cancel")
        #        self.ui_test.close_dialog_through_button(xCancelBtn)

        self.ui_test.close_doc()
コード例 #19
0
ファイル: tdf118638.py プロジェクト: mrkara/core
    def test_tdf118638_subtotal_format(self):
        calc_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf118638.ods"))
        XcalcDoc = self.xUITest.getTopFocusWindow()
        document = self.ui_test.get_component()
        gridwin = XcalcDoc.getChild("grid_window")
        # Open the test file
        gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B15"}))
        #Data->Subtotals
        self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "0")
        xGroupBy = xDialog.getChild("group_by")
        select_by_text(xGroupBy, "Store Name")
        xCheckListMenu = xDialog.getChild("grid1")
        xTreeList = xCheckListMenu.getChild("columns")
        xEntry = xTreeList.getChild("1")
        xEntry.executeAction("CLICK", tuple())

        #use the SUM function
        #        xfunctions = xDialog.getChild("functions")
        #        propsF = {"TEXT": "Sum"}
        #        actionPropsF = mkPropertyValues(propsF)
        #        xfunctions.executeAction("SELECT", actionPropsF)

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

        #verify
        self.assertEqual(
            get_cell_by_position(document, 0, 0, 15).getString(), "5408 Sum")
        self.assertEqual(
            get_cell_by_position(document, 0, 0, 16).getString(), "Grand Sum")

        self.assertEqual(
            round(get_cell_by_position(document, 0, 1, 15).getValue(), 12),
            238.89)
        self.assertEqual(
            round(get_cell_by_position(document, 0, 1, 16).getValue(), 12),
            238.89)

        self.assertEqual(
            get_cell_by_position(document, 0, 1, 15).getString(), "$238.89")
        self.assertEqual(
            get_cell_by_position(document, 0, 1, 16).getString(), "$238.89")

        self.ui_test.close_doc()
コード例 #20
0
    def test_tdf140239(self):

        self.ui_test.load_file(get_url_for_data_file("tdf140239.odt"))

        self.xUITest.executeCommand(".uno:JumpToNextFrame")

        self.ui_test.execute_modeless_dialog_through_command(
            ".uno:ControlProperties")
        xAction = self.ui_test.wait_until_child_is_available('listbox-Action')
        xURL = self.ui_test.wait_until_child_is_available('urlcontrol-URL')
        xEntry = self.ui_test.wait_until_child_is_available('entry')

        self.assertEqual("None", get_state_as_dict(xAction)['SelectEntryText'])
        self.assertEqual("false", get_state_as_dict(xURL)['Enabled'])

        select_by_text(xAction, "Open document/web page")

        self.assertEqual("Open document/web page",
                         get_state_as_dict(xAction)['SelectEntryText'])
        self.assertEqual("true", get_state_as_dict(xURL)['Enabled'])

        xURL.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
        xURL.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
        xURL.executeAction("TYPE", mkPropertyValues({"TEXT": "3"}))
        xURL.executeAction("TYPE", mkPropertyValues({"TEXT": "4"}))
        xURL.executeAction("TYPE", mkPropertyValues({"TEXT": "5"}))

        # Without the fix in place, this test would have failed with
        # AssertionError: '12345' != '54321'
        self.assertEqual("12345", get_state_as_dict(xURL)['Text'])

        xEntry.executeAction("FOCUS", tuple())
        self.assertEqual("Push Button", get_state_as_dict(xEntry)['Text'])

        xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
        xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":
                                                       "BACKSPACE"}))
        xEntry.executeAction("TYPE", mkPropertyValues({"TEXT": "Push"}))

        # Move the focus to another element so the changes done before will take effect
        xAction.executeAction("FOCUS", tuple())

        # tdf#131522: Without the fix in place, this test would have failed with
        # AssertionError: 'Push' != 'Push Button'
        self.assertEqual("Push", get_state_as_dict(xEntry)['Text'])

        self.ui_test.close_doc()
コード例 #21
0
    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()

        change_measurement_unit(self, "Millimeter")

        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())
        select_by_text(xnum2alignlb, "Centered")
        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()
コード例 #22
0
ファイル: tdf138134.py プロジェクト: testitesti22/core
    def test_delete_circle_at_formula(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", "1")
        enter_text_to_cell(gridwin, "A2", "3")
        enter_text_to_cell(gridwin, "A3", "=SUM(A1:A2)")

        #Select the cells to be validated
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
        #Apply Data > Validity ... > Whole Numbers
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "0")
        xallow = xDialog.getChild("allow")
        xallowempty = xDialog.getChild("allowempty")
        xdata = xDialog.getChild("data")
        xmin = xDialog.getChild("min")
        xmax = xDialog.getChild("max")

        select_by_text(xallow, "Whole Numbers")
        xallowempty.executeAction("CLICK", tuple())
        select_by_text(xdata, "equal")
        xmin.executeAction("TYPE", mkPropertyValues({"TEXT": "5"}))
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        self.xUITest.executeCommand(".uno:ShowInvalid")

        detectiveCircle1 = document.Sheets.getByName(
            "Sheet1").DrawPage.getCount()
        #There should be 1 detective circle object!
        self.assertEqual(detectiveCircle1, 1)

        enter_text_to_cell(gridwin, "A1", "2")

        detectiveCircle2 = document.Sheets.getByName(
            "Sheet1").DrawPage.getCount()
        #There should not be a detective circle object!
        self.assertEqual(detectiveCircle2, 0)

        self.ui_test.close_doc()
コード例 #23
0
    def test_format_paragraph_tab_outline_numbering(self):
        self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()

        self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")

        xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
        xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
        xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
        xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")

        select_by_text(xOutline, "Level 1")
        select_by_text(xNumbering, "Bullet •")
        xPara.executeAction("CLICK", tuple())
        xParaSpin.executeAction("UP", tuple())

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

        self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "4")

        xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
        xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
        xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
        xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")

        self.assertEqual(
            get_state_as_dict(xOutline)["SelectEntryText"], "Level 1")
        self.assertEqual(
            get_state_as_dict(xNumbering)["SelectEntryText"], "Bullet •")
        self.assertEqual(get_state_as_dict(xPara)["Selected"], "true")
        self.assertEqual(get_state_as_dict(xParaSpin)["Text"], "2")

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

        self.ui_test.close_doc()
コード例 #24
0
ファイル: validity.py プロジェクト: testitesti22/core
    def test_validity_tab_criteria(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()
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))

        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "0")
        xallow = xDialog.getChild("allow")
        xallowempty = xDialog.getChild("allowempty")
        xdata = xDialog.getChild("data")
        xmin = xDialog.getChild("min")
        xmax = xDialog.getChild("max")

        select_by_text(xallow, "Whole Numbers")
        xallowempty.executeAction("CLICK", tuple())
        select_by_text(xdata, "valid range")
        xmin.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
        xmax.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #reopen and verify
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xallow = xDialog.getChild("allow")
        xallowempty = xDialog.getChild("allowempty")
        xdata = xDialog.getChild("data")
        xmin = xDialog.getChild("min")
        xmax = xDialog.getChild("max")

        self.assertEqual(
            get_state_as_dict(xallow)["SelectEntryText"], "Whole Numbers")
        self.assertEqual(get_state_as_dict(xallowempty)["Selected"], "false")
        self.assertEqual(
            get_state_as_dict(xdata)["SelectEntryText"], "valid range")
        self.assertEqual(get_state_as_dict(xmin)["Text"], "1")
        self.assertEqual(get_state_as_dict(xmax)["Text"], "2")
        xCancelBtn = xDialog.getChild("cancel")
        self.ui_test.close_dialog_through_button(xCancelBtn)

        self.ui_test.close_doc()
コード例 #25
0
    def test_solver(self):
        calc_doc = self.ui_test.load_file(get_url_for_data_file("solver.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
        self.ui_test.execute_modeless_dialog_through_command(
            ".uno:SolverDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xtargetedit = xDialog.getChild("targetedit")
        xvalue = xDialog.getChild("value")
        xvalueedit = xDialog.getChild("valueedit")
        xchangeedit = xDialog.getChild("changeedit")
        xref1edit = xDialog.getChild("ref1edit")
        xval1edit = xDialog.getChild("val1edit")
        xref2edit = xDialog.getChild("ref2edit")
        xval2edit = xDialog.getChild("val2edit")
        xop2list = xDialog.getChild("op2list")

        xvalue.executeAction("CLICK", tuple())
        xvalueedit.executeAction("TYPE", mkPropertyValues({"TEXT": "1000"}))
        xchangeedit.executeAction("TYPE", mkPropertyValues({"TEXT": "C2"}))
        xref1edit.executeAction("TYPE", mkPropertyValues({"TEXT": "C2"}))
        xval1edit.executeAction("TYPE", mkPropertyValues({"TEXT": "C4"}))
        xref2edit.executeAction("TYPE", mkPropertyValues({"TEXT": "C4"}))
        select_by_text(xop2list, "=>")

        xval2edit.executeAction("TYPE", mkPropertyValues({"TEXT": "0"}))
        xOKBtn = xDialog.getChild("ok")

        def handle_OK_dlg(dialog):
            #('SolverSuccessDialog', 'cancel', 'dialog-action_area1', 'dialog-vbox1', 'grid1', 'label1', 'label2', 'ok', 'result')
            xYesButn = dialog.getChild("ok")
            self.ui_test.close_dialog_through_button(xYesButn)

        self.ui_test.execute_blocking_action(xOKBtn.executeAction,
                                             args=('CLICK', ()),
                                             dialog_handler=handle_OK_dlg)
        #verify
        self.assertEqual(
            get_cell_by_position(document, 0, 1, 1).getValue(), 400)
        self.ui_test.close_doc()
コード例 #26
0
    def test_tdf123508_format_page_scale(self):
        calc_doc = self.ui_test.load_file(
            get_url_for_data_file("tdf123508.ods"))
        xCalcDoc = self.xUITest.getTopFocusWindow()
        gridwin = xCalcDoc.getChild("grid_window")
        document = self.ui_test.get_component()
        #open "Format > Page - Sheet > Scale
        self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "6")  #tab Scale
        scalingMode = xDialog.getChild("comboLB_SCALEMODE")
        spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH")
        spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT")
        #select "Fit print range(s) to width/height"  from the scale mode drop-down list
        select_by_text(scalingMode, "Fit print range(s) to width/height")
        #define a value for the page, e.g.: width   2; height  2
        spinEDSCALEPAGEWIDTH.executeAction("UP", tuple())
        spinEDSCALEPAGEHEIGHT.executeAction("UP", tuple())

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

        #verify
        self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "6")  #tab Scale
        scalingMode = xDialog.getChild("comboLB_SCALEMODE")
        spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH")
        spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT")

        self.assertEqual(
            get_state_as_dict(scalingMode)["SelectEntryText"],
            "Fit print range(s) to width/height")
        self.assertEqual(get_state_as_dict(spinEDSCALEPAGEWIDTH)["Text"], "2")
        self.assertEqual(get_state_as_dict(spinEDSCALEPAGEHEIGHT)["Text"], "2")

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

        self.ui_test.close_doc()
コード例 #27
0
    def test_tdf65686_validity_list(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()
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
        #- Data > Validity
        #- Select Allow List
        #- Enter Entries Aap Noot Mies
        #- OK
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "0")
        xallow = xDialog.getChild("allow")
        xallowempty = xDialog.getChild("allowempty")
        minlist = xDialog.getChild("minlist")

        select_by_text(xallow, "List")
        minlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Aap"}))
        minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
        minlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Noot"}))
        minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
        minlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Mies"}))
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #- again open Data > Validity
        #> there are empty lines in the list Entries
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xallow = xDialog.getChild("allow")
        xallowempty = xDialog.getChild("allowempty")
        minlist = xDialog.getChild("minlist")

        self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "List")
        self.assertEqual(get_state_as_dict(minlist)["Text"], "Aap\nNoot\nMies")

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

        self.ui_test.close_doc()
コード例 #28
0
ファイル: validity.py プロジェクト: testitesti22/core
    def test_validity_tab_errorAlert(self):
        # erroralerttabpage.ui
        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()
        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))

        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "2")

        xactionCB = xDialog.getChild("actionCB")
        xerroralerttitle = xDialog.getChild("erroralert_title")
        xerrorMsg = xDialog.getChild("errorMsg")

        select_by_text(xactionCB, "Warning")
        xerroralerttitle.executeAction("TYPE",
                                       mkPropertyValues({"TEXT": "Warn"}))
        xerrorMsg.executeAction("TYPE", mkPropertyValues({"TEXT": "Warn2"}))
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)
        #reopen and verify
        self.ui_test.execute_dialog_through_command(".uno:Validation")
        xDialog = self.xUITest.getTopFocusWindow()
        xTabs = xDialog.getChild("tabcontrol")
        select_pos(xTabs, "2")

        xactionCB = xDialog.getChild("actionCB")
        xerroralerttitle = xDialog.getChild("erroralert_title")
        xerrorMsg = xDialog.getChild("errorMsg")

        self.assertEqual(
            get_state_as_dict(xactionCB)["SelectEntryText"], "Warning")
        self.assertEqual(get_state_as_dict(xerroralerttitle)["Text"], "Warn")
        self.assertEqual(get_state_as_dict(xerrorMsg)["Text"], "Warn2")
        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        self.ui_test.close_doc()
コード例 #29
0
ファイル: asianPhoneticGuide.py プロジェクト: mrkara/core
    def test_asian_phonetic_guide(self):
        self.ui_test.create_doc_in_start_center("writer")
        document = self.ui_test.get_component()
        xWriterDoc = self.xUITest.getTopFocusWindow()

        self.ui_test.execute_modeless_dialog_through_command(".uno:RubyDialog")
        xDialog = self.xUITest.getTopFocusWindow()

        xLeft1ED = xDialog.getChild("Left1ED")
        xRight1ED = xDialog.getChild("Right1ED")
        xadjustlb = xDialog.getChild("adjustlb")
        xpositionlb = xDialog.getChild("positionlb")
        xstylelb = xDialog.getChild("stylelb")

        xLeft1ED.executeAction("TYPE", mkPropertyValues({"TEXT": "a"}))
        xRight1ED.executeAction("TYPE", mkPropertyValues({"TEXT": "w"}))
        select_by_text(xadjustlb, "Right")
        select_by_text(xpositionlb, "Right")
        select_by_text(xstylelb, "Quotation")

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

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

        self.assertEqual(document.Text.String[0:1], "a")
        self.ui_test.close_doc()
コード例 #30
0
ファイル: subtotals.py プロジェクト: testitesti22/core
 def test_tdf56958(self):
     calc_doc = self.ui_test.load_file(
         get_url_for_data_file("tdf56958.ods"))
     XcalcDoc = self.xUITest.getTopFocusWindow()
     document = self.ui_test.get_component()
     gridwin = XcalcDoc.getChild("grid_window")
     # 1. Open the test file
     # 2. Data->Subtotals
     self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
     xDialog = self.xUITest.getTopFocusWindow()
     # 3. Group by->Trans date
     xGroupBy = xDialog.getChild("group_by")
     select_by_text(xGroupBy, "Trans Date")
     # 4. Tick 'Calculate subtotals for' -> Amount  (grid1)
     xCheckListMenu = xDialog.getChild("grid1")
     xTreeList = xCheckListMenu.getChild("columns")
     xFirstEntry = xTreeList.getChild("2")
     xFirstEntry.executeAction("CLICK", tuple())
     # 5. Click OK
     xOKBtn = xDialog.getChild("ok")
     self.ui_test.close_dialog_through_button(xOKBtn)
     # 6. Data->Subtotals
     self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
     xDialog = self.xUITest.getTopFocusWindow()
     # 7. Group by->-none-
     xGroupBy = xDialog.getChild("group_by")
     select_by_text(xGroupBy, "- none -")
     # 8. Untick 'Calculate subtotals for' -> Amount
     xCheckListMenu = xDialog.getChild("grid1")
     xTreeList = xCheckListMenu.getChild("columns")
     xFirstEntry = xTreeList.getChild("2")
     xFirstEntry.executeAction("CLICK", tuple())
     # 9. Click OK
     xOKBtn = xDialog.getChild("ok")
     self.ui_test.close_dialog_through_button(xOKBtn)
     # 10. Data->Sort
     self.ui_test.execute_dialog_through_command(".uno:DataSort")
     xDialog = self.xUITest.getTopFocusWindow()
     # 11. Sort key 1->Post Date.
     sortkey1 = xDialog.getChild("sortlb")
     select_by_text(sortkey1, "Post Date")
     # 12. Sort key 2->-undefined-
     sortkey2 = xDialog.getChild("sortuserlb")
     select_by_text(sortkey2, "- undefined -")
     # 13. Click OK
     xOKBtn = xDialog.getChild("ok")
     self.ui_test.close_dialog_through_button(xOKBtn)
     self.assertEqual(
         get_cell_by_position(document, 0, 2, 1).getValue(), -0.25)
     self.ui_test.close_doc()