Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
da3465de
Commit
da3465de
authored
Jun 07, 2011
by
Gabriel L. Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that UNG Docs paginate when many documents are present.
parent
d59bc608
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
32 deletions
+54
-32
testUNGDocs.py
testUNGDocs.py
+54
-0
testUNGDocsPagination.py
testUNGDocsPagination.py
+0
-32
No files found.
testUNGDocs.py
View file @
da3465de
...
...
@@ -971,6 +971,60 @@ class TestUNGDocs(UNGTestMixin):
self
.
failIf
(
self
.
selenium
.
is_checked
(
"//tr[@class='your_listbox-data-line-1 DataB']/td[1]/input"
))
self
.
failIf
(
self
.
selenium
.
is_checked
(
"//tr[@class='your_listbox-data-line-2 DataA']/td[1]/input"
))
def
test_pagination_with_many_documents
(
self
):
"""UNG Docs should paginate when many documents are present.
Test that the action of paginate will work, given that many documents
are present."""
#XXX this test needs an empty instance
test_time
=
int
(
unittest
.
time
.
time
())
page_title
=
"Functional UNG Test %d - Web Page "
%
test_time
#add many documents to ensure that it has to paginate
for
doc_index
in
range
(
1
,
101
):
self
.
selenium
.
open
(
"ERP5Site_createNewWebDocument?template=web_page_template"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
type
(
"name"
,
page_title
+
str
(
doc_index
))
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
selenium
.
open
(
""
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#assert first and last (relative) documents on first page
self
.
assertEqual
(
'1'
,
self
.
selenium
.
get_value
(
"//input[@name='your_listbox_page_start']"
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'100'
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'84'
))
#assert first and last (relative) documents on third page
# (next button)
for
next_page
in
range
(
2
):
self
.
selenium
.
click
(
"//button[@name='nextPage']"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
'3'
,
self
.
selenium
.
get_value
(
"//input[@name='your_listbox_page_start']"
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'66'
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'50'
))
#assert first and last (relative) documents on second page
# (previous button)
self
.
selenium
.
click
(
"//button[@name='previousPage']"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
'2'
,
self
.
selenium
.
get_value
(
"//input[@name='your_listbox_page_start']"
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'83'
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'67'
))
#assert first and last (relative) documents on last page
# (last button)
last_page_number
=
self
.
selenium
.
get_text
(
"//div[@class='listbox-navigation']"
).
split
(
'/'
)[
1
].
strip
()
self
.
selenium
.
click
(
"//button[@name='lastPage']"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
last_page_number
,
self
.
selenium
.
get_value
(
"//input[@name='your_listbox_page_start']"
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'15'
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'1'
))
#assert first and last (relative) documents on first page
# (first button)
self
.
selenium
.
click
(
"//button[@name='firstPage']"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
'1'
,
self
.
selenium
.
get_value
(
"//input[@name='your_listbox_page_start']"
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'100'
))
self
.
assertTrue
(
self
.
selenium
.
is_text_present
(
page_title
+
'84'
))
if
__name__
==
"__main__"
:
unittest
.
main
()
...
...
testUNGDocsPagination.py
deleted
100644 → 0
View file @
d59bc608
from
UNGTestMixin
import
UNGTestMixin
import
unittest
class
TestUNGPagination
(
UNGTestMixin
):
"""tests related to pagination on UNG Docs default page """
def
test_pagination_with_20_documents
(
self
):
"""test that the action of paginate will work, given that 20 documents are added"""
test_time
=
int
(
unittest
.
time
.
time
())
#add 20 documents to ensure that it has to paginate
for
doc_index
in
range
(
20
):
self
.
selenium
.
open
(
"ERP5Site_createNewWebDocument?template=web_page_template"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test %d - Web Page %d"
%
(
test_time
,
doc_index
))
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
selenium
.
open
(
""
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#TODO: assert first and last document on first page
# and then first and last (relative) created document on second page
#XXX pagination is not implemented yet
raise
NotImplementedError
if
__name__
==
"__main__"
:
unittest
.
main
()
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