Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
19e380cf
Kaydet (Commit)
19e380cf
authored
Haz 22, 2016
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
uitest: move the demo ui tests to the new unittest approach
Change-Id: I70222d701191f28f9dffb3bfdfbb7510d64d0251
üst
d8b376ad
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
211 additions
and
250 deletions
+211
-250
checkbox.py
uitest/demo_ui/checkbox.py
+12
-12
combobox.py
uitest/demo_ui/combobox.py
+14
-14
demo_ui.txt
uitest/demo_ui/demo_ui.txt
+0
-15
edit.py
uitest/demo_ui/edit.py
+14
-14
gridwin.py
uitest/demo_ui/gridwin.py
+26
-34
listbox.py
uitest/demo_ui/listbox.py
+24
-28
radiobutton.py
uitest/demo_ui/radiobutton.py
+12
-12
spinfield.py
uitest/demo_ui/spinfield.py
+48
-56
tabcontrol.py
uitest/demo_ui/tabcontrol.py
+17
-17
tabdialog.py
uitest/demo_ui/tabdialog.py
+22
-26
treelist.py
uitest/demo_ui/treelist.py
+22
-22
No files found.
uitest/demo_ui/checkbox.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -9,6 +9,8 @@ from uitest_helper import UITest
from
helper
import
mkPropertyValues
from
UITestCase
import
UITestCase
import
time
try
:
...
...
@@ -21,22 +23,20 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
toggle_checkbox
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
class
CheckBoxTest
(
UITestCase
):
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_toggle_checkbox
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
xNegativeNumRedCB
=
xCellsDlg
.
getChild
(
"negnumred"
)
xNegativeNumRedCB
.
executeAction
(
"CLICK"
,
tuple
())
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xNegativeNumRedCB
=
xCellsDlg
.
getChild
(
"negnumred"
)
xNegativeNumRedCB
.
executeAction
(
"CLICK"
,
tuple
())
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/combobox.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -9,25 +9,25 @@ from uitest_helper import UITest
from
helper
import
mkPropertyValues
def
select_entry_pos
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
from
UITestCase
import
UITestCase
ui_test
=
UITest
(
xUITest
,
xContext
)
class
ComboBoxTest
(
UITestCase
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
def
test_select_entry_pos
(
self
):
ui_test
.
execute_modeless_dialog_through_command
(
".uno:AddName"
)
xAddNameDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
scopeCB
=
xAddNameDlg
.
getChild
(
"scope"
)
props
=
{
"POS"
:
"1"
}
actionProps
=
mkPropertyValues
(
props
)
scopeCB
.
executeAction
(
"SELECT"
,
actionProps
)
self
.
ui_test
.
execute_modeless_dialog_through_command
(
".uno:AddName"
)
xAddNameDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xCancelBtn
=
xAddNameDlg
.
getChild
(
"cancel"
)
xCancelBtn
.
executeAction
(
"CLICK"
,
tuple
())
scopeCB
=
xAddNameDlg
.
getChild
(
"scope"
)
props
=
{
"POS"
:
"1"
}
actionProps
=
mkPropertyValues
(
props
)
scopeCB
.
executeAction
(
"SELECT"
,
actionProps
)
ui_test
.
close_doc
()
xCancelBtn
=
xAddNameDlg
.
getChild
(
"cancel"
)
xCancelBtn
.
executeAction
(
"CLICK"
,
tuple
())
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/demo_ui.txt
deleted
100644 → 0
Dosyayı görüntüle @
d8b376ad
demo_ui.checkbox.toggle_checkbox
demo_ui.combobox.select_entry_pos
demo_ui.edit.type_text
demo_ui.gridwin.select_cell
demo_ui.gridwin.select_range
demo_ui.gridwin.extend_range
demo_ui.listbox.select_entry_pos
demo_ui.listbox.select_entry_text
demo_ui.tabcontrol.select_pos
demo_ui.tabdialog.select_tab_page_pos
demo_ui.tabdialog.select_tab_page_name
demo_ui.treelist.expand
demo_ui.spinfield.up
demo_ui.spinfield.down
demo_ui.spinfield.text
uitest/demo_ui/edit.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -9,6 +9,8 @@ from uitest_helper import UITest
from
helper
import
mkPropertyValues
from
UITestCase
import
UITestCase
try
:
import
pyuno
import
uno
...
...
@@ -19,26 +21,24 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
type_text
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
class
EditTest
(
UITestCase
):
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_type_text
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
ui_test
.
execute_modeless_dialog_through_command
(
".uno:AddName"
)
xAddNameDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
execute_modeless_dialog_through_command
(
".uno:AddName"
)
xAddNameDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xEdit
=
xAddNameDlg
.
getChild
(
"edit"
)
xEdit
=
xAddNameDlg
.
getChild
(
"edit"
)
props
=
{
"TEXT"
:
"simpleRangeName"
}
actionProps
=
mkPropertyValues
(
props
)
xEdit
.
executeAction
(
"TYPE"
,
actionProps
)
props
=
{
"TEXT"
:
"simpleRangeName"
}
actionProps
=
mkPropertyValues
(
props
)
xEdit
.
executeAction
(
"TYPE"
,
actionProps
)
xAddBtn
=
xAddNameDlg
.
getChild
(
"cancel"
)
xAddBtn
.
executeAction
(
"CLICK"
,
tuple
())
xAddBtn
=
xAddNameDlg
.
getChild
(
"cancel"
)
xAddBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/gridwin.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -9,6 +9,8 @@ from uitest_helper import UITest
from
helper
import
mkPropertyValues
from
UITestCase
import
UITestCase
import
time
try
:
...
...
@@ -21,53 +23,43 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
select_cell
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
ui_test
=
UITest
(
xUITest
,
xContext
)
ui_test
.
create_doc_in_start_center
(
"calc"
)
xCalcDoc
=
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
class
GridWinTest
(
UITestCase
):
selectProps
=
mkPropertyValues
({
"CELL"
:
"B10"
})
xGridWindow
.
executeAction
(
"SELECT"
,
selectProps
)
def
test_select_cell
(
self
):
ui_test
.
close_doc
()
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
xCalcDoc
=
self
.
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
def
select_range
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
selectProps
=
mkPropertyValues
({
"CELL"
:
"B10"
})
xGridWindow
.
executeAction
(
"SELECT"
,
selectProps
)
ui_test
=
UITest
(
xUITest
,
xContext
)
self
.
ui_test
.
close_doc
(
)
ui_test
.
create_doc_in_start_center
(
"calc"
)
xCalcDoc
=
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
def
test_select_range
(
self
):
selectProps
=
mkPropertyValues
({
"RANGE"
:
"B10:C20"
})
xGridWindow
.
executeAction
(
"SELECT"
,
selectProps
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
xCalcDoc
=
self
.
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
ui_test
.
close_doc
()
selectProps
=
mkPropertyValues
({
"RANGE"
:
"B10:C20"
})
xGridWindow
.
executeAction
(
"SELECT"
,
selectProps
)
def
extend_range
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
self
.
ui_test
.
close_doc
()
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_extend_range
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
xTopWindow
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
xTopWindow
=
self
.
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xTopWindow
.
getChild
(
"grid_window"
)
xGridWindow
=
xTopWindow
.
getChild
(
"grid_window"
)
selectProps
=
mkPropertyValues
({
"RANGE"
:
"B10:C20"
})
xGridWindow
.
executeAction
(
"SELECT"
,
selectProps
)
selectProps
=
mkPropertyValues
({
"RANGE"
:
"B10:C20"
})
xGridWindow
.
executeAction
(
"SELECT"
,
selectProps
)
select2Props
=
mkPropertyValues
({
"RANGE"
:
"D3:F5"
,
"EXTEND"
:
"true"
})
xGridWindow
.
executeAction
(
"SELECT"
,
select2Props
)
select2Props
=
mkPropertyValues
({
"RANGE"
:
"D3:F5"
,
"EXTEND"
:
"true"
})
xGridWindow
.
executeAction
(
"SELECT"
,
select2Props
)
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/listbox.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -9,47 +9,43 @@ from uitest_helper import UITest
from
helper
import
mkPropertyValues
def
select_entry_pos
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
from
UITestCase
import
UITestCase
ui_test
=
UITest
(
xUITest
,
xContext
)
class
ListBoxTest
(
UITestCase
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
def
test_select_entry_pos
(
self
):
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
categoryLB
=
xCellsDlg
.
getChild
(
"categorylb"
)
props
=
{
"POS"
:
"4"
}
actionProps
=
mkPropertyValues
(
props
)
categoryLB
.
executeAction
(
"SELECT"
,
actionProps
)
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
categoryLB
=
xCellsDlg
.
getChild
(
"categorylb"
)
props
=
{
"POS"
:
"4"
}
actionProps
=
mkPropertyValues
(
props
)
categoryLB
.
executeAction
(
"SELECT"
,
actionProps
)
ui_test
.
close_doc
()
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
def
select_entry_text
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
self
.
ui_test
.
close_doc
()
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_select_entry_text
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
categoryLB
=
xCellsDlg
.
getChild
(
"categorylb"
)
props
=
{
"TEXT"
:
"Time"
}
categoryLB
=
xCellsDlg
.
getChild
(
"categorylb"
)
props
=
{
"TEXT"
:
"Time"
}
actionProps
=
mkPropertyValues
(
props
)
categoryLB
.
executeAction
(
"SELECT"
,
actionProps
)
actionProps
=
mkPropertyValues
(
props
)
categoryLB
.
executeAction
(
"SELECT"
,
actionProps
)
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/radiobutton.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -9,6 +9,8 @@ from uitest_helper import UITest
from
helper
import
mkPropertyValues
from
UITestCase
import
UITestCase
import
time
try
:
...
...
@@ -21,23 +23,21 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
toggle_radiobutton
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
class
RadioButtonTest
(
UITestCase
):
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_toggle_radiobutton
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
xNegativeNumRedCB
=
xCellsDlg
.
getChild
(
"negnumred"
)
xNegativeNumRedCB
.
executeAction
(
"CLICK"
,
tuple
())
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xNegativeNumRedCB
=
xCellsDlg
.
getChild
(
"negnumred"
)
xNegativeNumRedCB
.
executeAction
(
"CLICK"
,
tuple
())
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/spinfield.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -12,6 +12,8 @@ from uitest_helper import get_state_as_dict
import
time
from
UITestCase
import
UITestCase
try
:
import
pyuno
import
uno
...
...
@@ -22,82 +24,72 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
up
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
ui_test
=
UITest
(
xUITest
,
xContext
)
ui_test
.
create_doc_in_start_center
(
"calc"
)
class
SpinFieldTest
(
UITestCase
):
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
def
test_up
(
self
):
# select the numbers tab page
xCellsDlg
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"0"
}))
xDecimalPlaces
=
xCellsDlg
.
getChild
(
"leadzerosed"
)
xDecimalPlaces
.
executeAction
(
"UP"
,
tuple
())
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"2"
)
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
(
)
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
# select the numbers tab page
xCellsDlg
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"0"
}))
xDecimalPlaces
=
xCellsDlg
.
getChild
(
"leadzerosed"
)
xDecimalPlaces
.
executeAction
(
"UP"
,
tuple
())
ui_test
.
close_doc
()
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"2"
)
def
down
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
=
UITest
(
xUITest
,
xContext
)
self
.
ui_test
.
close_doc
(
)
ui_test
.
create_doc_in_start_center
(
"calc"
)
def
test_down
(
self
):
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
# select the numbers tab page
xCellsDlg
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"0"
}))
xDecimalPlaces
=
xCellsDlg
.
getChild
(
"leadzerosed"
)
xDecimalPlaces
.
executeAction
(
"UP"
,
tuple
())
xDecimalPlaces
.
executeAction
(
"UP"
,
tuple
())
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"3"
)
xDecimalPlaces
.
executeAction
(
"DOWN"
,
tuple
())
# select the numbers tab page
xCellsDlg
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"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"
]
==
"2"
)
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"3"
)
xDecimalPlaces
.
executeAction
(
"DOWN"
,
tuple
())
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
()
)
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"2"
)
ui_test
.
close_doc
()
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
def
text
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
self
.
ui_test
.
close_doc
()
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_text
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
xDecimalPlaces
=
xCellsDlg
.
getChild
(
"leadzerosed"
)
xDecimalPlaces
.
executeAction
(
"TYPE"
,
mkPropertyValues
({
"TEXT"
:
"4"
}))
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xDecimalPlaces
=
xCellsDlg
.
getChild
(
"leadzerosed"
)
xDecimalPlaces
.
executeAction
(
"TYPE"
,
mkPropertyValues
({
"TEXT"
:
"4"
}))
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"41"
)
decimal_places_state
=
get_state_as_dict
(
xDecimalPlaces
)
assert
(
decimal_places_state
[
"Text"
]
==
"41"
)
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
okBtn
=
xCellsDlg
.
getChild
(
"ok"
)
okBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/tabcontrol.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -13,6 +13,8 @@ from helper import mkPropertyValues
from
uihelper.calc
import
enter_text_to_cell
from
UITestCase
import
UITestCase
try
:
import
pyuno
import
uno
...
...
@@ -23,32 +25,30 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
select_pos
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
class
TabControlTest
(
UITestCase
):
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_select_pos
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
xCalcDoc
=
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
enter_text_to_cell
(
xGridWindow
,
"B2"
,
"=2+3+4"
)
xGridWindow
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"CELL"
:
"B2"
}))
xCalcDoc
=
self
.
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
enter_text_to_cell
(
xGridWindow
,
"B2"
,
"=2+3+4"
)
xGridWindow
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"CELL"
:
"B2"
}))
ui_test
.
execute_modeless_dialog_through_command
(
".uno:FunctionDialog"
)
self
.
ui_test
.
execute_modeless_dialog_through_command
(
".uno:FunctionDialog"
)
xFunctionDlg
=
xUITest
.
getTopFocusWindow
()
xFunctionDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xTabs
=
xFunctionDlg
.
getChild
(
"tabs"
)
xTabs
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"1"
}))
xTabs
=
xFunctionDlg
.
getChild
(
"tabs"
)
xTabs
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"1"
}))
time
.
sleep
(
1
)
time
.
sleep
(
1
)
xCancelBtn
=
xFunctionDlg
.
getChild
(
"cancel"
)
xCancelBtn
.
executeAction
(
"CLICK"
,
tuple
())
xCancelBtn
=
xFunctionDlg
.
getChild
(
"cancel"
)
xCancelBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/tabdialog.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -11,44 +11,40 @@ from helper import mkPropertyValues
import
time
def
select_tab_page_pos
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
from
UITestCase
import
UITestCase
ui_test
=
UITest
(
xUITest
,
xContext
)
class
TabDialogTest
(
UITestCase
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
def
test_select_tab_page_pos
(
self
):
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
props
=
{
"POS"
:
"1"
}
propsUNO
=
mkPropertyValues
(
props
)
xCellsDlg
.
executeAction
(
"SELECT"
,
propsUNO
)
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
props
=
{
"POS"
:
"1"
}
propsUNO
=
mkPropertyValues
(
props
)
xCellsDlg
.
executeAction
(
"SELECT"
,
propsUNO
)
ui_test
.
close_doc
()
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
def
select_tab_page_name
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
self
.
ui_test
.
close_doc
()
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_select_tab_page_name
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
xUITest
.
getTopFocusWindow
()
self
.
ui_test
.
execute_dialog_through_command
(
".uno:FormatCellDialog"
)
xCellsDlg
=
self
.
xUITest
.
getTopFocusWindow
()
props
=
{
"NAME"
:
"Borders"
}
propsUNO
=
mkPropertyValues
(
props
)
xCellsDlg
.
executeAction
(
"SELECT"
,
propsUNO
)
props
=
{
"NAME"
:
"Borders"
}
propsUNO
=
mkPropertyValues
(
props
)
xCellsDlg
.
executeAction
(
"SELECT"
,
propsUNO
)
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
xOkBtn
=
xCellsDlg
.
getChild
(
"ok"
)
xOkBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
uitest/demo_ui/treelist.py
Dosyayı görüntüle @
19e380cf
...
...
@@ -14,6 +14,8 @@ from uihelper.calc import enter_text_to_cell
from
uitest_helper
import
get_state_as_dict
from
UITestCase
import
UITestCase
try
:
import
pyuno
import
uno
...
...
@@ -24,41 +26,39 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
expand
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
class
TreeListTest
(
UITestCase
):
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_expand
(
self
):
ui_test
.
create_doc_in_start_center
(
"calc"
)
self
.
ui_test
.
create_doc_in_start_center
(
"calc"
)
xCalcDoc
=
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
enter_text_to_cell
(
xGridWindow
,
"B2"
,
"=2+3+4"
)
xGridWindow
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"CELL"
:
"B2"
}))
xCalcDoc
=
self
.
xUITest
.
getTopFocusWindow
()
xGridWindow
=
xCalcDoc
.
getChild
(
"grid_window"
)
enter_text_to_cell
(
xGridWindow
,
"B2"
,
"=2+3+4"
)
xGridWindow
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"CELL"
:
"B2"
}))
ui_test
.
execute_modeless_dialog_through_command
(
".uno:FunctionDialog"
)
self
.
ui_test
.
execute_modeless_dialog_through_command
(
".uno:FunctionDialog"
)
xFunctionDlg
=
xUITest
.
getTopFocusWindow
()
xFunctionDlg
=
self
.
xUITest
.
getTopFocusWindow
()
xTabs
=
xFunctionDlg
.
getChild
(
"tabs"
)
xTabs
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"1"
}))
xTabs
=
xFunctionDlg
.
getChild
(
"tabs"
)
xTabs
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"POS"
:
"1"
}))
xTreelist
=
xTabs
.
getChild
(
"struct"
)
xTreelist
=
xTabs
.
getChild
(
"struct"
)
xTreeEntry
=
xTreelist
.
getChild
(
'0'
)
xTreeEntry
=
xTreelist
.
getChild
(
'0'
)
xTreeEntry
.
executeAction
(
"COLLAPSE"
,
tuple
())
xTreeEntry
.
executeAction
(
"COLLAPSE"
,
tuple
())
time
.
sleep
(
1
)
time
.
sleep
(
1
)
xTreeEntry
.
executeAction
(
"EXPAND"
,
tuple
())
xTreeEntry
.
executeAction
(
"EXPAND"
,
tuple
())
time
.
sleep
(
1
)
time
.
sleep
(
1
)
xCancelBtn
=
xFunctionDlg
.
getChild
(
"cancel"
)
xCancelBtn
.
executeAction
(
"CLICK"
,
tuple
())
xCancelBtn
=
xFunctionDlg
.
getChild
(
"cancel"
)
xCancelBtn
.
executeAction
(
"CLICK"
,
tuple
())
ui_test
.
close_doc
()
self
.
ui_test
.
close_doc
()
# vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment