Commit 343ab8d7 authored by Gabriel L. Oliveira's avatar Gabriel L. Oliveira

Include method to facilitate the creation of new documents

parent a002233e
......@@ -86,6 +86,24 @@ class UNGTestMixin(unittest.TestCase):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
def create_document(self, portal_type, name=None, keywords=None):
"""create web documents, given a portal_type, optionally changing
properties:
name = name of the document
keywords = keyword_list of the document
"""
self.selenium.open("ERP5Site_createNewWebDocument?template=web_%s_template" % portal_type)
self.selenium.wait_for_page_to_load("30000")
self.selenium.click("//a[@name=\"document_title\"]")
if name:
self.selenium.type("//input[@id=\"name\"]", name)
if keywords:
self.selenium.type("//textarea[@id=\"keyword_list\"]", keywords)
self.selenium.click("//div[@class=\"ui-dialog-buttonset\"]/button[1]")
self.selenium.wait_for_page_to_load("30000")
self.wait_for_activities()
return self.selenium.get_eval('selenium.browserbot.getCurrentWindow().location').split('?')[0]
if __name__ == "__main__":
unittest.main()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment