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
735912c3
Commit
735912c3
authored
May 23, 2011
by
Gabriel L. Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test add a new event, of all types available at UNG Calendar
parent
d719561c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
325 additions
and
0 deletions
+325
-0
testUNGCalendar.py
testUNGCalendar.py
+325
-0
No files found.
testUNGCalendar.py
View file @
735912c3
...
@@ -81,6 +81,331 @@ class TestUNGCalendar(UNGTestMixin):
...
@@ -81,6 +81,331 @@ class TestUNGCalendar(UNGTestMixin):
self
.
selenium
.
key_press
(
"//input[@name='searchable-text']"
,
"
\
\
13"
)
self
.
selenium
.
key_press
(
"//input[@name='searchable-text']"
,
"
\
\
13"
)
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
def
test_add_new_acknowledgement_event
(
self
):
"""check the action of add a new event of type 'Acknowledgement'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Acknowledgement'
event_name
=
'Functional UNG Test %d - My Acknowledgement'
%
test_time
self
.
create_calendar_event
(
'Acknowledgement'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_fax_message_event
(
self
):
"""check the action of add a new event of type 'Fax Message'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Fax Message'
event_name
=
'Functional UNG Test %d - My Fax Message'
%
test_time
self
.
create_calendar_event
(
'Fax Message'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_letter_event
(
self
):
"""check the action of add a new event of type 'Letter'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Letter'
event_name
=
'Functional UNG Test %d - My Letter'
%
test_time
self
.
create_calendar_event
(
'Letter'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_mail_message_event
(
self
):
"""check the action of add a new event of type 'Mail Message'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Mail Message'
event_name
=
'Functional UNG Test %d - My Mail Message'
%
test_time
self
.
create_calendar_event
(
'Mail Message'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_note_event
(
self
):
"""check the action of add a new event of type 'Note'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Note'
event_name
=
'Functional UNG Test %d - My Note'
%
test_time
self
.
create_calendar_event
(
'Note'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_phone_call_event
(
self
):
"""check the action of add a new event of type 'Phone Call'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Phone Call'
event_name
=
'Functional UNG Test %d - My Phone Call'
%
test_time
self
.
create_calendar_event
(
'Phone Call'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_short_message_event
(
self
):
"""check the action of add a new event of type 'Short Message'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Short Message'
event_name
=
'Functional UNG Test %d - My Short Message'
%
test_time
self
.
create_calendar_event
(
'Short Message'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_site_message_event
(
self
):
"""check the action of add a new event of type 'Site Message'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Site Message'
event_name
=
'Functional UNG Test %d - My Site Message'
%
test_time
self
.
create_calendar_event
(
'Site Message'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_visit_event
(
self
):
"""check the action of add a new event of type 'Visit'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Visit'
event_name
=
'Functional UNG Test %d - My Visit'
%
test_time
self
.
create_calendar_event
(
'Visit'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
def
test_add_new_web_message_event
(
self
):
"""check the action of add a new event of type 'Web Message'"""
test_time
=
int
(
unittest
.
time
.
time
())
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#create event of type 'Web Message'
event_name
=
'Functional UNG Test %d - My Web Message'
%
test_time
self
.
create_calendar_event
(
'Web Message'
,
name
=
event_name
)
#assert event was created successfully
self
.
clear_cache
()
self
.
wait_for_activities
()
self
.
selenium
.
open
(
"calendar"
)
self
.
selenium
.
wait_for_page_to_load
(
"30000"
)
#XXX due to interface delay
#try 5 times to see new event under interface
for
_try
in
range
(
5
):
try
:
self
.
selenium
.
click
(
"//div/span[@title='Refresh view']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.browserbot.findElementOrNull('loadingpannel').style.display == 'none'"
,
"10000"
);
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
if
self
.
selenium
.
is_text_present
(
event_name
):
break
except
:
pass
self
.
failUnless
(
self
.
selenium
.
is_text_present
(
event_name
))
self
.
selenium
.
type
(
"//input[@name='searchable-text']"
,
'
\
"
'
+
event_name
+
'
\
"
'
)
self
.
selenium
.
click
(
"//input[@id='submit-search']"
)
self
.
selenium
.
wait_for_condition
(
"selenium.isElementPresent('//td[@id=
\
"
event-date
\
"
]')"
,
"4000"
)
self
.
failUnless
(
self
.
selenium
.
is_element_present
(
"//td[@id=
\
"
event-date
\
"
]"
))
self
.
failIf
(
self
.
selenium
.
is_text_present
(
"No Results"
))
self
.
assertEqual
(
event_name
,
self
.
selenium
.
get_text
(
"//div[@class='event-listview']/table/tbody/tr/td[3]"
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
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