def test_format_character_tab_asian_layout(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:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "3") xTwolines = xDialog.getChild("twolines") xTwolines.executeAction("CLICK", tuple()) xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "3") xTwolines = xDialog.getChild("twolines") self.assertEqual(get_state_as_dict(xTwolines)["Selected"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf115572_table_format_gets_reset_deleting_column(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") #insert table 2x2 self.ui_test.execute_dialog_through_command(".uno:InsertTable") xDialog = self.xUITest.getTopFocusWindow() xOkBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOkBtn) #select font format - Bold and write text "abc" self.xUITest.executeCommand(".uno:Bold") tables = document.getTextTables() self.insertTextIntoCell(tables[0], "A1", "abc" ) #go to second column self.xUITest.executeCommand(".uno:GoRight") #delete column self.xUITest.executeCommand(".uno:DeleteColumns") #check the format of the text (should be still bold) Format-Character-Font-Style-Bold self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") xweststylelbcjk = xDialog.getChild("weststylelb-cjk") self.assertEqual(get_state_as_dict(xweststylelbcjk)["Text"], "Bold") xCloseBtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCloseBtn) self.ui_test.close_doc()
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()
def test_background_dialog(self): self.ui_test.create_doc_in_start_center("writer") buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern'] for index, button in enumerate(buttons): self.ui_test.execute_dialog_through_command(".uno:PageStyleName") xPageStyleDlg = self.xUITest.getTopFocusWindow() tabcontrol = xPageStyleDlg.getChild("tabcontrol") select_pos(tabcontrol, "2") xBtn = xPageStyleDlg.getChild(button) xBtn.executeAction("CLICK", tuple()) xOkBtn = xPageStyleDlg.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) self.checkDefaultBackground(button) self.ui_test.execute_dialog_through_command(".uno:PageStyleName") xPageStyleDlg = self.xUITest.getTopFocusWindow() tabcontrol = xPageStyleDlg.getChild("tabcontrol") select_pos(tabcontrol, "2") xBtn = xPageStyleDlg.getChild('btnnone') xBtn.executeAction("CLICK", tuple()) xOkBtn = xPageStyleDlg.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) self.checkDefaultBackground('btnnone') self.ui_test.close_doc()
def test_td99627_natural_sort(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99627.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #Open sort dialog by DATA - SORT 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") xdown = xDialog.getChild("down") xNatural.executeAction("CLICK", tuple()) select_pos(xTabs, "0") xdown.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, 1).getString(), "2998") self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "1") #UNDO self.xUITest.executeCommand(".uno:Undo") #Verify self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "1") self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "2998") self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab:
def test_format_paragraph_area(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:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "8") xColor = xDialog.getChild("btncolor") xGradient = xDialog.getChild("btngradient") xBitmap = xDialog.getChild("btnbitmap") xPattern = xDialog.getChild("btnpattern") xHatch = xDialog.getChild("btnhatch") xColor.executeAction("CLICK", tuple()) xGradient.executeAction("CLICK", tuple()) xBitmap.executeAction("CLICK", tuple()) xPattern.executeAction("CLICK", tuple()) xHatch.executeAction("CLICK", tuple()) xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf81696_sort_cell_conditional_formatting(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81696.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B3"})) #Open sort dialog by DATA - SORT,Just sort it by Column A, ascending. (it's default) self.ui_test.execute_dialog_through_command(".uno:DataSort") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") xleftright = xDialog.getChild("leftright") select_pos(xTabs, "0") xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) #verify self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A") self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B") self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 1) self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2) self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 2) self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 1) self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab:
def test_format_character_tab_position_scalewidthsb(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:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") xScalewidth = xDialog.getChild("scalewidthsb") xScalewidth.executeAction("UP", tuple()) xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") xScalewidth = xDialog.getChild("scalewidthsb") self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "101%") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf122722_format_character_hidden(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") #1. Start LibreOffice #2. Create New Writer Document #3. Type "LibreOffice" in Writer type_text(xWriterEdit, "LibreOffice") #4. Select "LibreOffice" with mouse, and right click self.xUITest.executeCommand(".uno:SelectAll") self.assertEqual(document.Text.String[0:11], "LibreOffice") #5. Appear Context Menu, Character -> Character #6. Opened Character, Select "Font Effect" tab #7. Check Hidden, and click [OK] #8. Crash a LibreOffice self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") xEffects = xDialog.getChild("effectslb") xRelief = xDialog.getChild("relieflb") xBlinking = xDialog.getChild("blinkingcb") xHidden = xDialog.getChild("hiddencb") xOverline = xDialog.getChild("overlinelb") xStrikeout = xDialog.getChild("strikeoutlb") xUnderline = xDialog.getChild("underlinelb") xEmphasis = xDialog.getChild("emphasislb") xPosition = xDialog.getChild("positionlb") xHidden.executeAction("CLICK", tuple()) xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) #un-hidden self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") xEffects = xDialog.getChild("effectslb") xRelief = xDialog.getChild("relieflb") xBlinking = xDialog.getChild("blinkingcb") xHidden = xDialog.getChild("hiddencb") xOverline = xDialog.getChild("overlinelb") xStrikeout = xDialog.getChild("strikeoutlb") xUnderline = xDialog.getChild("underlinelb") xEmphasis = xDialog.getChild("emphasislb") xPosition = xDialog.getChild("positionlb") self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true") xHidden.executeAction("CLICK", tuple()) xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) self.assertEqual(document.Text.String[0:11], "LibreOffice") self.ui_test.close_doc()
def test_expand(self): self.ui_test.create_doc_in_start_center("calc") xCalcDoc = self.xUITest.getTopFocusWindow() xGridWindow = xCalcDoc.getChild("grid_window") enter_text_to_cell(xGridWindow, "B2", "=2+3+4") xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "B2"})) self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog") xFunctionDlg = self.xUITest.getTopFocusWindow() xTabs = xFunctionDlg.getChild("tabs") select_pos(xTabs, "1") xTreelist = xTabs.getChild("struct") xTreeEntry = xTreelist.getChild('0') xTreeEntry.executeAction("COLLAPSE", tuple()) xTreeEntry.executeAction("EXPAND", tuple()) xCancelBtn = xFunctionDlg.getChild("cancel") xCancelBtn.executeAction("CLICK", tuple()) self.ui_test.close_doc()
def test_td54018_sort_with_comments(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf54018.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() #click top left columns / rows heading field to select all cells self.xUITest.executeCommand(".uno:SelectAll") #Menu 'Data -> Sort -> Column D -> Descending' <ok> self.ui_test.execute_dialog_through_command(".uno:DataSort") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") xSortKey1 = xDialog.getChild("sortlb") xdown = xDialog.getChild("down") props = {"TEXT": "Column B"} actionProps = mkPropertyValues(props) xSortKey1.executeAction("SELECT", actionProps) xdown.executeAction("CLICK", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #Bug: When progress bar reaches 40% LibO Stops responding #Verify self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "7") self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "6") self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "5") self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "4") self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "3") self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "2") self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "1") self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab:
def test_text_direction(self): lTextDirection = ['Left-to-right (horizontal)', 'Right-to-left (horizontal)', 'Right-to-left (vertical)', 'Left-to-right (vertical)'] self.ui_test.create_doc_in_start_center("writer") document = self.ui_test.get_component() for i in range(4): with self.subTest(i=i): xDialog = self.launch_dialog_and_select_tab(1) xTextDirectionList = xDialog.getChild("comboTextFlowBox") select_pos(xTextDirectionList, str(i)) self.assertEqual( get_state_as_dict(xTextDirectionList)["SelectEntryText"], lTextDirection[i]) self.click_button(xDialog, 'ok') self.assertEqual( document.StyleFamilies.PageStyles.Standard.WritingMode, i) self.ui_test.close_doc()
def test_tdf125104_pageFormat_numbering(self): self.ui_test.create_doc_in_start_center("writer") document = self.ui_test.get_component() self.ui_test.execute_dialog_through_command(".uno:PageDialog") xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") comboLayoutFormat = xDialog.getChild("comboLayoutFormat") props = {"TEXT": "1st, 2nd, 3rd, ..."} actionProps = mkPropertyValues(props) comboLayoutFormat.executeAction("SELECT", actionProps) okBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(okBtn) self.ui_test.execute_dialog_through_command(".uno:PageDialog") xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") comboLayoutFormat = xDialog.getChild("comboLayoutFormat") self.assertEqual(get_state_as_dict(comboLayoutFormat)["SelectEntryText"], "1st, 2nd, 3rd, ...") cancelBtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(cancelBtn) self.ui_test.close_doc()
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") props = {"TEXT": "Category"} actionProps = mkPropertyValues(props) xGroupBy.executeAction("SELECT", actionProps) # 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()
def test_natural_sorting_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() #enter data enter_text_to_cell(gridwin, "A1", "MW-2") enter_text_to_cell(gridwin, "B1", "MW-20") enter_text_to_cell(gridwin, "C1", "MW-1") enter_text_to_cell(gridwin, "D1", "MW-18") gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D1"})) #Open sort dialog by DATA - SORT self.ui_test.execute_dialog_through_command(".uno:DataSort") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") xleftright = xDialog.getChild("leftright") select_pos(xTabs, "1") xNatural = xDialog.getChild("naturalsort") xleftright.executeAction("CLICK", tuple()) if (get_state_as_dict(xNatural)["Selected"]) == "false": xNatural.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(), "MW-1") self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "MW-2") self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "MW-18") self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "MW-20") self.ui_test.close_doc()
def test_tdf53482_Range_contains_column_headings_file(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf53482.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() #1. Highlight cells to be sorted A8:J124 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A8:J124"})) #2. Click Data menu, Sort self.ui_test.execute_dialog_through_command(".uno:DataSort") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") #3. On Options tab, tick 'Range contains column labels' xHeader = xDialog.getChild("header") xHeader.executeAction("CLICK", tuple()) if (get_state_as_dict(xHeader)["Selected"]) == "false": xHeader.executeAction("CLICK", tuple()) #4. On Sort Criteria tab, set appropriate criteria select_pos(xTabs, "0") xDown = xDialog.getChild("down") xDown.executeAction("CLICK", tuple()) xSortKey1 = xDialog.getChild("sortlb") props = {"TEXT": "Occupation"} actionProps = mkPropertyValues(props) xSortKey1.executeAction("SELECT", actionProps) #5. Click Ok xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) #6. Expected behavior: Ignore column labels when sorting self.assertEqual(get_cell_by_position(document, 0, 6, 7).getString(), "Occupation") self.assertEqual(get_cell_by_position(document, 0, 6, 8).getString(), "Travel Industry") self.assertEqual(get_cell_by_position(document, 0, 6, 123).getString(), "13") self.ui_test.close_doc()
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() xWriterEdit = xWriterDoc.getChild("writer_edit") 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") props = {"TEXT": "Space"} actionProps = mkPropertyValues(props) xnumfollowedbylb.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") 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()
def test_natural_sorting_rows(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 data enter_text_to_cell(gridwin, "A1", "MW100SSMOU456.996JIL4") enter_text_to_cell(gridwin, "A2", "MW180SSMOU456.996JIL4") enter_text_to_cell(gridwin, "A3", "MW110SSMOU456.993JIL4") enter_text_to_cell(gridwin, "A4", "MW180SSMOU456.994JIL4") enter_text_to_cell(gridwin, "A5", "MW101SSMOU456.996JIL4") #Open sort dialog by DATA - SORT self.ui_test.execute_dialog_through_command(".uno:DataSort") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") xNatural = xDialog.getChild("naturalsort") xNatural.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(), "MW100SSMOU456.996JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "MW101SSMOU456.996JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "MW110SSMOU456.993JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "MW180SSMOU456.994JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "MW180SSMOU456.996JIL4") #UNDO self.xUITest.executeCommand(".uno:Undo") #Verify self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW100SSMOU456.996JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "MW180SSMOU456.996JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "MW110SSMOU456.993JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "MW180SSMOU456.994JIL4") self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "MW101SSMOU456.996JIL4") #enter data enter_text_to_cell(gridwin, "D1", "MW-2") enter_text_to_cell(gridwin, "D2", "MW-20") enter_text_to_cell(gridwin, "D3", "MW-1") enter_text_to_cell(gridwin, "D4", "MW-18") gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:D4"})) #Open sort dialog by DATA - SORT 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") if (get_state_as_dict(xNatural)["Selected"]) == "false": xNatural.executeAction("CLICK", tuple()) xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "MW-1") self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "MW-2") self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "MW-18") self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "MW-20") self.ui_test.close_doc()
def launch_dialog_and_select_tab(self, tab): self.ui_test.execute_dialog_through_command(".uno:PageDialog") xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, str(tab)) return xDialog
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()
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)
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()
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()
def test_format_paragraph_tab_alignment(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:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION") xAlignment = xDialog.getChild("comboLB_VERTALIGN") xSnapToText = xDialog.getChild("checkCB_SNAP") xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN") xLastLine = xDialog.getChild("comboLB_LASTLINE") xExpandChk = xDialog.getChild("checkCB_EXPAND") props = {"TEXT": "Left-to-right (LTR)"} actionProps = mkPropertyValues(props) xTextDirection.executeAction("SELECT", actionProps) props2 = {"TEXT": "Top"} actionProps2 = mkPropertyValues(props2) xAlignment.executeAction("SELECT", actionProps2) xSnapToText.executeAction("CLICK", tuple()) xJustified.executeAction("CLICK", tuple()) props3 = {"TEXT": "Justified"} actionProps3 = mkPropertyValues(props3) xLastLine.executeAction("SELECT", actionProps3) xExpandChk.executeAction("CLICK", 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, "1") xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION") xAlignment = xDialog.getChild("comboLB_VERTALIGN") xSnapToText = xDialog.getChild("checkCB_SNAP") xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN") xLastLine = xDialog.getChild("comboLB_LASTLINE") xExpandChk = xDialog.getChild("checkCB_EXPAND") self.assertEqual(get_state_as_dict(xTextDirection)["SelectEntryText"], "Left-to-right (LTR)") self.assertEqual(get_state_as_dict(xAlignment)["SelectEntryText"], "Top") self.assertEqual(get_state_as_dict(xSnapToText)["Selected"], "false") self.assertEqual(get_state_as_dict(xJustified)["Checked"], "true") self.assertEqual(get_state_as_dict(xLastLine)["SelectEntryText"], "Justified") self.assertEqual(get_state_as_dict(xExpandChk)["Selected"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def handle_format_dlg(dialog): #print(dialog.getChildren()) xTabs = dialog.getChild("tabcontrol") select_pos(xTabs, "0") xSizeFont = dialog.getChild("westsizelb-cjk") xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) xSizeFont.executeAction("BACKSPACE", tuple()) xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"16"})) #set font size 16 xOkBtn = dialog.getChild("ok") self.ui_test.close_dialog_through_button(xOkBtn)
def test_Sortingbuttons_detect_columnheaders(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() #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g enter_text_to_cell(gridwin, "A1", "Number") enter_text_to_cell(gridwin, "A2", "3") enter_text_to_cell(gridwin, "A3", "4") enter_text_to_cell(gridwin, "A4", "6") enter_text_to_cell(gridwin, "A5", "2") enter_text_to_cell(gridwin, "B1", "Misc") enter_text_to_cell(gridwin, "B2", "s") enter_text_to_cell(gridwin, "B3", "d") enter_text_to_cell(gridwin, "B4", "f") enter_text_to_cell(gridwin, "B5", "g") #Select cell A3 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) #Press toolbarbutton for descending sorting .uno:SortDescending self.xUITest.executeCommand(".uno:SortDescending") #Verify that cell A1 still contains "Number" and B1 "Misc" self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number") self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc") #UNDO self.xUITest.executeCommand(".uno:Undo") #Select cell B3 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"})) #Press toolbar button for ascending sorting self.xUITest.executeCommand(".uno:SortAscending") #Verify that cell A1 still contains "Number" and B1 "Misc" self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number") self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc") #UNDO self.xUITest.executeCommand(".uno:Undo") #Select cell A3 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) #Open sort dialog by DATA - SORT /Switch to tabpage Options self.ui_test.execute_dialog_through_command(".uno:DataSort") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") #Verify that option "Range contains column labels" is set xHeader = xDialog.getChild("header") self.assertEqual(get_state_as_dict(xHeader)["Selected"], "true") #Cancel dialog xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) #Select Range A1:B5 gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"})) #Press toolbarbutton for descending sorting self.xUITest.executeCommand(".uno:SortDescending") #Verify that cell A1 still contains "Number" and B1 "Misc" self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number") self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc") self.ui_test.close_doc()
def test_tdf96432_chart_crash_transparency_error_bar_dialog(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf96432.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") #Right-click on the chart; from the pop-up menu select "Format Y bars # The program presents dialog "Format Y bars", tab "Line". xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Line". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") #Type a non-zero integer into the "Transparency:" Edit Field, or use the up arrow to select one xTransparency = xDialog.getChild("MTR_LINE_TRANSPARENT") xTransparency.executeAction("UP", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #verify - we didn't crash gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""})) self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 7) #reopen and try again gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) gridwin.executeAction("ACTIVATE", tuple()) xChartMainTop = self.xUITest.getTopFocusWindow() xChartMain = xChartMainTop.getChild("chart_window") #Right-click on the chart; from the pop-up menu select "Format Y bars # The program presents dialog "Format Y bars", tab "Line". xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Line". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") #Type a non-zero integer into the "Transparency:" Edit Field, or use the up arrow to select one xTransparency = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xTransparency)["Text"][0], "5") xTransparency.executeAction("UP", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #verify - we didn't crash gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""})) self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 7) self.ui_test.close_doc()
def test_format_character_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:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") xSuperscript = xDialog.getChild("superscript") xRelFontSize = xDialog.getChild("fontsizesb") x90deg = xDialog.getChild("90deg") xScalewidth = xDialog.getChild("scalewidthsb") xKerning = xDialog.getChild("kerningsb") xPairKerning = xDialog.getChild("pairkerning") xFitToLine = xDialog.getChild("fittoline") xSuperscript.executeAction("CLICK", tuple()) xRelFontSize.executeAction("UP", tuple()) x90deg.executeAction("CLICK", tuple()) xScalewidth.executeAction("UP", tuple()) xKerning.executeAction("UP", tuple()) xPairKerning.executeAction("CLICK", tuple()) xFitToLine.executeAction("CLICK", tuple()) xOK = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOK) self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") xSuperscript = xDialog.getChild("superscript") xRelFontSize = xDialog.getChild("fontsizesb") x90deg = xDialog.getChild("90deg") xScalewidth = xDialog.getChild("scalewidthsb") xKerning = xDialog.getChild("kerningsb") xPairKerning = xDialog.getChild("pairkerning") xFitToLine = xDialog.getChild("fittoline") self.assertEqual(get_state_as_dict(xSuperscript)["Checked"], "true") self.assertEqual(get_state_as_dict(x90deg)["Checked"], "true") self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "100%") self.assertEqual(get_state_as_dict(xKerning)["Text"], "0.1 pt") self.assertEqual(get_state_as_dict(xPairKerning)["Selected"], "false") self.assertEqual(get_state_as_dict(xFitToLine)["Selected"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf99069_chart_cancel_data_ranges_dialog(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99069.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() #(1) Download and open example.ods attached to tdf#97266 with cell B1 active. #(2) In tool bar, click the chart icon. Program presents Chart Wizard. self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart") xDialog = self.xUITest.getTopFocusWindow() #(3) In Chart Wizard, click <Finish>. The program closes the wizard; # the chart shows a border with handles on each side and at each corner. xFinishBtn = xDialog.getChild("finish") self.ui_test.close_dialog_through_button(xFinishBtn) for _ in range(0,5): #(4) Click outside the chart, for example in cell C23. The borders #disappear from the chart and the program restores the menubar to #the window. (Yes, this step is necessary to the crash.) gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""})) gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C23"})) #(5) Double-click on the chart. The program shows a border around the # chart. (It may be necessary to do this a second time before the # pop-up menu will offer "Data Ranges...". gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) gridwin.executeAction("ACTIVATE", tuple()) xChartMainTop = self.xUITest.getTopFocusWindow() xChartMain = xChartMainTop.getChild("chart_window") #(6) Right-click on the chart; from the pop-up menu select "Data # Ranges...". The program presents dialog "Data Ranges", tab "Data Range". xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DataRanges"})) xDialog = self.xUITest.getTopFocusWindow() #(7) Click on tab "Data Series". (Actually, tab "Data Range" crashes, # too. This step is just a remnant of what I was doing when I # stumbled over the bug.) notebook = xDialog.getChild("notebook") select_pos(notebook, "0") select_pos(notebook, "1") #(8) Click <Cancel>. In the versions that I deemed bad while # bibisecting, the program crashed here five times out of seven. # The other two attempts, both on daily bibisect version 2016-02-18, # crashed after I closed the Data Ranges dialog an additional three # times, one of those times using by typing <Esc>. xCancelBtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCancelBtn) #verify - we didn't crash gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""})) self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 0.529084) self.ui_test.close_doc()
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() xWriterEdit = xWriterDoc.getChild("writer_edit") 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") props = {"TEXT": "Bullets"} actionProps = mkPropertyValues(props) xVisited.executeAction("SELECT", actionProps) xUnVisited = xDialog.getChild("unvisitedlb") props = {"TEXT": "Bullets"} actionProps = mkPropertyValues(props) xUnVisited.executeAction("SELECT", actionProps) 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()
def test_color_selector(self): #This is to test color selection 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 cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "6") #tab Numbers # click on color btn xbtncolor = xDialog.getChild("btncolor") xbtncolor.executeAction("CLICK", tuple()) xpaletteselector = xDialog.getChild("paletteselector") # Now we have the ColorPage that we can get the color selector from it xColorpage = xDialog.getChild("ColorPage") color_selector = xColorpage.getChild("colorset") # For chart-palettes colors xpaletteselector.executeAction( "SELECT", mkPropertyValues({"TEXT": "chart-palettes"})) # Select Color with id 2 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "1") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "12") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Chart 2") self.assertEqual( get_state_as_dict(color_selector)["RGB"], "(255,66,14)") # Select Color with id 5 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "5") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "4") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Chart 5") self.assertEqual( get_state_as_dict(color_selector)["RGB"], "(126,0,33)") # For libreoffice colors xpaletteselector.executeAction( "SELECT", mkPropertyValues({"TEXT": "libreoffice"})) # Select Color with id 6 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "6"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "6") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "5") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "32") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Green Accent") self.assertEqual( get_state_as_dict(color_selector)["RGB"], "(44,238,14)") # Select Color with id 30 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "30"})) self.assertEqual( get_state_as_dict(color_selector)["CurrColorId"], "30") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "29") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Yellow Accent") self.assertEqual( get_state_as_dict(color_selector)["RGB"], "(255,215,76)") # For html colors xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "html"})) # Select Color with id 1 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "1") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "0") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "138") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "White") # Select Color with id 120 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "120"})) self.assertEqual( get_state_as_dict(color_selector)["CurrColorId"], "120") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "119") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Navy") # For freecolour-hlc colors xpaletteselector.executeAction( "SELECT", mkPropertyValues({"TEXT": "freecolour-hlc"})) # Select Color with id 988 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "988"})) self.assertEqual( get_state_as_dict(color_selector)["CurrColorId"], "988") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "987") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "1032") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "HLC 350 60 10") # Select Color with id 575 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "575"})) self.assertEqual( get_state_as_dict(color_selector)["CurrColorId"], "575") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "574") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "HLC 190 50 20") # For tonal colors xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "tonal"})) # Select Color with id 17 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "17"})) self.assertEqual( get_state_as_dict(color_selector)["CurrColorId"], "17") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "16") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "120") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Cyan 82%") # Select Color with id 13 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "13"})) self.assertEqual( get_state_as_dict(color_selector)["CurrColorId"], "13") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Magenta 82%") # For material colors xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "material"})) # Select Color with id 9 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "9"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "9") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "8") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "228") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Gray 800") # For standard colors xpaletteselector.executeAction("SELECT", mkPropertyValues({"TEXT": "standard"})) # Select Color with id 3 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "3") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "2") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "120") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Dark Gray 3") xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) self.ui_test.close_doc()
def test_format_cell_borders_tab(self): #borderpage.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() #set points pt measurement #Make sure that tools-options-LibreOffice Calc-General-Point 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 /point xunitlb = xDialogOpt.getChild("unitlb") props = {"TEXT": "Point"} actionProps = mkPropertyValues(props) xunitlb.executeAction("SELECT", actionProps) xOKBtn = xDialogOpt.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") #tab Borders xsync = xDialog.getChild("sync") xleftmf = xDialog.getChild("leftmf") xrightmf = xDialog.getChild("rightmf") xtopmf = xDialog.getChild("topmf") xbottommf = xDialog.getChild("bottommf") xsync.executeAction("CLICK", tuple()) #uncheck Synchronize xleftmf.executeAction("UP", tuple()) xrightmf.executeAction("UP", tuple()) xrightmf.executeAction("UP", tuple()) xtopmf.executeAction("UP", tuple()) xtopmf.executeAction("UP", tuple()) xtopmf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) leftVal = get_state_as_dict(xleftmf)["Text"] rightVal = get_state_as_dict(xrightmf)["Text"] topVal = get_state_as_dict(xtopmf)["Text"] bottomVal = get_state_as_dict(xbottommf)["Text"] xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) # Verify select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") #tab Borders xsync = xDialog.getChild("sync") xleftmf = xDialog.getChild("leftmf") xrightmf = xDialog.getChild("rightmf") xtopmf = xDialog.getChild("topmf") xbottommf = xDialog.getChild("bottommf") self.assertEqual(get_state_as_dict(xsync)["Selected"], "false") self.assertEqual(get_state_as_dict(xleftmf)["Text"] == leftVal, True) self.assertEqual(get_state_as_dict(xrightmf)["Text"] == rightVal, True) self.assertEqual(get_state_as_dict(xtopmf)["Text"] == topVal, True) self.assertEqual(get_state_as_dict(xbottommf)["Text"] == bottomVal, True) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_chart_data_labels_dialog(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98390.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": "InsertMenuDataLabels"})) xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER") category = xDialog.getChild("CB_CATEGORY") legend = xDialog.getChild("CB_SYMBOL") wrapText = xDialog.getChild("CB_WRAP_TEXT") separator = xDialog.getChild("LB_TEXT_SEPARATOR") placement = xDialog.getChild("LB_LABEL_PLACEMENT") degrees = xDialog.getChild("NF_LABEL_DEGREES") textDirection = xDialog.getChild("LB_LABEL_TEXTDIR") #valueAsNumber.executeAction("CLICK", tuple()) category.executeAction("CLICK", tuple()) legend.executeAction("CLICK", tuple()) wrapText.executeAction("CLICK", tuple()) props = {"TEXT": "Comma"} actionProps = mkPropertyValues(props) separator.executeAction("SELECT", actionProps) props2 = {"TEXT": "Below"} actionProps2 = mkPropertyValues(props2) placement.executeAction("SELECT", actionProps2) degrees.executeAction("UP", tuple()) props3 = {"TEXT": "Right-to-left"} actionProps3 = mkPropertyValues(props3) textDirection.executeAction("SELECT", actionProps3) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify InsertMenuDataLabels dialog 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": "InsertMenuDataLabels"})) xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER") category = xDialog.getChild("CB_CATEGORY") legend = xDialog.getChild("CB_SYMBOL") wrapText = xDialog.getChild("CB_WRAP_TEXT") separator = xDialog.getChild("LB_TEXT_SEPARATOR") placement = xDialog.getChild("LB_LABEL_PLACEMENT") degrees = xDialog.getChild("NF_LABEL_DEGREES") textDirection = xDialog.getChild("LB_LABEL_TEXTDIR") self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "true") self.assertEqual(get_state_as_dict(category)["Selected"], "true") self.assertEqual(get_state_as_dict(legend)["Selected"], "true") self.assertEqual(get_state_as_dict(wrapText)["Selected"], "true") self.assertEqual(get_state_as_dict(separator)["SelectEntryText"], "Comma") self.assertEqual(get_state_as_dict(placement)["SelectEntryText"], "Below") self.assertEqual(get_state_as_dict(degrees)["Text"], "1") self.assertEqual(get_state_as_dict(textDirection)["SelectEntryText"], "Right-to-left") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_bullets_and_numbering_dialog_tab_customize(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, "5") xnumfmtlb = xDialog.getChild("numfmtlb") xstartat = xDialog.getChild("startat") xcharstyle = xDialog.getChild("charstyle") xprefix = xDialog.getChild("prefix") xsuffix = xDialog.getChild("suffix") xallsame = xDialog.getChild("allsame") props = {"TEXT": "A, B, C, ..."} actionProps = mkPropertyValues(props) xnumfmtlb.executeAction("SELECT", actionProps) xstartat.executeAction("UP", tuple()) props2 = {"TEXT": "Bullets"} actionProps2 = mkPropertyValues(props2) xcharstyle.executeAction("SELECT", actionProps2) xprefix.executeAction("TYPE", mkPropertyValues({"TEXT": "o"})) xsuffix.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT": "a"})) xallsame.executeAction("CLICK", tuple()) 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, "5") xnumfmtlb = xDialog.getChild("numfmtlb") xstartat = xDialog.getChild("startat") xcharstyle = xDialog.getChild("charstyle") xprefix = xDialog.getChild("prefix") xsuffix = xDialog.getChild("suffix") xallsame = xDialog.getChild("allsame") self.assertEqual( get_state_as_dict(xnumfmtlb)["SelectEntryText"], "A, B, C, ...") self.assertEqual(get_state_as_dict(xstartat)["Text"], "2") self.assertEqual( get_state_as_dict(xcharstyle)["SelectEntryText"], "Bullets") self.assertEqual(get_state_as_dict(xprefix)["Text"], "o") self.assertEqual(get_state_as_dict(xsuffix)["Text"], "a") self.assertEqual(get_state_as_dict(xallsame)["Selected"], "true") xcancbtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xcancbtn) self.ui_test.execute_dialog_through_command( ".uno:BulletsAndNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xremovebtn = xDialog.getChild("user") self.ui_test.close_dialog_through_button( xremovebtn) #remove new settings, back to default self.ui_test.execute_dialog_through_command( ".uno:BulletsAndNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xnumfmtlb = xDialog.getChild("numfmtlb") xstartat = xDialog.getChild("startat") xcharstyle = xDialog.getChild("charstyle") xprefix = xDialog.getChild("prefix") xsuffix = xDialog.getChild("suffix") xallsame = xDialog.getChild("allsame") self.assertEqual( get_state_as_dict(xnumfmtlb)["SelectEntryText"], "1, 2, 3, ...") self.assertEqual(get_state_as_dict(xstartat)["Text"], "1") self.assertEqual( get_state_as_dict(xcharstyle)["SelectEntryText"], "None") self.assertEqual(get_state_as_dict(xprefix)["Text"], "") self.assertEqual(get_state_as_dict(xsuffix)["Text"], ".") self.assertEqual(get_state_as_dict(xallsame)["Selected"], "false") xcancbtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xcancbtn) self.ui_test.close_doc()
def test_bullets_and_numbering_tab_move(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") xindentatmf = xDialog.getChild("indentatmf") indentValue = get_state_as_dict(xindentatmf)["Text"][ 0:len(get_state_as_dict(xindentatmf)["Text"]) - 3] xokbtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xokbtn) #create bullets xWriterEdit.executeAction("TYPE", mkPropertyValues( {"KEYCODE": "TAB"})) #TAB to move indent right self.ui_test.execute_dialog_through_command( ".uno:BulletsAndNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xindentatmf = xDialog.getChild("indentatmf") indentValue2 = get_state_as_dict(xindentatmf)["Text"][ 0:len(get_state_as_dict(xindentatmf)["Text"]) - 3] self.assertEqual(indentValue < indentValue2, True) xcancbtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xcancbtn) xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) self.ui_test.execute_dialog_through_command( ".uno:BulletsAndNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "4") xindentatmf = xDialog.getChild("indentatmf") indentValue3 = get_state_as_dict(xindentatmf)["Text"][ 0:len(get_state_as_dict(xindentatmf)["Text"]) - 3] self.assertEqual(indentValue == indentValue3, True) xcancbtn = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xcancbtn) self.ui_test.close_doc()
def test_format_cell_font_tab(self): #numberingformatpage.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() #select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") #tab Font xSizeFont = xDialog.getChild("westsizelb-cjk") xSizeFontEast = xDialog.getChild("eastsizelb") xSizeFontCTL = xDialog.getChild("ctlsizelb") xLangFont = xDialog.getChild("westlanglb-cjk") xLangFontEast = xDialog.getChild("eastlanglb") xLangFontCTL = xDialog.getChild("ctllanglb") xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT": "18"})) #set font size 18 xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT": "18" })) #set font size 18 xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT": "18"})) #set font size 18 select_pos(xLangFont, "0") select_pos(xLangFontEast, "0") select_pos(xLangFontCTL, "0") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) #Verify - select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") #tab Font xSizeFont = xDialog.getChild("westsizelb-cjk") xSizeFontEast = xDialog.getChild("eastsizelb") xSizeFontCTL = xDialog.getChild("ctlsizelb") xLangFont = xDialog.getChild("westlanglb-cjk") xLangFontEast = xDialog.getChild("eastlanglb") xLangFontCTL = xDialog.getChild("ctllanglb") self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt") self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt") self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt") #check font size self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]") self.assertEqual( get_state_as_dict(xLangFontEast)["SelectEntryText"], "[None]") self.assertEqual( get_state_as_dict(xLangFontCTL)["SelectEntryText"], "[None]") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_format_cell_borders_tab(self): #borderpage.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() #set points pt measurement change_measurement_unit(self, "Point") #select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") #tab Borders xsync = xDialog.getChild("sync") xleftmf = xDialog.getChild("leftmf") xrightmf = xDialog.getChild("rightmf") xtopmf = xDialog.getChild("topmf") xbottommf = xDialog.getChild("bottommf") xsync.executeAction("CLICK", tuple()) #uncheck Synchronize xleftmf.executeAction("UP", tuple()) xrightmf.executeAction("UP", tuple()) xrightmf.executeAction("UP", tuple()) xtopmf.executeAction("UP", tuple()) xtopmf.executeAction("UP", tuple()) xtopmf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) xbottommf.executeAction("UP", tuple()) leftVal = get_state_as_dict(xleftmf)["Text"] rightVal = get_state_as_dict(xrightmf)["Text"] topVal = get_state_as_dict(xtopmf)["Text"] bottomVal = get_state_as_dict(xbottommf)["Text"] xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) # Verify select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") #tab Borders xsync = xDialog.getChild("sync") xleftmf = xDialog.getChild("leftmf") xrightmf = xDialog.getChild("rightmf") xtopmf = xDialog.getChild("topmf") xbottommf = xDialog.getChild("bottommf") self.assertEqual(get_state_as_dict(xsync)["Selected"], "false") self.assertEqual(get_state_as_dict(xleftmf)["Text"] == leftVal, True) self.assertEqual(get_state_as_dict(xrightmf)["Text"] == rightVal, True) self.assertEqual(get_state_as_dict(xtopmf)["Text"] == topVal, True) self.assertEqual( get_state_as_dict(xbottommf)["Text"] == bottomVal, True) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_format_cell_alignment_tab(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 cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "3") #tab Alignment comboboxHorzAlign = xDialog.getChild("comboboxHorzAlign") xspinIndentFrom = xDialog.getChild("spinIndentFrom") xcomboboxVertAlign = xDialog.getChild("comboboxVertAlign") xcheckVertStack = xDialog.getChild("checkVertStack") xcheckWrapTextAuto = xDialog.getChild("checkWrapTextAuto") xcheckHyphActive = xDialog.getChild("checkHyphActive") xcomboTextDirBox = xDialog.getChild("comboTextDirBox") props = {"TEXT": "Left"} actionProps = mkPropertyValues(props) comboboxHorzAlign.executeAction("SELECT", actionProps) xspinIndentFrom.executeAction("UP", tuple()) indentVal = get_state_as_dict(xspinIndentFrom)["Text"] props2 = {"TEXT": "Top"} actionProps2 = mkPropertyValues(props2) xcomboboxVertAlign.executeAction("SELECT", actionProps2) xcheckVertStack.executeAction("CLICK", tuple()) xcheckWrapTextAuto.executeAction("CLICK", tuple()) xcheckHyphActive.executeAction("CLICK", tuple()) props3 = {"TEXT": "Left-to-right (LTR)"} actionProps3 = mkPropertyValues(props3) xcomboTextDirBox.executeAction("SELECT", actionProps3) xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) #Verify- select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "3") comboboxHorzAlign = xDialog.getChild("comboboxHorzAlign") xspinIndentFrom = xDialog.getChild("spinIndentFrom") xcomboboxVertAlign = xDialog.getChild("comboboxVertAlign") xcheckVertStack = xDialog.getChild("checkVertStack") xcheckWrapTextAuto = xDialog.getChild("checkWrapTextAuto") xcheckHyphActive = xDialog.getChild("checkHyphActive") xcomboTextDirBox = xDialog.getChild("comboTextDirBox") self.assertEqual( get_state_as_dict(comboboxHorzAlign)["SelectEntryText"], "Left") self.assertEqual( get_state_as_dict(xspinIndentFrom)["Text"] == indentVal, True) self.assertEqual( get_state_as_dict(xcomboboxVertAlign)["SelectEntryText"], "Top") self.assertEqual( get_state_as_dict(xcheckVertStack)["Selected"], "true") self.assertEqual( get_state_as_dict(xcheckWrapTextAuto)["Selected"], "true") self.assertEqual( get_state_as_dict(xcheckHyphActive)["Selected"], "true") self.assertEqual( get_state_as_dict(xcomboTextDirBox)["SelectEntryText"], "Left-to-right (LTR)") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) self.ui_test.close_doc()
def test_format_cell_numbers_tab(self): #numberingformatpage.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() #select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") #tab Numbers xliststore1 = xDialog.getChild("categorylb") #1st list / Category xliststore2 = xDialog.getChild("formatlb") #2nd list / Format xdecimalsed = xDialog.getChild("decimalsed") xleadzerosed = xDialog.getChild("leadzerosed") xnegnumred = xDialog.getChild("negnumred") xthousands = xDialog.getChild("thousands") xlanguagelb = xDialog.getChild("languagelb") xformatted = xDialog.getChild("formatted") #language props3 = {"TEXT": "English (USA)"} actionProps3 = mkPropertyValues(props3) xlanguagelb.executeAction("SELECT", actionProps3) #other properties xdecimalsed.executeAction("UP", tuple()) xleadzerosed.executeAction("UP", tuple()) xnegnumred.executeAction("CLICK", tuple()) xthousands.executeAction("CLICK", tuple()) #format #,#00.0;[RED]-#,#00.0 self.assertEqual( get_state_as_dict(xformatted)["Text"], "#,#00.0;[RED]-#,#00.0") #save xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) #verify gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") #tab Numbers xliststore1 = xDialog.getChild("categorylb") #1st list / Category xliststore2 = xDialog.getChild("formatlb") #2nd list / Format xdecimalsed = xDialog.getChild("decimalsed") xleadzerosed = xDialog.getChild("leadzerosed") xnegnumred = xDialog.getChild("negnumred") xthousands = xDialog.getChild("thousands") xlanguagelb = xDialog.getChild("languagelb") xformatted = xDialog.getChild("formatted") self.assertEqual( get_state_as_dict(xliststore1)["SelectEntryText"], "Number") self.assertEqual( get_state_as_dict(xlanguagelb)["SelectEntryText"], "English (USA)") self.assertEqual(get_state_as_dict(xdecimalsed)["Text"], "1") self.assertEqual(get_state_as_dict(xleadzerosed)["Text"], "2") self.assertEqual(get_state_as_dict(xnegnumred)["Selected"], "true") self.assertEqual(get_state_as_dict(xthousands)["Selected"], "true") self.assertEqual( get_state_as_dict(xformatted)["Text"], "#,#00.0;[RED]-#,#00.0") xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) self.ui_test.close_doc()
def open_page_style_dialog(self): self.ui_test.execute_dialog_through_command(".uno:PageDialog") xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") return xDialog.getChild("comboLayoutFormat")
def test_format_character_tab_font_effects(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, "1") xEffects = xDialog.getChild("effectslb") xRelief = xDialog.getChild("relieflb") xBlinking = xDialog.getChild("blinkingcb") xHidden = xDialog.getChild("hiddencb") xOverline = xDialog.getChild("overlinelb") xStrikeout = xDialog.getChild("strikeoutlb") xUnderline = xDialog.getChild("underlinelb") xEmphasis = xDialog.getChild("emphasislb") xPosition = xDialog.getChild("positionlb") select_pos(xEffects, "1") select_pos(xRelief, "1") xBlinking.executeAction("CLICK", tuple()) xHidden.executeAction("CLICK", tuple()) select_pos(xOverline, "1") select_pos(xStrikeout, "1") select_pos(xUnderline, "1") select_pos(xEmphasis, "1") select_pos(xPosition, "1") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") xEffects = xDialog.getChild("effectslb") xRelief = xDialog.getChild("relieflb") xBlinking = xDialog.getChild("blinkingcb") xHidden = xDialog.getChild("hiddencb") xOverline = xDialog.getChild("overlinelb") xStrikeout = xDialog.getChild("strikeoutlb") xUnderline = xDialog.getChild("underlinelb") xEmphasis = xDialog.getChild("emphasislb") xPosition = xDialog.getChild("positionlb") self.assertEqual( get_state_as_dict(xEffects)["SelectEntryText"], "UPPERCASE") self.assertEqual( get_state_as_dict(xRelief)["SelectEntryText"], "Embossed") self.assertEqual(get_state_as_dict(xBlinking)["Selected"], "true") self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true") self.assertEqual( get_state_as_dict(xOverline)["SelectEntryText"], "Single") self.assertEqual( get_state_as_dict(xStrikeout)["SelectEntryText"], "Single") self.assertEqual( get_state_as_dict(xUnderline)["SelectEntryText"], "Single") self.assertEqual( get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot") self.assertEqual( get_state_as_dict(xPosition)["SelectEntryText"], "Below text") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_format_character_tab_font(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, "0") xSizeFont = xDialog.getChild("westsizelb-cjk") xSizeFontEast = xDialog.getChild("eastsizelb") xSizeFontCTL = xDialog.getChild("ctlsizelb") xLangFont = xDialog.getChild("westlanglb-cjk") xLangFontEast = xDialog.getChild("eastlanglb") xLangFontCTL = xDialog.getChild("ctllanglb") xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT": "18"})) #set font size 18 xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT": "18" })) #set font size 18 xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT": "18"})) #set font size 18 select_pos(xLangFont, "0") select_pos(xLangFontEast, "0") select_pos(xLangFontCTL, "0") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) self.ui_test.execute_dialog_through_command(".uno:FontDialog") xDialog = self.xUITest.getTopFocusWindow() xSizeFont = xDialog.getChild("westsizelb-cjk") xSizeFontEast = xDialog.getChild("eastsizelb") xSizeFontCTL = xDialog.getChild("ctlsizelb") xLangFont = xDialog.getChild("westlanglb-cjk") xLangFontEast = xDialog.getChild("eastlanglb") xLangFontCTL = xDialog.getChild("ctllanglb") self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt") self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt") self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt") #check font size self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]") self.assertEqual( get_state_as_dict(xLangFontEast)["SelectEntryText"], "[None]") self.assertEqual( get_state_as_dict(xLangFontCTL)["SelectEntryText"], "[None]") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf123520_chart_y_cross_other_axis(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf123520.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": "DiagramAxisY"})) # Y 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("CLEAR", tuple()) crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"01.01.2018"})) #crossAxisValue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"TAB"})) #TAB doesn't works- add "a" at the end of textbox #workaround - edit another ui item, it should trigger leave of textbox select_by_text(placeLabels, "Outside start") 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": "DiagramAxisY"})) 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"], "01.01.2018") self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside start") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_autocorrect_options_writer(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:AutoCorrectDlg") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") #tab replace origtext = xDialog.getChild("origtext") newtext = xDialog.getChild("newtext") xnew = xDialog.getChild("new") xdelete = xDialog.getChild("delete") xtabview = xDialog.getChild("tabview") xreset = xDialog.getChild("reset") nrRows = get_state_as_dict(xtabview)["VisibleCount"] self.assertTrue(int(nrRows) > 0) #add new rule origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"})) newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"})) xnew.executeAction("CLICK", tuple()) nrRowsNew = get_state_as_dict(xtabview)["VisibleCount"] nrRowsDiff = int(nrRowsNew) - int(nrRows) self.assertEqual(nrRowsDiff, 1) #we have +1 rule #delete rule origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"})) newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"})) xdelete.executeAction("CLICK", tuple()) self.assertEqual(get_state_as_dict(xtabview)["VisibleCount"], nrRows) #we have default nr of rules select_pos(xTabs, "1") #tab Exceptions #abbreviations abbrev = xDialog.getChild("abbrev") newabbrev = xDialog.getChild("newabbrev") delabbrev = xDialog.getChild("delabbrev") abbrevlist = xDialog.getChild("abbrevlist") nrRowsAbb = get_state_as_dict(abbrevlist)["VisibleCount"] self.assertTrue(int(nrRowsAbb) > 0) abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"})) newabbrev.executeAction("CLICK", tuple()) nrRowsAbbNew = get_state_as_dict(abbrevlist)["VisibleCount"] nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb) self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule delabbrev.executeAction("CLICK", tuple()) self.assertEqual(get_state_as_dict(abbrevlist)["VisibleCount"], nrRowsAbb) #we have default nr of rules #words with two initial capitals double = xDialog.getChild("double") newdouble = xDialog.getChild("newdouble") deldouble = xDialog.getChild("deldouble") doublelist = xDialog.getChild("doublelist") nrRowsDouble = get_state_as_dict(doublelist)["VisibleCount"] self.assertTrue(int(nrRowsDouble) > 0) double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"})) newdouble.executeAction("CLICK", tuple()) nrRowsDoubleNew = get_state_as_dict(doublelist)["VisibleCount"] nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule deldouble.executeAction("CLICK", tuple()) self.assertEqual(get_state_as_dict(doublelist)["VisibleCount"], nrRowsDouble) #we have default nr of rules xCancelButton = xDialog.getChild("cancel") xCancelButton.executeAction("CLICK", tuple()) self.ui_test.close_doc()
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() 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()
def test_chart_wall_dialog(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog, set centimeters xDialog = self.xUITest.getTopFocusWindow() xPages = xDialog.getChild("pages") xCalcEntry = xPages.getChild('3') # calc xCalcEntry.executeAction("EXPAND", tuple()) xCalcGeneralEntry = xCalcEntry.getChild('0') xCalcGeneralEntry.executeAction("SELECT", tuple()) #General xMetric = xDialog.getChild("unitlb") props = {"TEXT": "Centimeter"} actionProps = mkPropertyValues(props) xMetric.executeAction("SELECT", actionProps) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) 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": "DiagramWall"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Borders". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") # print(xDialog.getChildren()) # xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") xWidth.executeAction("UP", tuple()) transparency.executeAction("UP", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify tab "Borders". 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": "DiagramWall"})) xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") #Click on tab "Area" tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") btncolor = xDialog.getChild("btncolor") btncolor.executeAction("CLICK", tuple()) rCustom = xDialog.getChild("R_custom") gCustom = xDialog.getChild("G_custom") bCustom = xDialog.getChild("B_custom") rCustom.executeAction("CLEAR", tuple()) rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) rCustom.executeAction("UP", tuple()) rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") gCustom.executeAction("CLEAR", tuple()) gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) gCustom.executeAction("UP", tuple()) gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works bCustom.executeAction("CLEAR", tuple()) bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) bCustom.executeAction("UP", tuple()) bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify tab "Area". 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": "DiagramWall"})) xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") rCustom = xDialog.getChild("R_custom") gCustom = xDialog.getChild("G_custom") bCustom = xDialog.getChild("B_custom") self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") #change tab "Transparency" select_pos(tabcontrol, "2") transparency = xDialog.getChild("RBT_TRANS_LINEAR") transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% transparency.executeAction("CLICK", tuple()) transparencyPercent.executeAction("UP", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify tab "Transparency" 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": "DiagramWall"})) xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "2") transparency = xDialog.getChild("RBT_TRANS_LINEAR") transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_insert_caption(self): self.ui_test.create_doc_in_start_center("writer") document = self.ui_test.get_component() self.ui_test.execute_dialog_through_command( ".uno:InsertFrame") # insert frame xDialogFr = self.xUITest.getTopFocusWindow() xWidth = xDialogFr.getChild("width") xWidth.executeAction("UP", tuple()) xWidth.executeAction("UP", tuple()) xHeight = xDialogFr.getChild("height") xHeight.executeAction("UP", tuple()) xHeight.executeAction("UP", tuple()) xOkBtn = xDialogFr.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) self.assertEqual(document.TextFrames.getCount(), 1) self.ui_test.execute_dialog_through_command( ".uno:InsertCaptionDialog") # caption xDialogCaption = self.xUITest.getTopFocusWindow() xCapt = xDialogCaption.getChild("caption_edit") xCapt.executeAction("TYPE", mkPropertyValues({"TEXT": "Caption"})) xOkBtn = xDialogCaption.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) xFrame = document.TextFrames.getByIndex(0) self.assertEqual( document.TextFrames.getByIndex(0).Text.String, "\nText 1: Caption") self.ui_test.execute_dialog_through_command( ".uno:InsertCaptionDialog") # 2nd caption xDialogCaption = self.xUITest.getTopFocusWindow() xCapt = xDialogCaption.getChild("caption_edit") xCapt.executeAction("TYPE", mkPropertyValues({"TEXT": "Caption2"})) xSep = xDialogCaption.getChild("separator_edit") xSep.executeAction("TYPE", mkPropertyValues({"TEXT": "-"})) xOkBtn = xDialogCaption.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) self.assertEqual( document.TextFrames.getByIndex(0).Text.String, "\nText 1: Caption\nText 2-: Caption2") self.ui_test.execute_dialog_through_command( ".uno:InsertCaptionDialog") # 3. caption xDialogCaption = self.xUITest.getTopFocusWindow() xCapt = xDialogCaption.getChild("caption_edit") xCapt.executeAction("TYPE", mkPropertyValues({"TEXT": "Caption3"})) xSep = xDialogCaption.getChild("separator_edit") xSep.executeAction("TYPE", mkPropertyValues({"TEXT": "-"})) xPos = xDialogCaption.getChild("position") select_pos(xPos, "1") xOkBtn = xDialogCaption.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) self.assertEqual( document.TextFrames.getByIndex(0).Text.String, "\nText 1: Caption\nText 2-: Caption2\nText 3--: Caption3") self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab:
def test_format_paragraph_tab_text_flow(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, "2") xAutomaticaly = xDialog.getChild("checkAuto") xEnd = xDialog.getChild("spinLineEnd") xBegin = xDialog.getChild("spinLineBegin") xMax = xDialog.getChild("spinMaxNum") xIns = xDialog.getChild("checkInsert") xType = xDialog.getChild("comboBreakType") xPosition = xDialog.getChild("comboBreakPosition") xspinOrphan = xDialog.getChild("spinOrphan") xspinWidow = xDialog.getChild("spinWidow") xcheckWidow = xDialog.getChild("checkWidow") xcheckOrphan = xDialog.getChild("checkOrphan") xcheckSplitPara = xDialog.getChild("checkSplitPara") xcheckKeepPara = xDialog.getChild("checkKeepPara") xAutomaticaly.executeAction("CLICK", tuple()) xEnd.executeAction("UP", tuple()) xBegin.executeAction("UP", tuple()) xMax.executeAction("UP", tuple()) xIns.executeAction("CLICK", tuple()) select_by_text(xType, "Column") select_by_text(xPosition, "After") xspinOrphan.executeAction("UP", tuple()) xspinWidow.executeAction("UP", tuple()) xcheckWidow.executeAction("CLICK", tuple()) xcheckOrphan.executeAction("CLICK", tuple()) xcheckSplitPara.executeAction("CLICK", tuple()) xcheckKeepPara.executeAction("CLICK", 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, "2") xAutomaticaly = xDialog.getChild("checkAuto") xEnd = xDialog.getChild("spinLineEnd") xBegin = xDialog.getChild("spinLineBegin") xMax = xDialog.getChild("spinMaxNum") xIns = xDialog.getChild("checkInsert") xType = xDialog.getChild("comboBreakType") xPosition = xDialog.getChild("comboBreakPosition") xspinOrphan = xDialog.getChild("spinOrphan") xspinWidow = xDialog.getChild("spinWidow") xcheckWidow = xDialog.getChild("checkWidow") xcheckOrphan = xDialog.getChild("checkOrphan") xcheckSplitPara = xDialog.getChild("checkSplitPara") xcheckKeepPara = xDialog.getChild("checkKeepPara") self.assertEqual(get_state_as_dict(xAutomaticaly)["Selected"], "true") self.assertEqual(get_state_as_dict(xEnd)["Text"], "3") self.assertEqual(get_state_as_dict(xBegin)["Text"], "3") self.assertEqual(get_state_as_dict(xMax)["Text"], "1") self.assertEqual(get_state_as_dict(xIns)["Selected"], "true") self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Column") self.assertEqual( get_state_as_dict(xPosition)["SelectEntryText"], "After") self.assertEqual(get_state_as_dict(xspinOrphan)["Text"], "2") self.assertEqual(get_state_as_dict(xspinWidow)["Text"], "2") self.assertEqual(get_state_as_dict(xcheckWidow)["Selected"], "false") self.assertEqual(get_state_as_dict(xcheckOrphan)["Selected"], "false") self.assertEqual( get_state_as_dict(xcheckSplitPara)["Selected"], "true") self.assertEqual(get_state_as_dict(xcheckKeepPara)["Selected"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_chart_data_labels_percentage_dialog(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("dataLabels.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": "FormatDataLabels"})) xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER") valueAsPercentage = xDialog.getChild("CB_VALUE_AS_PERCENTAGE") category = xDialog.getChild("CB_CATEGORY") legend = xDialog.getChild("CB_SYMBOL") wrapText = xDialog.getChild("CB_WRAP_TEXT") separator = xDialog.getChild("LB_TEXT_SEPARATOR") placement = xDialog.getChild("LB_LABEL_PLACEMENT") degrees = xDialog.getChild("NF_LABEL_DEGREES") textDirection = xDialog.getChild("LB_LABEL_TEXTDIR") buttonPercentage = xDialog.getChild("PB_PERCENT_NUMBERFORMAT") valueAsNumber.executeAction("CLICK", tuple()) valueAsPercentage.executeAction("CLICK", tuple()) #button Percentage format def handle_perc_dlg(dialog): # print(dialog.getChildren()) sourceformat = dialog.getChild("sourceformat") decimalsed = dialog.getChild("decimalsed") leadzerosed = dialog.getChild("leadzerosed") negnumred = dialog.getChild("negnumred") thousands = dialog.getChild("thousands") formatted = dialog.getChild("formatted") sourceformat.executeAction("CLICK", tuple()) decimalsed.executeAction("UP", tuple()) leadzerosed.executeAction("UP", tuple()) negnumred.executeAction("CLICK", tuple()) thousands.executeAction("CLICK", tuple()) self.assertEqual(get_state_as_dict(formatted)["Text"], "#,#00.0%;[RED]-#,#00.0%") xOKButton = dialog.getChild("cancel") self.ui_test.close_dialog_through_button(xOKButton) self.ui_test.execute_blocking_action(buttonPercentage.executeAction, args=('CLICK', ()), dialog_handler=handle_perc_dlg) self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "false") self.assertEqual(get_state_as_dict(valueAsPercentage)["Selected"], "true") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify Percentage dialog 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": "FormatDataLabels"})) xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER") valueAsPercentage = xDialog.getChild("CB_VALUE_AS_PERCENTAGE") category = xDialog.getChild("CB_CATEGORY") legend = xDialog.getChild("CB_SYMBOL") wrapText = xDialog.getChild("CB_WRAP_TEXT") separator = xDialog.getChild("LB_TEXT_SEPARATOR") placement = xDialog.getChild("LB_LABEL_PLACEMENT") degrees = xDialog.getChild("NF_LABEL_DEGREES") textDirection = xDialog.getChild("LB_LABEL_TEXTDIR") buttonPercentage = xDialog.getChild("PB_PERCENT_NUMBERFORMAT") self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "false") self.assertEqual(get_state_as_dict(valueAsPercentage)["Selected"], "true") # #button Percentage format- it doesn't works in test, but it works in reality # def handle_perc_dlg(dialog): # sourceformat = dialog.getChild("sourceformat") # decimalsed = dialog.getChild("decimalsed") # leadzerosed = dialog.getChild("leadzerosed") # negnumred = dialog.getChild("negnumred") # thousands = dialog.getChild("thousands") # formatted = dialog.getChild("formatted") # self.assertEqual(get_state_as_dict(sourceformat)["Selected"], "false") # self.assertEqual(get_state_as_dict(decimalsed)["Text"], "1") # self.assertEqual(get_state_as_dict(leadzerosed)["Text"], "2") # self.assertEqual(get_state_as_dict(negnumred)["Selected"], "true") # self.assertEqual(get_state_as_dict(thousands)["Selected"], "true") # self.assertEqual(get_state_as_dict(formatted)["Text"], "#,#00.0%;[RED]-#,#00.0%") # xOKButton = dialog.getChild("cancel") # self.ui_test.close_dialog_through_button(xOKButton) # self.ui_test.execute_blocking_action(buttonPercentage.executeAction, args=('CLICK', ()), # dialog_handler=handle_perc_dlg) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_format_paragraph_tab_indents_spacing(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, "0") xBeforeText = xDialog.getChild("spinED_LEFTINDENT") xAfterText = xDialog.getChild("spinED_RIGHTINDENT") xFirstLine = xDialog.getChild("spinED_FLINEINDENT") xAutomaticChk = xDialog.getChild("checkCB_AUTO") xAbovePar = xDialog.getChild("spinED_TOPDIST") xBelowPar = xDialog.getChild("spinED_BOTTOMDIST") xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING") xLineSpacing = xDialog.getChild("comboLB_LINEDIST") xActivate = xDialog.getChild("checkCB_REGISTER") xBeforeText.executeAction("UP", tuple()) xAfterText.executeAction("UP", tuple()) xFirstLine.executeAction("UP", tuple()) xAutomaticChk.executeAction("CLICK", tuple()) xAbovePar.executeAction("UP", tuple()) xBelowPar.executeAction("UP", tuple()) xChkspace.executeAction("CLICK", tuple()) select_by_text(xLineSpacing, "Double") xActivate.executeAction("CLICK", 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, "0") xBeforeText = xDialog.getChild("spinED_LEFTINDENT") xAfterText = xDialog.getChild("spinED_RIGHTINDENT") xFirstLine = xDialog.getChild("spinED_FLINEINDENT") xAutomaticChk = xDialog.getChild("checkCB_AUTO") xAbovePar = xDialog.getChild("spinED_TOPDIST") xBelowPar = xDialog.getChild("spinED_BOTTOMDIST") xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING") xLineSpacing = xDialog.getChild("comboLB_LINEDIST") xActivate = xDialog.getChild("checkCB_REGISTER") self.assertEqual(get_state_as_dict(xBeforeText)["Text"], "0.50 ch") self.assertEqual(get_state_as_dict(xAfterText)["Text"], "0.50 ch") self.assertEqual(get_state_as_dict(xFirstLine)["Text"], "0.50 ch") self.assertEqual(get_state_as_dict(xAutomaticChk)["Selected"], "true") self.assertEqual(get_state_as_dict(xAbovePar)["Text"], "0.50 line") self.assertEqual(get_state_as_dict(xBelowPar)["Text"], "0.50 line") self.assertEqual(get_state_as_dict(xChkspace)["Selected"], "true") self.assertEqual( get_state_as_dict(xLineSpacing)["SelectEntryText"], "Double") self.assertEqual(get_state_as_dict(xActivate)["Selected"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_chart_y_axis_dialog(self): calc_doc = self.ui_test.load_file( get_url_for_data_file("tdf122398.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() change_measurement_unit(self, "Centimeter") 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": "DiagramAxisY" })) # X Axis... xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Scale". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") reverseDirection = xDialog.getChild("CBX_REVERSE") logarithmicScale = xDialog.getChild("CBX_LOGARITHM") autoMinimum = xDialog.getChild("CBX_AUTO_MIN") autoMaximum = xDialog.getChild("CBX_AUTO_MAX") majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") minimum = xDialog.getChild("EDT_MIN") maximum = xDialog.getChild("EDT_MAX") major = xDialog.getChild("EDT_STEP_MAIN") minor = xDialog.getChild("MT_STEPHELP") reverseDirection.executeAction("CLICK", tuple()) logarithmicScale.executeAction("CLICK", tuple()) autoMinimum.executeAction("CLICK", tuple()) autoMaximum.executeAction("CLICK", tuple()) majorInterval.executeAction("CLICK", tuple()) minorInterval.executeAction("CLICK", tuple()) minimum.executeAction("UP", tuple()) #1 maximum.executeAction("DOWN", tuple()) #17 major.executeAction("DOWN", tuple()) #1 minor.executeAction("UP", tuple()) #3 xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify 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": "DiagramAxisY"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Scale". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") reverseDirection = xDialog.getChild("CBX_REVERSE") logarithmicScale = xDialog.getChild("CBX_LOGARITHM") autoMinimum = xDialog.getChild("CBX_AUTO_MIN") autoMaximum = xDialog.getChild("CBX_AUTO_MAX") majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN") minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP") minimum = xDialog.getChild("EDT_MIN") maximum = xDialog.getChild("EDT_MAX") major = xDialog.getChild("EDT_STEP_MAIN") minor = xDialog.getChild("MT_STEPHELP") self.assertEqual( get_state_as_dict(reverseDirection)["Selected"], "true") self.assertEqual( get_state_as_dict(logarithmicScale)["Selected"], "true") self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false") self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false") self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false") self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false") self.assertEqual(get_state_as_dict(minimum)["Text"], "1") self.assertEqual(get_state_as_dict(maximum)["Text"], "17") self.assertEqual(get_state_as_dict(major)["Text"], "1") self.assertEqual(get_state_as_dict(minor)["Text"], "3") #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") props = {"TEXT": "Start"} actionProps = mkPropertyValues(props) crossAxis.executeAction("SELECT", actionProps) props2 = {"TEXT": "Outside end"} actionProps2 = mkPropertyValues(props2) placeLabels.executeAction("SELECT", actionProps2) innerMajorTick.executeAction("CLICK", tuple()) outerMajorTick.executeAction("CLICK", tuple()) innerMinorTick.executeAction("CLICK", tuple()) outerMinorTick.executeAction("CLICK", tuple()) props3 = {"TEXT": "At axis"} actionProps3 = mkPropertyValues(props3) placeMarks.executeAction("SELECT", actionProps3) 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": "DiagramAxisY"})) 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"], "Start") self.assertEqual( get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") self.assertEqual( get_state_as_dict(outerMajorTick)["Selected"], "false") self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") self.assertEqual( get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") #change tab "positioning". props = {"TEXT": "Value"} actionProps = mkPropertyValues(props) crossAxis.executeAction("SELECT", actionProps) crossAxisValue.executeAction("CLEAR", tuple()) crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT": "19.01.2018" })) #19.01.2018 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": "DiagramAxisY"})) 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"], "19.01.2018") #bug 123520 self.assertEqual( get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end") self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true") self.assertEqual( get_state_as_dict(outerMajorTick)["Selected"], "false") self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true") self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true") self.assertEqual( get_state_as_dict(placeMarks)["SelectEntryText"], "At axis") #change tab "Line". select_pos(tabcontrol, "2") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") xWidth.executeAction("UP", tuple()) transparency.executeAction("UP", tuple()) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify tab "Line". 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": "DiagramAxisY"})) xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "2") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") #change tab "Label" tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "3") tile = xDialog.getChild("tile") overlapCB = xDialog.getChild("overlapCB") breakCB = xDialog.getChild("breakCB") stackedCB = xDialog.getChild("stackedCB") textdirLB = xDialog.getChild("textdirLB") tile.executeAction("CLICK", tuple()) overlapCB.executeAction("CLICK", tuple()) breakCB.executeAction("CLICK", tuple()) stackedCB.executeAction("CLICK", tuple()) props = {"TEXT": "Right-to-left"} actionProps = mkPropertyValues(props) textdirLB.executeAction("SELECT", actionProps) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify tab "Label". 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": "DiagramAxisY"})) xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "3") tile = xDialog.getChild("tile") overlapCB = xDialog.getChild("overlapCB") breakCB = xDialog.getChild("breakCB") stackedCB = xDialog.getChild("stackedCB") textdirLB = xDialog.getChild("textdirLB") self.assertEqual(get_state_as_dict(tile)["Checked"], "true") self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true") self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true") self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true") self.assertEqual( get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_format_paragraph_tab_tabs(self): self.ui_test.create_doc_in_start_center("writer") document = self.ui_test.get_component() xWriterDoc = self.xUITest.getTopFocusWindow() change_measurement_unit(self, "Centimeter") self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL") xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR") xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER") xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER") xNewButtn = xDialog.getChild("buttonBTN_NEW") xED_TABPOS = xDialog.getChild("ED_TABPOS") xDecimal.executeAction("CLICK", tuple()) xDecimalTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xDecimalTxt.executeAction("TYPE", mkPropertyValues({"TEXT": "i"})) xFill.executeAction("CLICK", tuple()) xFillTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xFillTxt.executeAction("TYPE", mkPropertyValues({"TEXT": "p"})) xED_TABPOS.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) xED_TABPOS.executeAction("TYPE", mkPropertyValues({"TEXT": "1"})) xNewButtn.executeAction("CLICK", 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, "5") xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL") xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR") xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER") xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER") xNewButtn = xDialog.getChild("buttonBTN_NEW") xED_TABPOS = xDialog.getChild("ED_TABPOS") self.assertEqual(get_state_as_dict(xDecimal)["Checked"], "true") self.assertEqual(get_state_as_dict(xDecimalTxt)["Text"], "i") self.assertEqual(get_state_as_dict(xFill)["Checked"], "true") self.assertEqual(get_state_as_dict(xFillTxt)["Text"], "p") self.assertEqual(get_state_as_dict(xED_TABPOS)["Text"], "1.00 cm") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER") xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE") xNewButtn = xDialog.getChild("buttonBTN_NEW") xCentered.executeAction("CLICK", tuple()) xUnderscore.executeAction("CLICK", tuple()) xNewButtn.executeAction("CLICK", 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, "5") xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER") xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE") self.assertEqual(get_state_as_dict(xCentered)["Checked"], "true") self.assertEqual(get_state_as_dict(xUnderscore)["Checked"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN") xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE") xNewButtn = xDialog.getChild("buttonBTN_NEW") xRight.executeAction("CLICK", tuple()) xDashLine.executeAction("CLICK", tuple()) xNewButtn.executeAction("CLICK", 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, "5") xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN") xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE") self.assertEqual(get_state_as_dict(xRight)["Checked"], "true") self.assertEqual(get_state_as_dict(xDashLine)["Checked"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "5") xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN") xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS") xNewButtn = xDialog.getChild("buttonBTN_NEW") xLeft.executeAction("CLICK", tuple()) xPointsLine.executeAction("CLICK", tuple()) xNewButtn.executeAction("CLICK", 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, "5") xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN") xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS") self.assertEqual(get_state_as_dict(xLeft)["Checked"], "true") self.assertEqual(get_state_as_dict(xPointsLine)["Checked"], "true") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf135590(self): writer_doc = self.ui_test.create_doc_in_start_center("writer") #change measurement to Centimeter change_measurement_unit(self, 'Centimeter') self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope") xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") xWidth = xDialog.getChild('width') xHeight = xDialog.getChild('height') xFormat = xDialog.getChild("format") xFormat.executeAction("SELECT", mkPropertyValues({"TEXT": "C6 Envelope"})) self.assertEqual("16.2", get_state_as_dict(xWidth)['Value']) self.assertEqual("11.4", get_state_as_dict(xHeight)['Value']) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) # A new document is created xWriterDoc = self.xUITest.getTopFocusWindow() xWriterEdit = xWriterDoc.getChild("writer_edit") self.ui_test.execute_dialog_through_command(".uno:PageDialog") xDialog = self.xUITest.getTopFocusWindow() tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "1") xWidth = xDialog.getChild('spinWidth') xHeight = xDialog.getChild('spinHeight') xFormatList = xDialog.getChild("comboPageFormat") # Without the fix in place, this test would have failed with # AssertionError: '16.2' != '11.4' self.assertEqual("16.2", get_state_as_dict(xWidth)['Value']) self.assertEqual("11.4", get_state_as_dict(xHeight)['Value']) self.assertEqual("User", get_state_as_dict(xFormatList)['SelectEntryText']) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.xUITest.executeCommand(".uno:Sidebar") xWriterEdit.executeAction( "SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"})) xPaperSize = xWriterEdit.getChild('papersize') self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User") self.assertEqual( get_state_as_dict(xPaperSize)['SelectEntryText'], "User") xPaperHeight = xWriterEdit.getChild('paperheight') self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "11.40 cm") self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "11.40 cm") xPaperWidth = xWriterEdit.getChild('paperwidth') self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "16.20 cm") self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "16.20 cm") self.xUITest.executeCommand(".uno:Sidebar") self.ui_test.close_doc()
def test_format_paragraph_transparency(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, "9") xTran = xDialog.getChild("RBT_TRANS_LINEAR") xTranText = xDialog.getChild("MTR_TRANSPARENT") xTran.executeAction("CLICK", tuple()) xTranText.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, "9") xTran = xDialog.getChild("RBT_TRANS_LINEAR") xTranText = xDialog.getChild("MTR_TRANSPARENT") self.assertEqual(get_state_as_dict(xTran)["Checked"], "true") self.assertEqual(get_state_as_dict(xTranText)["Text"], "51%") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "9") xGradient = xDialog.getChild("RBT_TRANS_GRADIENT") xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES") xAngle = xDialog.getChild("MTR_TRGR_ANGLE") xBorder = xDialog.getChild("MTR_TRGR_BORDER") xStart = xDialog.getChild("MTR_TRGR_START_VALUE") xEnd = xDialog.getChild("MTR_TRGR_END_VALUE") xGradient.executeAction("CLICK", tuple()) select_by_text(xType, "Axial") xAngle.executeAction("UP", tuple()) xBorder.executeAction("UP", tuple()) xStart.executeAction("UP", tuple()) xEnd.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, "9") xGradient = xDialog.getChild("RBT_TRANS_GRADIENT") xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES") xAngle = xDialog.getChild("MTR_TRGR_ANGLE") xBorder = xDialog.getChild("MTR_TRGR_BORDER") xStart = xDialog.getChild("MTR_TRGR_START_VALUE") xEnd = xDialog.getChild("MTR_TRGR_END_VALUE") self.assertEqual(get_state_as_dict(xGradient)["Checked"], "true") self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Axial") self.assertEqual(get_state_as_dict(xAngle)["Text"], "1°") self.assertEqual(get_state_as_dict(xBorder)["Text"], "1%") self.assertEqual(get_state_as_dict(xStart)["Text"], "1%") self.assertEqual(get_state_as_dict(xEnd)["Text"], "1%") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_recent_color_selector(self): #This is to test recent color selection 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 cell A5 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "6") #tab Numbers # click on color btn xbtncolor = xDialog.getChild("btncolor") xbtncolor.executeAction("CLICK", tuple()) # we will select color for cell A5 to be able to predict the latest color in # recent color selector xpaletteselector = xDialog.getChild("paletteselector") xColorpage = xDialog.getChild("ColorPage") color_selector = xColorpage.getChild("colorset") # For chart-palettes colors xpaletteselector.executeAction( "SELECT", mkPropertyValues({"TEXT": "chart-palettes"})) # Select Color with id 2 color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"})) self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2") self.assertEqual( get_state_as_dict(color_selector)["CurrColorPos"], "1") self.assertEqual( get_state_as_dict(color_selector)["ColorsCount"], "12") self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12") self.assertEqual( get_state_as_dict(color_selector)["ColorText"], "Chart 2") xrgb = get_state_as_dict(color_selector)["RGB"] # close the dialog after selection of the color xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) #select cell D3 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D3"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "6") #tab Numbers # click on color btn xbtncolor = xDialog.getChild("btncolor") xbtncolor.executeAction("CLICK", tuple()) xColorpage = xDialog.getChild("ColorPage") recent_color_selector = xColorpage.getChild("recentcolorset") # Select Color with id 1 recent_color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) self.assertEqual( get_state_as_dict(recent_color_selector)["CurrColorId"], "1") self.assertEqual( get_state_as_dict(recent_color_selector)["CurrColorPos"], "0") self.assertEqual( get_state_as_dict(recent_color_selector)["ColorText"], "Chart 2") self.assertEqual(get_state_as_dict(recent_color_selector)["RGB"], xrgb) xOk = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOk) self.ui_test.close_doc() # vim: set shiftwidth=4 softtabstop=4 expandtab:
def test_tdf93506_chart_trendline_dialog(self): calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf93506.ods")) xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") document = self.ui_test.get_component() self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog, set centimeters xDialog = self.xUITest.getTopFocusWindow() xPages = xDialog.getChild("pages") xCalcEntry = xPages.getChild('3') # calc xCalcEntry.executeAction("EXPAND", tuple()) xCalcGeneralEntry = xCalcEntry.getChild('0') xCalcGeneralEntry.executeAction("SELECT", tuple()) #General xMetric = xDialog.getChild("unitlb") props = {"TEXT": "Centimeter"} actionProps = mkPropertyValues(props) xMetric.executeAction("SELECT", actionProps) xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") # print(xDialog.getChildren()) #('AttributeDialog', 'CBX_SYNCHRONIZE', 'CB_SYMBOL_RATIO', 'CTL_PREVIEW', 'FL_EDGE_STYLE', 'FL_LINE', 'FL_LINE_ENDS', 'FL_SYMBOL_FORMAT', 'FT_CAP_STYLE', 'FT_COLOR', 'FT_EDGE_STYLE', 'FT_LINE_ENDS_STYLE', 'FT_LINE_END_WIDTH', 'FT_LINE_START_WIDTH', 'FT_LINE_STYLE', 'FT_LINE_WIDTH', 'FT_SYMBOL_HEIGHT', 'FT_SYMBOL_WIDTH', 'FT_TRANSPARENT', 'LB_CAP_STYLE', 'LB_COLOR', 'LB_EDGE_STYLE', 'LB_END_STYLE', 'LB_LINE_STYLE', 'LB_START_STYLE', 'LineTabPage', 'MB_SYMBOL_BITMAP', 'MF_SYMBOL_HEIGHT', 'MF_SYMBOL_WIDTH', 'MTR_FLD_END_WIDTH', 'MTR_FLD_LINE_WIDTH', 'MTR_FLD_START_WIDTH', 'MTR_LINE_TRANSPARENT', 'TP_TRENDLINE', 'TSB_CENTER_END', 'TSB_CENTER_START', 'alignment1', 'alignment2', 'alignment3', 'alignment4', 'alignment6', 'auto_color_button', 'box1', 'box2', 'box3', 'box4', 'box5', 'boxARROW_STYLES', 'boxCOLOR', 'boxEND', 'boxSTART', 'boxTRANSPARENCY', 'boxWIDTH', 'cancel', 'color_picker_button', 'colorset', 'colorsetwin', 'degree', 'dialog-action_area1', 'dialog-vbox1', 'entry_Xname', 'entry_Yname', 'entry_name', 'exponential', 'extrapolateBackward', 'extrapolateForward', 'frame1', 'frame2', 'grid1', 'grid2', 'grid3', 'grid5', 'gridEDGE_CAPS', 'gridICON_SIZE', 'help', 'imageExponential', 'imageLinear', 'imageLogarithmic', 'imageMovingAverage', 'imagePolynomial', 'imagePower', 'interceptValue', 'label1', 'label2', 'label3', 'label4', 'label5', 'label6', 'label7', 'label8', 'label9', 'linear', 'logarithmic', 'movingAverage', 'none_color_button', 'ok', 'palette_listbox', 'palette_popup_window', 'period', 'polynomial', 'power', 'recent_colorset', 'reset', 'separator1', 'separator3', 'separator4', 'setIntercept', 'showCorrelationCoefficient', 'showEquation', 'tabcontrol') logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") logarithmic.executeAction("CLICK", tuple()) xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) extrapolateForward.executeAction("UP", tuple()) extrapolateBackward.executeAction("UP", tuple()) showEquation.executeAction("CLICK", tuple()) showCorrelationCoefficient.executeAction("CLICK", tuple()) xVarname.executeAction("CLEAR", tuple()) xVarname.executeAction("TYPE", mkPropertyValues({"TEXT":"a"})) yVarName.executeAction("CLEAR", tuple()) yVarName.executeAction("TYPE", mkPropertyValues({"TEXT":"f(a)"})) #Click on tab "Line". select_pos(tabcontrol, "1") # print(xDialog.getChildren()) # ('AttributeDialog', 'CBX_SYNCHRONIZE', 'CB_SYMBOL_RATIO', 'CTL_PREVIEW', 'FL_EDGE_STYLE', 'FL_LINE', 'FL_LINE_ENDS', 'FL_SYMBOL_FORMAT', 'FT_CAP_STYLE', 'FT_COLOR', 'FT_EDGE_STYLE', 'FT_LINE_ENDS_STYLE', 'FT_LINE_END_WIDTH', 'FT_LINE_START_WIDTH', 'FT_LINE_STYLE', 'FT_LINE_WIDTH', 'FT_SYMBOL_HEIGHT', 'FT_SYMBOL_WIDTH', 'FT_TRANSPARENT', 'LB_CAP_STYLE', 'LB_COLOR', 'LB_EDGE_STYLE', 'LB_END_STYLE', 'LB_LINE_STYLE', 'LB_START_STYLE', 'LineTabPage', 'MB_SYMBOL_BITMAP', 'MF_SYMBOL_HEIGHT', 'MF_SYMBOL_WIDTH', 'MTR_FLD_END_WIDTH', 'MTR_FLD_LINE_WIDTH', 'MTR_FLD_START_WIDTH', 'MTR_LINE_TRANSPARENT', 'TP_TRENDLINE', 'TSB_CENTER_END', 'TSB_CENTER_START', 'alignment1', 'alignment2', 'alignment3', 'alignment4', 'alignment6', 'auto_color_button', 'box1', 'box2', 'box3', 'box4', 'box5', 'boxARROW_STYLES', 'boxCOLOR', 'boxEND', 'boxSTART', 'boxTRANSPARENCY', 'boxWIDTH', 'cancel', 'color_picker_button', 'colorset', 'colorsetwin', 'degree', 'dialog-action_area1', 'dialog-vbox1', 'entry_Xname', 'entry_Yname', 'entry_name', 'exponential', 'extrapolateBackward', 'extrapolateForward', 'frame1', 'frame2', 'grid1', 'grid2', 'grid3', 'grid5', 'gridEDGE_CAPS', 'gridICON_SIZE', 'help', 'imageExponential', 'imageLinear', 'imageLogarithmic', 'imageMovingAverage', 'imagePolynomial', 'imagePower', 'interceptValue', 'label1', 'label2', 'label3', 'label4', 'label5', 'label6', 'label7', 'label8', 'label9', 'linear', 'logarithmic', 'movingAverage', 'none_color_button', 'ok', 'palette_listbox', 'palette_popup_window', 'period', 'polynomial', 'power', 'recent_colorset', 'reset', 'separator1', 'separator3', 'separator4', 'setIntercept', 'showCorrelationCoefficient', 'showEquation', 'tabcontrol') xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") xWidth.executeAction("UP", tuple()) xTransparent.executeAction("UP", tuple()) self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") self.assertEqual(get_state_as_dict(logarithmic)["Checked"], "true") self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #Now change regression Type to Exponential 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") exponential.executeAction("CLICK", tuple()) #set exponential #set Force intercept setIntercept.executeAction("CLICK", tuple()) interceptValue.executeAction("UP", tuple()) #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify Exponential 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") self.assertEqual(get_state_as_dict(exponential)["Checked"], "true") self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #Now change regression Type to Power 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential power = xDialog.getChild("exponential") #type regression power xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") power.executeAction("CLICK", tuple()) #set power #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify Power 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential power = xDialog.getChild("exponential") #type regression power xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") self.assertEqual(get_state_as_dict(power)["Checked"], "true") self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") # self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") # self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #Now change regression Type to Polynomial 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential power = xDialog.getChild("exponential") #type regression power polynomial = xDialog.getChild("polynomial") #type regression polynomial degree = xDialog.getChild("degree") xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") polynomial.executeAction("CLICK", tuple()) #set polynomial degree.executeAction("UP", tuple()) #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify Polynomial 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential power = xDialog.getChild("exponential") #type regression power polynomial = xDialog.getChild("polynomial") #type regression polynomial degree = xDialog.getChild("degree") xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") self.assertEqual(get_state_as_dict(polynomial)["Checked"], "true") self.assertEqual(get_state_as_dict(degree)["Text"], "3") self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1") self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1") self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true") self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true") self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1") self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true") self.assertEqual(get_state_as_dict(xVarname)["Text"], "a") self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)") #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #Now change regression Type to Moving average 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential power = xDialog.getChild("exponential") #type regression power movingAverage = xDialog.getChild("movingAverage") #type regression Moving average period = xDialog.getChild("period") xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") movingAverage.executeAction("CLICK", tuple()) #set polynomial period.executeAction("UP", tuple()) #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) #reopen and verify Moving average 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": "FormatTrendline"})) xDialog = self.xUITest.getTopFocusWindow() #Click on tab "Type". tabcontrol = xDialog.getChild("tabcontrol") select_pos(tabcontrol, "0") logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic exponential = xDialog.getChild("exponential") #type regression exponential power = xDialog.getChild("exponential") #type regression power polynomial = xDialog.getChild("polynomial") #type regression polynomial movingAverage = xDialog.getChild("movingAverage") #type regression Moving average degree = xDialog.getChild("degree") period = xDialog.getChild("period") xentryname = xDialog.getChild("entry_name") #add name extrapolateForward = xDialog.getChild("extrapolateForward") extrapolateBackward = xDialog.getChild("extrapolateBackward") setIntercept = xDialog.getChild("setIntercept") interceptValue = xDialog.getChild("interceptValue") showEquation = xDialog.getChild("showEquation") showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient") xVarname = xDialog.getChild("entry_Xname") yVarName = xDialog.getChild("entry_Yname") self.assertEqual(get_state_as_dict(movingAverage)["Checked"], "true") self.assertEqual(get_state_as_dict(period)["Text"], "3") self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name") #Click on tab "Line". select_pos(tabcontrol, "1") xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT") self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_create_local_range_name(self): self.ui_test.create_doc_in_start_center("calc") calcDoc = self.xUITest.getTopFocusWindow() xPosWindow = calcDoc.getChild('pos_window') self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text']) self.ui_test.execute_modeless_dialog_through_command(".uno:AddName") xAddNameDlg = self.xUITest.getTopFocusWindow() xEdit = xAddNameDlg.getChild("edit") type_text(xEdit, "localRangeName") xScope = xAddNameDlg.getChild("scope") select_pos(xScope, "1") xAddBtn = xAddNameDlg.getChild("add") self.ui_test.close_dialog_through_button(xAddBtn) # tdf#67007: Without the fix in place, this test would have failed with # AssertionError: 'localRangeName' != 'A1' self.assertEqual('localRangeName', get_state_as_dict(xPosWindow)['Text']) gridwin = calcDoc.getChild("grid_window") enter_text_to_cell(gridwin, "A1", "1") # Use the name range in the current sheet gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"})) self.ui_test.execute_dialog_through_command(".uno:InsertName") xDialog = self.xUITest.getTopFocusWindow() xCtrl = xDialog.getChild('ctrl') self.assertEqual(1, len(xCtrl.getChildren())) self.assertEqual("localRangeName\t$Sheet1.$A$1\tSheet1", get_state_as_dict(xCtrl.getChild('0'))['Text']) xCtrl.getChild('0').executeAction("SELECT", tuple()) xPasteBtn = xDialog.getChild("paste") self.ui_test.close_dialog_through_button(xPasteBtn) # use return key to paste the name range gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) document = self.ui_test.get_component() self.assertEqual("1", get_cell_by_position(document, 0, 1, 0).getString()) self.assertEqual("=localRangeName", get_cell_by_position(document, 0, 1, 0).getFormula()) # Insert a new sheet self.ui_test.execute_dialog_through_command(".uno:Insert") xDialog = self.xUITest.getTopFocusWindow() xOKButton = xDialog.getChild("ok") xOKButton.executeAction("CLICK", tuple()) # Use the name range in the new sheet gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"})) self.ui_test.execute_dialog_through_command(".uno:InsertName") xDialog = self.xUITest.getTopFocusWindow() xCtrl = xDialog.getChild('ctrl') self.assertEqual(1, len(xCtrl.getChildren())) self.assertEqual("localRangeName\t$Sheet1.$A$1\tSheet1", get_state_as_dict(xCtrl.getChild('0'))['Text']) xCtrl.getChild('0').executeAction("SELECT", tuple()) xPasteBtn = xDialog.getChild("paste") self.ui_test.close_dialog_through_button(xPasteBtn) # use return key to paste the name range gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) # tdf#137896: Without the fix in place, this test would have failed with # AssertionError: '1' != '#NAME?' self.assertEqual("1", get_cell_by_position(document, 0, 1, 0).getString()) # and AssertionError: '=Sheet1.localRangeName' != '=localrangename' self.assertEqual("=Sheet1.localRangeName", get_cell_by_position(document, 0, 1, 0).getFormula()) self.ui_test.execute_dialog_through_command(".uno:DefineName") xDialog = self.xUITest.getTopFocusWindow() # tdf#138851: Without the fix in place, this test would have failed with # AssertionError: 'Sheet1' != 'Document (Global)' xScope = xDialog.getChild("scope") self.assertEqual("Sheet1", get_state_as_dict(xScope)['SelectEntryText']) xOkBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOkBtn) self.ui_test.close_doc()
def test_bullets_and_numbering_selection(self): self.ui_test.create_doc_in_start_center("writer") document = self.ui_test.get_component() xWriterDoc = self.xUITest.getTopFocusWindow() # Test Bullet Page self.ui_test.execute_dialog_through_command( ".uno:BulletsAndNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() # Select the BulletPage's Selector xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "0") xBulletPage = xDialog.getChild("PickBulletPage") xselector = xBulletPage.getChild("valueset") self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8") # Select elemet num 3 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "2") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "3") self.assertEqual( get_state_as_dict(xselector)["ItemText"], "Solid diamond bullets") # Select elemet num 7 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "7"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "6") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "7") self.assertEqual( get_state_as_dict(xselector)["ItemText"], "Cross mark bullets") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) # Test other Pages self.ui_test.execute_dialog_through_command( ".uno:BulletsAndNumberingDialog") xDialog = self.xUITest.getTopFocusWindow() # Select the NumberingPage's Selector xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "1") xNumberingPage = xDialog.getChild("PickNumberingPage") xselector = xNumberingPage.getChild("valueset") self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8") # Select elemet num 5 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "4") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "5") self.assertEqual( get_state_as_dict(xselector)["ItemText"], "Uppercase letter A) B) C)") # Select elemet num 8 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "8"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "7") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "8") self.assertEqual( get_state_as_dict(xselector)["ItemText"], "Lowercase Roman number i. ii. iii.") # Select the OutlinePage's Selector xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") xOutlinePage = xDialog.getChild("PickOutlinePage") xselector = xOutlinePage.getChild("valueset") self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8") # Select elemet num 1 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "0") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "1") self.assertEqual( get_state_as_dict(xselector)["ItemText"], "Numeric, numeric, lowercase letters, solid small circular bullet") # Select the GraphicPage's Selector xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "3") xGraphicPage = xDialog.getChild("PickGraphicPage") xselector = xGraphicPage.getChild("valueset") self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "92") # Select elemet num 22 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "22"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "21") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "22") # Select elemet num 73 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "73"})) self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "72") self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "73") xOKBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOKBtn) self.ui_test.close_doc()
def test_format_cell_font_effects_tab(self): #numberingformatpage.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() #select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") #tab Font Effects xRelief = xDialog.getChild("relieflb") xOverline = xDialog.getChild("overlinelb") xStrikeout = xDialog.getChild("strikeoutlb") xUnderline = xDialog.getChild("underlinelb") xEmphasis = xDialog.getChild("emphasislb") xPosition = xDialog.getChild("positionlb") select_pos(xRelief, "1") select_pos(xOverline, "1") select_pos(xStrikeout, "1") select_pos(xUnderline, "1") select_pos(xEmphasis, "1") select_pos(xPosition, "1") xOK = xDialog.getChild("ok") xOK.executeAction("CLICK", tuple()) #Verify- select cell A1 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) #format - cell self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xDialog = self.xUITest.getTopFocusWindow() xTabs = xDialog.getChild("tabcontrol") select_pos(xTabs, "2") xRelief = xDialog.getChild("relieflb") xOverline = xDialog.getChild("overlinelb") xStrikeout = xDialog.getChild("strikeoutlb") xUnderline = xDialog.getChild("underlinelb") xEmphasis = xDialog.getChild("emphasislb") xPosition = xDialog.getChild("positionlb") self.assertEqual( get_state_as_dict(xRelief)["SelectEntryText"], "Embossed") self.assertEqual( get_state_as_dict(xOverline)["SelectEntryText"], "Single") self.assertEqual( get_state_as_dict(xStrikeout)["SelectEntryText"], "Single") self.assertEqual( get_state_as_dict(xUnderline)["SelectEntryText"], "Single") self.assertEqual( get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot") self.assertEqual( get_state_as_dict(xPosition)["SelectEntryText"], "Below text") xCanc = xDialog.getChild("cancel") self.ui_test.close_dialog_through_button(xCanc) self.ui_test.close_doc()
def test_tdf126248(self): self.ui_test.create_doc_in_start_center("calc") self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") xCellsDlg = self.xUITest.getTopFocusWindow() select_pos(xCellsDlg, "2") # Get current font names from the Format Cell dialog westFontName = get_state_as_dict( xCellsDlg.getChild("westfontnamelb-cjk"))['Text'] eastFontName = get_state_as_dict( xCellsDlg.getChild("eastfontnamelb"))['Text'] okBtn = xCellsDlg.getChild("ok") self.ui_test.close_dialog_through_button(okBtn) self.changeLocalSetting("Chinese (traditional)") xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") enter_text_to_cell(gridwin, "A1", "Test") self.xUITest.executeCommand(".uno:Sidebar") gridwin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"})) xCalcDoc = self.xUITest.getTopFocusWindow() fontName = xCalcDoc.getChild("fontnamecombobox") self.ui_test.wait_until_property_is_updated(fontName, "Text", westFontName) # Without the fix in place, this test would have failed here self.assertEqual(westFontName, get_state_as_dict(fontName)['Text']) enter_text_to_cell(gridwin, "B1", "測試") self.ui_test.wait_until_property_is_updated(fontName, "Text", eastFontName) self.assertEqual(eastFontName, get_state_as_dict(fontName)['Text']) self.changeLocalSetting("Default - English (USA)") xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") fontName = xCalcDoc.getChild("fontnamecombobox") enter_text_to_cell(gridwin, "C1", "Test") self.ui_test.wait_until_property_is_updated(fontName, "Text", westFontName) self.assertEqual(westFontName, get_state_as_dict(fontName)['Text']) enter_text_to_cell(gridwin, "D1", "測試") self.ui_test.wait_until_property_is_updated(fontName, "Text", eastFontName) self.assertEqual(eastFontName, get_state_as_dict(fontName)['Text']) self.xUITest.executeCommand(".uno:Sidebar") self.ui_test.close_doc()