本文整理汇总了Python中uitest.uihelper.common.select_pos函数的典型用法代码示例。如果您正苦于以下问题:Python select_pos函数的具体用法?Python select_pos怎么用?Python select_pos使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了select_pos函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()
开发者ID:chrissherlock,项目名称:libreoffice-experimental,代码行数:25,代码来源:formatParagraph.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:29,代码来源:tdf115572.py
示例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:
开发者ID:rohanKanojia,项目名称:core,代码行数:34,代码来源:tdf54018.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:25,代码来源:pageDialog.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:28,代码来源:treelist.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:60,代码来源:tdf122722.py
示例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()
开发者ID:beppec56,项目名称:core,代码行数:35,代码来源:backgrounds.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:34,代码来源:tdf53482.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:27,代码来源:tdf125104.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:27,代码来源:formatCharacter.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:31,代码来源:subtotals.py
示例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()
开发者ID:chrissherlock,项目名称:libreoffice-experimental,代码行数:29,代码来源:formatBulletsNumbering.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:26,代码来源:spinfield.py
示例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:
开发者ID:LibreOffice,项目名称:core,代码行数:32,代码来源:tdf99627.py
示例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()
开发者ID:LibreOffice,项目名称:core,代码行数:28,代码来源:formatCharacter.py
示例16: test_natural_sorting_columns
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()
开发者ID:LibreOffice,项目名称:core,代码行数:33,代码来源:naturalSort.py
示例17: test_tdf81696_sort_cell_conditional_formatting
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:
开发者ID:LibreOffice,项目名称:core,代码行数:26,代码来源:tdf81696.py
示例18: test_natural_sorting_rows
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()
开发者ID:LibreOffice,项目名称:core,代码行数:59,代码来源:naturalSort.py
示例19: launch_dialog_and_select_tab
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
开发者ID:LibreOffice,项目名称:core,代码行数:8,代码来源:pageDialog.py
示例20: test_clear_cells_formats
def test_clear_cells_formats(self):
calc_doc = self.ui_test.create_doc_in_start_center("calc")
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
enter_text_to_cell(gridwin, "A1", "aa")
enter_text_to_cell(gridwin, "A2", "1")
gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
self.xUITest.executeCommand(".uno:Bold")
self.ui_test.execute_dialog_through_command(".uno:Delete")
xDialog = self.xUITest.getTopFocusWindow()
xdeleteall = xDialog.getChild("deleteall")
xtext = xDialog.getChild("text")
xdatetime = xDialog.getChild("datetime")
xcomments = xDialog.getChild("comments")
xobjects = xDialog.getChild("objects")
xnumbers = xDialog.getChild("numbers")
xformulas = xDialog.getChild("formulas")
xformats = xDialog.getChild("formats")
if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
xdeleteall.executeAction("CLICK", tuple())
if (get_state_as_dict(xtext)["Selected"]) == "true":
xtext.executeAction("CLICK", tuple())
if (get_state_as_dict(xdatetime)["Selected"]) == "true":
xdatetime.executeAction("CLICK", tuple())
if (get_state_as_dict(xcomments)["Selected"]) == "true":
xcomments.executeAction("CLICK", tuple())
if (get_state_as_dict(xobjects)["Selected"]) == "true":
xobjects.executeAction("CLICK", tuple())
if (get_state_as_dict(xnumbers)["Selected"]) == "true":
xnumbers.executeAction("CLICK", tuple())
if (get_state_as_dict(xformulas)["Selected"]) == "true":
xformulas.executeAction("CLICK", tuple())
if (get_state_as_dict(xformats)["Selected"]) == "false":
xformats.executeAction("CLICK", tuple())
xOKBtn = xDialog.getChild("ok")
self.ui_test.close_dialog_through_button(xOKBtn)
#Verify
gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
xDialog = self.xUITest.getTopFocusWindow()
xTabs = xDialog.getChild("tabcontrol")
select_pos(xTabs, "1") #tab Font
xstylelb = xDialog.getChild("weststylelb-cjk")
print(get_state_as_dict(xstylelb))
self.assertEqual(get_state_as_dict(xstylelb)["Text"], "Regular")
xOK = xDialog.getChild("ok")
xOK.executeAction("CLICK", tuple())
self.ui_test.close_doc()
开发者ID:LibreOffice,项目名称:core,代码行数:57,代码来源:clearCells.py
注:本文中的uitest.uihelper.common.select_pos函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论