Example #1
0
 def access_files(self):
     """
     Access the upload view by clicking on the upload link.
     """
     interpreter.click(
         "//div[@id='archetypes-fieldname-files']//a[@id='plone-article-upload-link']"
     )
     interpreter.wait_for_condition(
         "selenium.isElementPresent('new_file_btn_ok');", 10000)
 def save(self, attach, postcondition="success"):        
     """
     Save the attachment.
     
     Postcondition can be "success" or "error"
     """
     interpreter.click("new_file_btn_ok")
     if postcondition=="success":
         interpreter.wait_for_condition("selenium.isElementPresent('upload-status-success');",10000)    
     elif postcondition=="error":
         interpreter.wait_for_condition("selenium.isElementPresent('upload-status-error');",10000)
         # In case of an error, the title and description should not be lost
         interpreter.failUnless(interpreter.get_value("//input[@id='new_file_title']")==attach['new_file_title'])            
         interpreter.failUnless(interpreter.get_value("//input[@id='new_file_description']")==attach['new_file_description'])            
Example #3
0
 def save(self, attach, postcondition="success"):
     """
     Save the attachment.
     
     Postcondition can be "success" or "error"
     """
     interpreter.click("new_file_btn_ok")
     if postcondition == "success":
         interpreter.wait_for_condition(
             "selenium.isElementPresent('upload-status-success');", 10000)
     elif postcondition == "error":
         interpreter.wait_for_condition(
             "selenium.isElementPresent('upload-status-error');", 10000)
         # In case of an error, the title and description should not be lost
         interpreter.failUnless(
             interpreter.get_value("//input[@id='new_file_title']") ==
             attach['new_file_title'])
         interpreter.failUnless(
             interpreter.get_value("//input[@id='new_file_description']") ==
             attach['new_file_description'])
 def access_files(self):
     """
     Access the upload view by clicking on the upload link.
     """
     interpreter.click("//div[@id='archetypes-fieldname-files']//a[@id='plone-article-upload-link']")
     interpreter.wait_for_condition("selenium.isElementPresent('new_file_btn_ok');",10000)