Exemplo n.º 1
0
 def step_1(self):
     "Add a link to an article and save the article"
     interpreter.annotate(
         "Test: Add a link to the article and save the article")
     link = dataprovider.plonearticle.articlelink.get("Link 1")
     logical.plonearticle.article.add_link(link)
     logical.plonearticle.article.save_article(self.article)
 def step_1(self):
     "Add an image to an article and save the article"
     interpreter.annotate("Test: Add an image to the article and save the article")
     image = dataprovider.plonearticle.articleimage.get("Image 1")
     # Normal attachment upload
     logical.plonearticle.article.add_image(image)
     logical.plonearticle.article.save_article(self.article)
 def test_add_image(self):
     "Add an image to an article and save the article"
     interpreter.annotate(
         "Test: Add an image to the article and save the article")
     image = dataprovider.plonearticle.articleimage.get("Image 1")
     # Normal attachment upload
     logical.plonearticle.article.add_image(image)
     logical.plonearticle.article.save_article(self.article)
 def test_cancel_adding_an_image(self):
     "Cancel adding an image"
     interpreter.annotate("Test: Add an image to the article and cancel")
     image = dataprovider.plonearticle.articleimage.get("Image 1")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("images")
     physical.plonearticle.attachment_upload.access()
     physical.plonearticle.attachment_upload.fill(image)
     # Not saving here.
     physical.plonearticle.attachment_upload.cancel()
     logical.plonearticle.article.save_article(self.article)
 def test_cancel_adding_an_image(self):
     "Cancel adding an image"
     interpreter.annotate("Test: Add an image to the article and cancel")
     image = dataprovider.plonearticle.articleimage.get("Image 1")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("images")
     physical.plonearticle.attachment_upload.access()
     physical.plonearticle.attachment_upload.fill(image)
     # Not saving here.
     physical.plonearticle.attachment_upload.cancel()  
     logical.plonearticle.article.save_article(self.article)
 def existing_article_without_attachments(self, article):        
     interpreter.annotate("Setup article")
     self.existing_article(article)
     # Need to delete all images
     for attachment_type in ["images", "files", "links"]:
         physical.cmfplone.tab.access("edit")
         physical.cmfplone.schemata.access(attachment_type)
         i = 0
         while interpreter.is_element_present("//div[@id='%s-innercontent%06d']" % (attachment_type, i)):
             interpreter.click("//div[@id='%s-innercontent%06d']/div/a[@class='file_delete']" % (attachment_type, i))
             i+=1
             #os.system("pause")
         logical.cmfplone.content.save(article)
    def test_add_two_images_and_change_position(self):
        "Add two images and change their position"
        interpreter.annotate("Test: Add two images and change their position")

        images = []
        images.append(dataprovider.plonearticle.articleimage.get("Image 1"))
        images.append(dataprovider.plonearticle.articleimage.get("Image 2"))
        logical.plonearticle.article.add_multiple_images(images)

        # Change position of images       
        interpreter.click("//a[@class='file_move_down'][1]")
        interpreter.click("//a[@class='file_move_down'][1]")
        logical.plonearticle.article.save_article(self.article)
    def test_add_two_images_and_change_position(self):
        "Add two images and change their position"
        interpreter.annotate("Test: Add two images and change their position")

        images = []
        images.append(dataprovider.plonearticle.articleimage.get("Image 1"))
        images.append(dataprovider.plonearticle.articleimage.get("Image 2"))
        logical.plonearticle.article.add_multiple_images(images)

        # Change position of images
        interpreter.click("//a[@class='file_move_down'][1]")
        interpreter.click("//a[@class='file_move_down'][1]")
        logical.plonearticle.article.save_article(self.article)
 def test_add_non_existing_image(self):
     "Try adding a non-existing image to an article"
     interpreter.annotate("Test: Try adding a non-existing image to an article")
     image = dataprovider.plonearticle.articleimage.get("Non-existing Image")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("images")
     physical.plonearticle.attachment_upload.access()
     physical.plonearticle.attachment_upload.fill(image)
     physical.plonearticle.attachment_upload.save(image, "error")        
     interpreter.verifyTextPresent("Image upload error: cannot identify image file")
     # Due to differences in the *chrome mode, the following error is not produced:
     # interpreter.verifyTextPresent("Error: Zero file size")
     physical.plonearticle.attachment_upload.cancel()  
     logical.plonearticle.article.save_article(self.article)
 def test_add_non_existing_image(self):
     "Try adding a non-existing image to an article"
     interpreter.annotate(
         "Test: Try adding a non-existing image to an article")
     image = dataprovider.plonearticle.articleimage.get(
         "Non-existing Image")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("images")
     physical.plonearticle.attachment_upload.access()
     physical.plonearticle.attachment_upload.fill(image)
     physical.plonearticle.attachment_upload.save(image, "error")
     interpreter.verifyTextPresent(
         "Image upload error: cannot identify image file")
     # Due to differences in the *chrome mode, the following error is not produced:
     # interpreter.verifyTextPresent("Error: Zero file size")
     physical.plonearticle.attachment_upload.cancel()
     logical.plonearticle.article.save_article(self.article)
Exemplo n.º 11
0
 def step_1(self):
     "Add a link to an article and save the article"
     interpreter.annotate("Test: Add a link to the article and save the article")
     link = dataprovider.plonearticle.articlelink.get("Link 1")
     logical.plonearticle.article.add_link(link)
     logical.plonearticle.article.save_article(self.article)
 def step_1(self):
     "Browse an image to be added to the article"
     interpreter.annotate("Test: Browe a image to be added to the article")
     image = dataprovider.plonearticle.articleimage.get("Image 1")
     logical.plonearticle.article.browse_image(image)
 def step_1(self):
     "Add a file to an article"
     interpreter.annotate("Test: Add a file to the article")
     file = dataprovider.plonearticle.articlefile.get("File 1")
     logical.plonearticle.article.add_file(file)
     logical.plonearticle.article.save_article(self._article)
 def test_add_file(self):
     "Add a file to an article"
     interpreter.annotate("Test: Add a file to the article")
     file = dataprovider.plonearticle.articlefile.get("File 1")
     logical.plonearticle.article.add_file(file)
     logical.plonearticle.article.save_article(self.article)
Exemplo n.º 15
0
 def add_image(self, image, postcondition="success"):
     interpreter.annotate("Add an image to the article")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("images")
     physical.plonearticle.attachment_upload.add(image, postcondition)
Exemplo n.º 16
0
 def add_link(self, link, postcondition="success"):
     interpreter.annotate("Add a link to the article")
     physical.cmfplone.tab.access("edit")
     physical.plonearticle.attachment_upload.access_links()
     physical.plonearticle.attachment_upload.add(link, postcondition)
Exemplo n.º 17
0
 def browse_image(self, image):
     interpreter.annotate("Browse for an image to be added to the article")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("images")
     physical.plonearticle.attachmentbrowse.access()
Exemplo n.º 18
0
 def browse_link(self, link):
     interpreter.annotate("Browse for a link to be added to the article")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("links")
     physical.plonearticle.attachmentbrowse.access()
Exemplo n.º 19
0
 def delete_file(self, file):
     interpreter.annotate("Delete a file from the article")
     physical.cmfplone.tab.access("edit")
     physical.cmfplone.schemata.access("files")
Exemplo n.º 20
0
 def test_browse_image(self):
     "Browse an image to be added to the article"
     interpreter.annotate("Test: Browe a image to be added to the article")
     image = dataprovider.plonearticle.articleimage.get("Image 1")
     logical.plonearticle.article.browse_image(image)
Exemplo n.º 21
0
 def existing_article(self, article):        
     interpreter.annotate("Setup article")
     logical.cmfplone.navigation.top()
     logical.cmfplone.folder.add(article)
     logical.cmfplone.content.edit(article)        
     logical.cmfplone.content.save(article)