本文整理汇总了Python中uitest.uihelper.common.select_pos函数的典型用法代码示例。如果您正苦于以下问题:Python select_pos函数的具体用法?Python select_pos怎么用?Python select_pos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了select_pos函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_format_paragraph_area
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()
示例2: test_tdf115572_table_format_gets_reset_deleting_column
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()
示例3: test_td54018_sort_with_comments
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:
示例4: test_text_direction
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()
示例5: test_expand
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()
示例6: test_tdf122722_format_character_hidden
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()
示例7: test_background_dialog
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()
示例8: test_tdf53482_Range_contains_column_headings_file
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()
示例9: test_tdf125104_pageFormat_numbering
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()
示例10: test_format_character_tab_asian_layout
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()
示例11: test_tdf88792
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()
示例12: test_bullets_and_numbering_dialog_tab_position2
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()
示例13: test_down
def test_down(self):
self.ui_test.create_doc_in_start_center("calc")
self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
xCellsDlg = self.xUITest.getTopFocusWindow()
# select the numbers tab page
select_pos(xCellsDlg, "0")
xDecimalPlaces = xCellsDlg.getChild("leadzerosed")
xDecimalPlaces.executeAction("UP", tuple())
xDecimalPlaces.executeAction("UP", tuple())
decimal_places_state = get_state_as_dict(xDecimalPlaces)
assert(decimal_places_state["Text"] == "3")
xDecimalPlaces.executeAction("DOWN", tuple())
decimal_places_state = get_state_as_dict(xDecimalPlaces)
assert(decimal_places_state["Text"] == "2")
okBtn = xCellsDlg.getChild("ok")
self.ui_test.close_dialog_through_button(okBtn)
self.ui_test.close_doc()
示例14: test_td99627_natural_sort
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:
示例15: test_format_character_tab_position_scalewidthsb
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()