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
9243b86b
Commit
9243b86b
authored
Aug 02, 2011
by
Gabriel L. Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and refactor test
- Make it wait for gadgets dialog to load - Make it clear environment at the end
parent
5b132566
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
testUNGGadgets.py
testUNGGadgets.py
+30
-12
No files found.
testUNGGadgets.py
View file @
9243b86b
...
@@ -12,35 +12,53 @@ class TestUNGGadgets(UNGTestMixin):
...
@@ -12,35 +12,53 @@ class TestUNGGadgets(UNGTestMixin):
- add gadget
- add gadget
- delete gadget
- delete gadget
"""
"""
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Please use link (Add gadgets) to prepare it yourself."
))
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Please use link "
self
.
assertEqual
(
"Add gadgets"
,
self
.
selenium
.
get_text
(
"//a[@id=
\
"
add-gadgets
\
"
]/span"
))
"(Add gadgets) to prepare it yourself."
))
self
.
assertEqual
(
"Add gadgets"
,
self
.
selenium
.
get_text
(
"//a[@id=
\
"
add-gadgets
\
"
]/span"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"Join ERP5 Network !"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"Join ERP5 Network !"
))
self
.
failIf
(
self
.
selenium
.
is_element_present
(
"//a[@class=
\
"
clickable-block block-remove
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_element_present
(
"//a[@class="
"'clickable-block block-remove']"
))
self
.
selenium
.
click
(
"//a[@id=
\
"
add-gadgets
\
"
]"
)
self
.
selenium
.
click
(
"//a[@id=
\
"
add-gadgets
\
"
]"
)
self
.
wait_add_gadgets_dialog_to_load
()
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Add Gadget"
))
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Add Gadget"
))
self
.
selenium
.
click
(
"//input[@id=
\
"
erp5_documentation
\
"
]"
)
self
.
selenium
.
click
(
"//input[@id=
\
"
erp5_documentation
\
"
]"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Join ERP5 Network !"
))
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Join ERP5 Network !"
))
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//a[@class=
\
"
clickable-block block-remove
\
"
]"
))
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//a[@class="
self
.
failIf
(
self
.
selenium
.
is_element_present
(
"//div[@id=
\
"
page_wrapper
\
"
]/div[1]/h4"
))
"'clickable-block block-remove']"
))
self
.
selenium
.
click
(
"//a[@class=
\
"
clickable-block block-remove
\
"
]"
)
self
.
failIf
(
self
.
selenium
.
is_element_present
(
"//div[@id="
self
.
failUnless
(
re
.
search
(
r"^Are you sure you want to remove this gadget from your personalized page[\
s
\S]$"
,
self
.
selenium
.
get_confirmation
()))
"
\
"
page_wrapper
\
"
]/div[1]/h4"
))
self
.
selenium
.
click
(
"//a[@class='clickable-block block-remove']"
)
self
.
failUnless
(
re
.
search
(
r"^Are you sure you want to remove this "
"gadget from your personalized page[
\
s
\
S]$"
,
self
.
selenium
.
get_confirmation
()))
self
.
wait_for_activities
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
""
)
self
.
selenium
.
open
(
""
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Add gadgets"
,
self
.
selenium
.
get_text
(
"//a[@id=
\
"
add-gadgets
\
"
]/span"
))
self
.
assertEqual
(
"Add gadgets"
,
self
.
selenium
.
get_text
(
"//a[@id=
\
"
add-gadgets
\
"
]/span"
))
self
.
selenium
.
click
(
"//a[@id=
\
"
add-gadgets
\
"
]"
)
self
.
selenium
.
click
(
"//a[@id=
\
"
add-gadgets
\
"
]"
)
self
.
wait_add_gadgets_dialog_to_load
()
self
.
selenium
.
click
(
"//input[@id=
\
"
erp5_rss
\
"
]"
)
self
.
selenium
.
click
(
"//input[@id=
\
"
erp5_rss
\
"
]"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Feed Reader"
,
self
.
selenium
.
get_text
(
"//span[@class=
\
"
gadget_title
\
"
]"
))
self
.
assertEqual
(
"Feed Reader"
,
self
.
selenium
.
get_text
(
"//span[@class"
self
.
selenium
.
click
(
"//a[@class=
\
"
clickable-block block-remove
\
"
]"
)
"=
\
"
gadget_title
\
"
]"
))
self
.
failUnless
(
re
.
search
(
r"^Are you sure you want to remove this gadget from your personalized page[\
s
\S]$"
,
self
.
selenium
.
get_confirmation
()))
self
.
selenium
.
click
(
"//a[@class='clickable-block block-remove']"
)
self
.
failUnless
(
re
.
search
(
r"^Are you sure you want to remove this "
"gadget from your personalized page[
\
s
\
S]$"
,
self
.
selenium
.
get_confirmation
()))
self
.
wait_for_activities
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
""
)
self
.
selenium
.
open
(
""
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
failIf
(
self
.
selenium
.
is_element_present
(
"//a[@class=
\
"
clickable-block block-remove
\
"
]"
))
# ung listbox, now a gadget, have this element until it's fully
# loaded, and then its removed from listbox
self
.
wait_ung_listbox_to_load
()
self
.
failIf
(
self
.
selenium
.
is_element_present
(
"//a[@class="
"'clickable-block block-remove']"
))
self
.
clear_user_gadgets
()
def
test_add_two_gadgets
(
self
):
def
test_add_two_gadgets
(
self
):
"""test that its possible to add more than just 1 gadget"""
"""test that its possible to add more than just 1 gadget"""
...
...
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