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
dd01a8a0
Commit
dd01a8a0
authored
Aug 02, 2011
by
Gabriel L. Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and refactor test to change title
parent
6b886aa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
433 additions
and
259 deletions
+433
-259
testUNGDocs.py
testUNGDocs.py
+433
-259
No files found.
testUNGDocs.py
View file @
dd01a8a0
...
@@ -219,420 +219,594 @@ class TestUNGDocs(UNGTestMixin):
...
@@ -219,420 +219,594 @@ class TestUNGDocs(UNGTestMixin):
for Web Illustration, Web Table and Web Page documents"""
for Web Illustration, Web Table and Web Page documents"""
#New Web Illustration
#New Web Illustration
self
.
selenium
.
open
(
"ERP5Site_createNewWebDocument?template=web_illustration_template"
)
self
.
create_document
(
'illustration'
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Draft"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_state
\
"
]"
))
self
.
assertEqual
(
"Draft"
,
self
.
selenium
.
get_text
(
#First just see properties
"//a[@name=
\
"
document_state
\
"
]"
))
#First just check properties
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
"//input[@id='name']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
#Than check and fill properties, without saving
#Than check and fill properties, without saving
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Illustration"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Illustration"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Illustration"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Illustration"
)
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"0"
)
self
.
selenium
.
type
(
"sort_index"
,
"0"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
#Than check and fill properties, saving
#Than check and fill properties, saving
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Illustration"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Illustration"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Illustration"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Illustration"
)
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"1"
)
self
.
selenium
.
type
(
"sort_index"
,
"1"
)
#XXX this is maybe a bug, because keyword_list is recorded even without saving
self
.
assertEqual
(
""
,
#self.assertEqual("", self.selenium.get_value("//textarea[@id='keyword_list']"))
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/"
"span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
refresh
()
self
.
selenium
.
refresh
()
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
#Finally, verify
#Finally, verify
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Illustration"
,
self
.
assertEqual
(
"Functional UNG Test - Web Illustration"
,
self
.
selenium
.
get_text
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
get_text
(
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
"//tr[@class='listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Web Illustration"
,
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
open
(
""
)
"//input[@id='language']"
))
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Web Illustration
\
"
"
)
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
open_ung_default_page
(
'ung'
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Web Illustration
\
"
"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_ung_listbox_to_load
(
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
#Change to other
#Change to other
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Illu..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_text
(
"//input[@id='name']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_text
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Renamed Web Illustration"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Renamed Web "
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
"Illustration"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Web Illustration"
,
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Renamed Web Illustration"
)
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Renamed Web "
"Illustration"
)
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"003"
)
self
.
selenium
.
type
(
"version"
,
"003"
)
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"en"
)
self
.
selenium
.
type
(
"language"
,
"en"
)
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"2"
)
self
.
selenium
.
type
(
"sort_index"
,
"2"
)
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
)
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test Renamed
\
n
"
"UNG Test Renamed"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/"
"span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
refresh
()
self
.
selenium
.
refresh
()
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
#Verify changes
#Verify changes
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Illustration"
,
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Illustration"
,
self
.
selenium
.
get_text
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
get_text
(
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
"//tr[@class='listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Renamed Web Illustration"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Renamed Web Illustration"
,
self
.
assertEqual
(
"003"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"003"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"2"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
open
(
""
)
"//input[@id='language']"
))
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"2"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Renamed Web Illustration
\
"
"
)
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Renamed Web Illustration
\
"
"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_ung_listbox_to_load
(
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
#New Web Table
#New Web Table
self
.
selenium
.
open
(
"ERP5Site_createNewWebDocument?template=web_table_template"
)
self
.
create_document
(
'table'
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Draft"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_state
\
"
]"
))
self
.
assertEqual
(
"Draft"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_state
\
"
]"
))
#First just see properties
#First just see properties
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
"//input[@id='name']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
#Than check and fill properties, without saving
#Than check and fill properties, without saving
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Table"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Table"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Table"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Table"
)
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"0"
)
self
.
selenium
.
type
(
"sort_index"
,
"0"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
#Than check and fill properties, saving
#Than check and fill properties, saving
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Table"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Table"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Table"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Table"
)
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"1"
)
self
.
selenium
.
type
(
"sort_index"
,
"1"
)
#XXX this is maybe a bug, because keyword_list is recorded even without saving
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
#self.assertEqual("", self.selenium.get_value("//textarea[@id='keyword_list']"))
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/"
"span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
refresh
()
self
.
selenium
.
refresh
()
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name='document_title']"
))
#Finally, verify
#Finally, verify
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Table"
,
self
.
assertEqual
(
"Functional UNG Test - Web Table"
,
self
.
selenium
.
get_text
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
get_text
(
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
"//tr[@class='listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
open
(
""
)
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Web Table
\
"
"
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Web Table
\
"
"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_ung_listbox_to_load
(
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
#Change to other
#Change to other
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Tabl..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_text
(
"//input[@id='name']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_text
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Renamed Web Table"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Renamed Web Table"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Renamed Web Table"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Renamed Web Table"
)
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"003"
)
self
.
selenium
.
type
(
"version"
,
"003"
)
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"en"
)
self
.
selenium
.
type
(
"language"
,
"en"
)
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"2"
)
self
.
selenium
.
type
(
"sort_index"
,
"2"
)
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
)
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/"
"span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
refresh
()
self
.
selenium
.
refresh
()
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
#Verify changes
#Verify changes
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Table"
,
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Table"
,
self
.
selenium
.
get_text
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
get_text
(
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
"//tr[@class='listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Renamed Web Table"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Renamed Web Table"
,
self
.
assertEqual
(
"003"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"003"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"2"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
open
(
""
)
"//input[@id='language']"
))
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"2"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Renamed Web Table
\
"
"
)
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Renamed Web Table
\
"
"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_ung_listbox_to_load
(
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
#New Web Page
#New Web Page
self
.
selenium
.
open
(
"ERP5Site_createNewWebDocument?template=web_page_template"
)
self
.
create_document
(
'page'
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Web Page"
,
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Draft"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_state
\
"
]"
))
self
.
assertEqual
(
"Draft"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_state
\
"
]"
))
#First just see properties
#First just see properties
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
"//input[@id='name']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
#Than check and fill properties, without saving
#Than check and fill properties, without saving
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Page"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Page"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Page"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Page"
)
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"0"
)
self
.
selenium
.
type
(
"sort_index"
,
"0"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
self
.
selenium
.
click
(
"//span[@class=
\
"
ui-icon ui-icon-closethick
\
"
]"
)
#Than check and fill properties, saving
#Than check and fill properties, saving
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Page"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Web Page"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Page"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Web Page"
)
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"001"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
selenium
.
type
(
"version"
,
"002"
)
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
selenium
.
type
(
"language"
,
"fr"
)
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"1"
)
self
.
selenium
.
type
(
"sort_index"
,
"1"
)
#XXX this is maybe a bug, because keyword_list is recorded even without saving
self
.
assertEqual
(
""
,
self
.
selenium
.
get_value
(
#self.assertEqual("", self.selenium.get_value("//textarea[@id='keyword_list']"))
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test
\
n
UNG Test"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/"
"span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
refresh
()
self
.
selenium
.
refresh
()
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
#Finally, verify
#Finally, verify
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
get_text
(
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
"//tr[@class='listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Web Page"
,
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
"//input[@id='version']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
open
(
""
)
"//input[@id='language']"
))
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Web Page
\
"
"
)
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Web Page
\
"
"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_ung_listbox_to_load
(
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
#Change to other
#Change to other
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Web Page"
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_text
(
"//input[@id='name']"
))
self
.
assertEqual
(
""
,
self
.
selenium
.
get_text
(
"//input[@id='name']"
))
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Renamed Web Page"
)
self
.
selenium
.
type
(
"name"
,
"Functional UNG Test - Renamed Web Page"
)
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Renamed Web Page"
)
self
.
selenium
.
type
(
"short_title"
,
"Func. UNG Test - Renamed Web Page"
)
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"002"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
selenium
.
type
(
"version"
,
"003"
)
self
.
selenium
.
type
(
"version"
,
"003"
)
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"fr"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
selenium
.
type
(
"language"
,
"en"
)
self
.
selenium
.
type
(
"language"
,
"en"
)
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"1"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
selenium
.
type
(
"sort_index"
,
"2"
)
self
.
selenium
.
type
(
"sort_index"
,
"2"
)
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test
\
n
UNG Test"
,
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
)
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
type
(
"keyword_list"
,
"Functional UNG Test Renamed
\
n
"
"UNG Test Renamed"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
click
(
"//div[@class=
\
"
ui-dialog-buttonset
\
"
]/button[1]/span"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_for_activities
()
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
refresh
()
self
.
selenium
.
refresh
()
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
#Verify changes
#Verify changes
self
.
selenium
.
open
(
""
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Page"
,
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Page"
,
self
.
selenium
.
get_text
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
get_text
(
self
.
selenium
.
click
(
"//tr[@class='your_listbox-data-line-0 DataA']/td[3]/a"
)
"//tr[@class='listbox-data-line-0 DataA']/td[3]"
))
self
.
selenium
.
click
(
"//tr[@class='listbox-data-line-0 DataA']/td[3]/a"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed ..."
,
self
.
selenium
.
get_text
(
"//a[@name=
\
"
document_title
\
"
]"
))
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
selenium
.
click
(
"//a[@name=
\
"
document_title
\
"
]"
)
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Rename Document"
,
self
.
selenium
.
get_text
(
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
"//span[@id=
\
"
ui-dialog-title-edit_document
\
"
]"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
assertEqual
(
"Functional UNG Test - Renamed Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='name']"
))
self
.
assertEqual
(
"Edit More Properties"
,
self
.
selenium
.
get_text
(
"//p[@id=
\
"
more_properties
\
"
]"
))
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
selenium
.
click
(
"//p[@id=
\
"
more_properties
\
"
]"
)
self
.
assertEqual
(
"Func. UNG Test - Renamed Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"Func. UNG Test - Renamed Web Page"
,
self
.
selenium
.
get_value
(
"//input[@id='short_title']"
))
self
.
assertEqual
(
"003"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"003"
,
self
.
selenium
.
get_value
(
"//input[@id='version']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"en"
,
self
.
selenium
.
get_value
(
"//input[@id='language']"
))
self
.
assertEqual
(
"2"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"2"
,
self
.
selenium
.
get_value
(
"//input[@id='sort_index']"
))
self
.
assertEqual
(
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
,
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
assertEqual
(
"Functional UNG Test Renamed
\
n
UNG Test Renamed"
,
self
.
selenium
.
open
(
""
)
self
.
selenium
.
get_value
(
"//textarea[@id='keyword_list']"
))
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
open_ung_default_page
(
'ung'
,
wait_for_activities
=
1
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Renamed Web Page
\
"
"
)
self
.
selenium
.
type
(
"//input[@name=
\
"
field_your_search_text
\
"
]"
,
"
\
"
Functional UNG Test - Renamed Web Page
\
"
"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
click
(
"//input[@value=
\
"
Search Docs
\
"
]"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
wait_ung_listbox_to_load
(
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No result."
))
def
test_subject_list
(
self
):
def
test_subject_list
(
self
):
...
...
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