TestReplaceComicFile
open /wp-admin/
clickAndWait link=Dashboard
type upload /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.jpeg
click //input[@value='Upload Comic File and Edit Post']
waitForPageToLoad 50000
storeElementWidth //img[@id='comic-icon'] width
assertElementPresent //div[@id='comic-for-this-post']//strong/a[contains(@href, 'sample-comic.jpeg')]
type comicpress-replace-image /home/john/Desktop/comicpress/selenium/1990-01-01-wider-than-longer.png
clickAndWait //input[@id='save-post']
assertNotElementWidth //img[@id='comic-icon'] ${width}
assertElementPresent //div[@id='comic-for-this-post']//strong/a[contains(@href, 'sample-comic.png')]
click link=Move to Trash
waitForPageToLoad 30000
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
assertNotVisible //tr[@id='rebuild-thumbnails']
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-sample-comic.jpeg
click multiple-new-post-checkbox
clickAndWait 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
assertTextPresent No new posts created.
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
storeElementWidth //td[@class='comic']//img width
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-wider-than-longer.png
click multiple-new-post-checkbox
select overwrite-existing-file-choice label=1990-01-01-sample-comic.jpeg
click //option[@value='1990-01-01-sample-comic.jpeg']
assertVisible //tr[@id='rebuild-thumbnails']
select upload-destination label=Archive folder
click //option[@value='archive_comic']
assertNotVisible //tr[@id='rebuild-thumbnails']
select upload-destination label=Comics folder
click //option[@value='comic']
clickAndWait submit
assertTextPresent No new posts created.
assertTextPresent Uploaded file 1990-01-01-wider-than-longer.png renamed to 1990-01-01-sample-comic.png.
assertTextPresent The following files were uploaded: 1990-01-01-sample-comic.png
assertTextPresent Thumbnails were written for the following files: 1990-01-01-sample-comic.png
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
verifyNotElementWidth //td[@class='comic']//img ${width}
click toggle-all
select bulk-action label=Delete Selected
clickAndWait doaction
assertConfirmation You are about to delete the selected posts and comic files. Are you sure?
waitForPageToLoad 30000