TestUploadComicFile
open /wp-admin/
store Selenium Title title
store Selenium Hovertext hovertext
store Selenium Transcript transcript
clickAndWait link=Manager Config
check cpm-perform-gd-check
check cpm-archive-generate-thumbnails
check cpm-rss-generate-thumbnails
clickAndWait //input[@value='Change Configuration']
clickAndWait link=ComicPress Config
select comic label=A Moment of Clarity (default)
clickAndWait //input[@value='Submit']
assertTextPresent Now managing A Moment of Clarity.
assertText //div[@id='comicpress-details']//li[3]//em generating
assertText //div[@id='comicpress-details']//li[4]//em generating
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.jpeg
type override-title-to-use ${title}
type hovertext-to-use ${hovertext}
type transcript-to-use ${transcript}
click //input[@id='top-submit']
waitForPageToLoad 60000
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic.jpeg
assertTextPresent Thumbnails were written for the following files: 1990-01-01-sample-comic.jpeg
assertTextPresent ${title}
clickAndWait //div[@id='cpm-messages']//a[text()='Edit post']
assertValue title ${title}
assertElementPresent //span[@id='timestamp']/b[contains(text(), 'Jan 1, 1990')]
assertElementPresent //div[@id='comic-for-this-post']//a[text()='1990-01-01-sample-comic.jpeg']
assertValue comicpress-img-title ${hovertext}
assertValue comicpress-transcript ${transcript}
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
assertTextPresent Sample Comic
assertTextPresent ${title}
assertTextPresent ${hovertext}
assertTextPresent ${transcript}
assertElementPresent //td[@class='comic']//a[contains(@href, '1990-01-01-sample-comic.jpeg')][text()='rss']
assertElementPresent //td[@class='comic']//a[contains(@href, '1990-01-01-sample-comic.jpeg')][text()='archive']
click regen-1990-01-01-sample-comic.jpeg
clickAndWait doaction
assertTextPresent The following thumbnails were written: 1990-01-01-sample-comic.jpeg
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
assertTextPresent 1990-01-01-sample-comic.jpeg
assertText //div[@class='tablenav'][1]//span[@class='displaying-num'] No items to display
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
clickAndWait //input[@id='top-submit']
assertTextNotPresent PHP upload error code
assertTextPresent You didn't upload any files!
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.txt
clickAndWait //input[@id='top-submit']
assertTextPresent According to GD, the following files were invalid image files: 1990-01-01-sample-comic.txt
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic-not-jpeg.jpeg
clickAndWait //input[@id='top-submit']
assertTextPresent According to GD, the following files were invalid image files: 1990-01-01-sample-comic-not-jpeg.jpeg
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-too-large-file.jpeg
click //input[@id='top-submit']
waitForPageToLoad 300000
assertTextPresent Your uploaded files were larger than the post_max_size setting
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.zip
click //input[@id='top-submit']
waitForPageToLoad 600000
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic.jpeg
assertTextPresent Thumbnails were written for the following files: 1990-01-01-sample-comic.jpeg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
assertTextPresent 1990-01-01-sample-comic.jpeg
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.txt.zip
clickAndWait //input[@id='top-submit']
assertTextPresent According to GD, the following files were invalid image files: 1990-01-01-sample-comic.txt
type upload-0 /home/john/Desktop/comicpress/selenium/comics.zip
clickAndWait //input[@id='top-submit']
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic.jpeg
assertTextPresent Thumbnails were written for the following files: 1990-01-01-sample-comic.jpeg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
assertTextPresent 1990-01-01-sample-comic.jpeg
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/too-large-import.zip
click multiple-new-post-checkbox
click submit
waitForPageToLoad 60000
assertTextPresent regexp:(The file too-large-import.zip was too large.|larger than the post_max_size)
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-gif_thumbnail.gif
click multiple-new-post-checkbox
clickAndWait submit
assertTextPresent The following files were uploaded: 1990-01-01-gif_thumbnail.gif
assertTextPresent Thumbnails were written for the following files: 1990-01-01-gif_thumbnail.gif
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 1
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
assertTextPresent 1990-01-01-gif_thumbnail.gif
clickAndWait link=Manager Config
check cpm-perform-gd-check
clickAndWait //input[@value='Change Configuration']
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic-no-extension-jpeg
clickAndWait top-submit
assertTextPresent GD was able to recognize the filetypes of these files and change their extensions to match: 1990-01-01-sample-comic-no-extension-jpeg
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic-no-extension-jpeg.jpg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic-no-extension-jpeg.zip
clickAndWait submit
assertTextPresent GD was able to recognize the filetypes of these files and change their extensions to match: 1990-01-01-sample-comic-no-extension-jpeg
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic-no-extension-jpeg.jpg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.bad-extension
clickAndWait top-submit
assertTextPresent GD was able to recognize the filetypes of these files and change their extensions to match: 1990-01-01-sample-comic.bad-extension
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic.jpg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.bad-extension.zip
clickAndWait top-submit
assertTextPresent GD was able to recognize the filetypes of these files and change their extensions to match: 1990-01-01-sample-comic.bad-extension
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic.jpg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic-cmyk.jpeg
clickAndWait //input[@id='top-submit']
assertTextPresent The following JPEG files have been converted from CMYK to RGB: 1990-01-01-sample-comic-cmyk.jpeg
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
assertTextPresent Displaying 1-1 of 1
assertXpathCount //table[@id='status-table']/tbody/tr[@class='data-row'] 2
click toggle-all
select bulk-action label=Delete Selected
click doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000