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
af7f08b2
Commit
af7f08b2
authored
Aug 02, 2011
by
Gabriel L. Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and refactor test to follow guidelines
parent
3995faa6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
19 deletions
+45
-19
testUNGSettings.py
testUNGSettings.py
+45
-19
No files found.
testUNGSettings.py
View file @
af7f08b2
...
...
@@ -12,7 +12,9 @@ class TestUNGSettings(UNGTestMixin):
"""
self
.
failIf
(
self
.
selenium
.
is_text_present
(
'Text Format'
))
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"Text Format"
))
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
"FCK Editor"
))
self
.
selenium
.
check
(
"//input[@value=
\
'
fck_editor
\
'
]"
)
...
...
@@ -20,19 +22,29 @@ class TestUNGSettings(UNGTestMixin):
self
.
selenium
.
click
(
"//html/body/div[3]/div[11]/div/button[1]"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
fck_editor
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/html
\
'
]@checked"
))
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
fck_editor
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/html
\
'
]@checked"
))
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
selenium
.
check
(
"//input[@value=
\
'
text_area
\
'
]"
)
self
.
selenium
.
check
(
"//input[@value=
\
'
text/plain
\
'
]"
)
self
.
selenium
.
click
(
"//html/body/div[3]/div[11]/div/button[1]"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/plain
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text_area
\
'
]@checked"
))
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/plain
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text_area
\
'
]@checked"
))
self
.
selenium
.
click
(
"//span[@class=
\
'
ui-icon ui-icon-closethick
\
'
]"
)
self
.
selenium
.
open
(
"WebSite_logout"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
...
...
@@ -51,36 +63,50 @@ class TestUNGSettings(UNGTestMixin):
# self.selenium.wait_for_page_to_load(30000)
self
.
selenium
.
type
(
"__ac_name"
,
"ung_user2"
)
self
.
selenium
.
type
(
"__ac_password"
,
"1234"
)
self
.
selenium
.
click
(
"//input[@
type='submit
']"
)
self
.
selenium
.
click
(
"//input[@
value='Login
']"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
selenium
.
check
(
"//input[@value=
\
'
fck_editor
\
'
]"
)
self
.
selenium
.
check
(
"//input[@value=
\
'
text/html
\
'
]"
)
self
.
selenium
.
click
(
"//html/body/div[3]/div[11]/div/button[1]"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
selenium
.
check
(
"//input[@value=
\
'
fck_editor
\
'
]"
)
self
.
selenium
.
check
(
"//input[@value=
\
'
text/html
\
'
]"
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
selenium
.
click
(
"//html/body/div[3]/div[11]/div/button[1]"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
fck_editor
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/html
\
'
]@checked"
))
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
fck_editor
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/html
\
'
]@checked"
))
self
.
selenium
.
open
(
"WebSite_logout"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
type
(
"__ac_name"
,
"test_user"
)
self
.
selenium
.
type
(
"__ac_password"
,
"test_user"
)
self
.
selenium
.
click
(
"//input[@
type='submit
']"
)
self
.
selenium
.
click
(
"//input[@
value='Login
']"
)
self
.
selenium
.
wait_for_page_to_load
(
5000
)
self
.
selenium
.
click
(
"//a[@id='settings']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"3000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text_area
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/plain
\
'
]@checked"
))
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent(
\
"
//input"
"[@name=
\
'
field_my_preferred_text_editor
\
'
]
\
"
)"
,
"30000"
)
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text_area
\
'
]@checked"
))
self
.
assertEqual
(
u'true'
,
self
.
selenium
.
get_attribute
(
"//input[@value=
\
'
text/plain
\
'
]@checked"
))
if
__name__
==
"__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