TestImportComic
open /wp-admin/
store Selenium Hovertext hovertext
store Selenium Transcript transcript
clickAndWait link=ComicPress Config
click folder-s-comic_folder
click folder-s-rss_comic_folder
click folder-s-archive_comic_folder
select select-comic_folder comics
select select-rss_comic_folder comics-rss
select select-archive_comic_folder comics-archive
clickAndWait //input[@value='Update Config']
clickAndWait link=Manager Config
check cpm-edit-post-integrate
check cpm-archive-generate-thumbnails
check cpm-rss-generate-thumbnails
type cpm-default-override-title
type cpm-default-post-tags
uncheck cpm-default-comic-category-is-last-storyline
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.jpeg
uncheck 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 //a[contains(@href, 'comicpress-manager') and contains(text(), 'Import')]
assertElementNotPresent duplicate-check
click count-missing-posts-clicker
pause 2000
waitForText //span[@id='missing-posts-display'] 1
assertText //span[@id='missing-posts-display'] 1
assertChecked //div[@id='create-missing-posts-holder']//div[1]//input
type time 12:00am
type hovertext-to-use ${hovertext}
type transcript-to-use ${transcript}
clickAndWait submit
assertTextPresent New thumbnails were not needed for the following files: 1990-01-01-sample-comic.jpeg
assertTextPresent New posts created. View them from the links below:
assertTextPresent Sample Comic (1990-01-01 00:00:00)
clickAndWait //div[@id='cpm-messages']//a[text()='Edit post']
assertTextPresent ComicPress Manager Edit Post file management is enabled.
assertText //span[@id='timestamp'] Published on: Jan 1, 1990 @ 0:00
assertText //div[@id='comic-for-this-post']/div[@class='inside']//strong[1] 1990-01-01-sample-comic.jpeg
assertValue comicpress-img-title ${hovertext}
assertValue comicpress-transcript ${transcript}
assertChecked //div[@id='comic-for-this-post']//table[@class='form-table']//tr[2]//div[1]//input
click link=Move to Trash
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Import')]
storeText //div[@id='import-count-information'] import_count
getEval /safely import ([0-9]+) comics/.test(storedVars['import_count']); storedVars['import_count'] = RegExp.$1
clickAndWait link=Bulk Edit page
assertText //div[@class='activity-box']/h2 Bulk Edit
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
type upload-0 /home/john/Desktop/comicpress/selenium/good-large-import.zip
uncheck multiple-new-post-checkbox
type time 12:00am
click submit
waitForPageToLoad 200000
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Import')]
click count-missing-posts-clicker
waitForText //span[@id='missing-posts-display'] 30
assertText //span[@id='missing-posts-display'] 30
clickAndWait submit
assertText //div[@id='cpm-messages']/ul/li[1] Import safely exited before you ran out of execution time. Scroll down to continue creating missing posts.
getEval storedVars['index'] = storedVars['import_count']
while storedVars['index'] > 0
assertText //div[@id='cpm-messages']/ul/li[last()]/ul/li[${index}]/strong Sample Import Comic
assertTextPresent regexp:1990-01-[0-9][0-9]
getEval storedVars['index']--
endWhile
clickAndWait //input[@value='Continue Creating Posts']
assertText //div[@id='cpm-messages']/ul/li[1] Import safely exited before you ran out of execution time. Scroll down to continue creating missing posts.
getEval storedVars['index'] = storedVars['import_count']
while storedVars['index'] > 0
assertTextPresent Sample Import Comic
assertTextPresent regexp:1990-01-[0-9][0-9] 00:00:00
getEval storedVars['index']--
endWhile
clickAndWait //input[@value='Continue Creating Posts']
assertTextPresent No new posts needed to be created.
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
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
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 No items to display
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Upload')]
click multiple-new-post-checkbox
type upload-0 /home/john/Desktop/comicpress/selenium/1990-01-01-UPPERCASE-COMIC.JPG
clickAndWait submit
clickAndWait //a[contains(@href, 'comicpress-manager') and contains(text(), 'Import')]
click count-missing-posts-clicker
waitForText //span[@id='missing-posts-display'] 1
assertText //span[@id='missing-posts-display'] 1
clickAndWait link=Bulk Edit
select dates label=January 1990
clickAndWait dofilter
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