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
fb821500
Kaydet (Commit)
fb821500
authored
Haz 22, 2016
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
uitest: convert the impress test to the new python unittest framework
Change-Id: I7a5cf03daac1b0426672a9d6611aa4cab4aaf91c
üst
19e380cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
63 deletions
+46
-63
impress_demo.txt
uitest/impress_tests/impress_demo.txt
+0
-4
start.py
uitest/impress_tests/start.py
+46
-59
No files found.
uitest/impress_tests/impress_demo.txt
deleted
100644 → 0
Dosyayı görüntüle @
19e380cf
impress_tests.start.start_impress
impress_tests.start.select_page
impress_tests.start.select_text
impress_tests.start.select_object
uitest/impress_tests/start.py
Dosyayı görüntüle @
fb821500
...
...
@@ -9,6 +9,8 @@ from uitest_helper import UITest, get_state_as_dict
from
helper
import
mkPropertyValues
from
UITestCase
import
UITestCase
import
time
try
:
...
...
@@ -21,94 +23,79 @@ except ImportError:
print
(
"URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc"
)
raise
def
start_impress
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
ui_test
=
UITest
(
xUITest
,
xContext
)
ui_test
.
create_doc_in_start_center
(
"impress"
)
xImpressDoc
=
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
xEditWin
.
executeAction
(
"SET"
,
mkPropertyValues
({
"ZOOM"
:
"200"
}))
class
SimpleImpressTest
(
UITestCase
):
def
test_start_impress
(
self
):
print
(
xEditWin
.
getChildren
()
)
self
.
ui_test
.
create_doc_in_start_center
(
"impress"
)
time
.
sleep
(
1
)
xImpressDoc
=
self
.
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
ui_test
.
close_doc
()
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
xEditWin
.
executeAction
(
"SET"
,
mkPropertyValues
({
"ZOOM"
:
"200"
}))
def
select_page
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
print
(
xEditWin
.
getChildren
())
ui_test
=
UITest
(
xUITest
,
xContext
)
time
.
sleep
(
1
)
ui_test
.
create_doc_in_start_center
(
"impress"
)
self
.
ui_test
.
close_doc
(
)
xImpressDoc
=
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
def
test_select_page
(
self
):
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win
"
)
self
.
ui_test
.
create_doc_in_start_center
(
"impress
"
)
time
.
sleep
(
1
)
print
(
get_state_as_dict
(
xEditWin
))
xImpressDoc
=
self
.
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
xEditWin
.
executeAction
(
"GOTO"
,
mkPropertyValues
({
"PAGE"
:
"2"
})
)
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
print
(
get_state_as_dict
(
xEditWin
))
print
(
get_state_as_dict
(
xEditWin
))
xEditWin
.
executeAction
(
"GOTO"
,
mkPropertyValues
({
"PAGE"
:
"2"
}
))
ui_test
.
close_doc
(
)
time
.
sleep
(
1
)
def
select_text
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
print
(
get_state_as_dict
(
xEditWin
))
ui_test
=
UITest
(
xUITest
,
xContext
)
self
.
ui_test
.
close_doc
(
)
ui_test
.
create_doc_in_start_center
(
"impress"
)
def
test_select_text
(
self
):
xImpressDoc
=
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
self
.
ui_test
.
create_doc_in_start_center
(
"impress"
)
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
xImpressDoc
=
self
.
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
time
.
sleep
(
1
)
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
print
(
get_state_as_dict
(
xEditWin
)
)
time
.
sleep
(
1
)
ui_test
.
close_doc
(
)
print
(
get_state_as_dict
(
xEditWin
)
)
def
select_object
(
xContext
):
xUITest
=
xContext
.
ServiceManager
.
createInstanceWithContext
(
"org.libreoffice.uitest.UITest"
,
xContext
)
self
.
ui_test
.
close_doc
()
ui_test
=
UITest
(
xUITest
,
xContext
)
def
test_select_object
(
self
):
ui_test
.
create_doc_in_start_center
(
"impress"
)
self
.
ui_test
.
create_doc_in_start_center
(
"impress"
)
xImpressDoc
=
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
xImpressDoc
=
self
.
xUITest
.
getTopFocusWindow
()
print
(
get_state_as_dict
(
xImpressDoc
))
print
(
xImpressDoc
.
getChildren
())
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
xEditWin
=
xImpressDoc
.
getChild
(
"impress_win"
)
xEditWin
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"OBJECT"
:
"Unnamed Drawinglayer object 1"
}))
time
.
sleep
(
1
)
xEditWin
.
executeAction
(
"DESELECT"
,
tuple
())
xEditWin
.
executeAction
(
"SELECT"
,
mkPropertyValues
({
"OBJECT"
:
"Unnamed Drawinglayer object 1"
}))
time
.
sleep
(
1
)
xEditWin
.
executeAction
(
"DESELECT"
,
tuple
())
time
.
sleep
(
1
)
time
.
sleep
(
1
)
print
(
get_state_as_dict
(
xEditWin
))
print
(
get_state_as_dict
(
xEditWin
))
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