UploadNonPersonImage
deleteAllVisibleCookies
setTimeout 200000
comment Add image to non-person
open /vivo/
assertTitle VIVO
comment Must be logged off to start
clickAndWait link=Log in
assertTitle Log in to VIVO
comment Must login as the site admin
type loginName testAdmin@cornell.edu
type loginPassword Password
clickAndWait loginForm
comment Navigate to non-person
clickAndWait link=Index
clickAndWait link=Country
assertTitle Country
clickAndWait link=3
assertTitle Country
clickAndWait link=Germany
assertTitle Germany
verifyTextPresent Photo
comment Make sure no image exists
verifyTextNotPresent //img[@title='click to view larger image']
comment Select to add an image
clickAndWait //img[@alt='add']
assertTitle Upload image for Germany
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyTextPresent Upload a photo (JPEG, GIF or PNG)
comment Cancel before doing anything
clickAndWait link=Cancel
comment Hit upload button without selecting a file
assertTitle Germany
clickAndWait //img[@alt='add']
assertTitle Upload image for Germany
clickAndWait //input[@value='Upload photo']
assertTitle Upload image for Germany
verifyTextPresent Please browse and select a photo.
comment Now select to add map then cancel in cropping
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\germany1.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Crop Photo for Germany
clickAndWait link=Cancel
assertTitle Germany
comment Now really add the map image
clickAndWait //img[@alt='add']
assertTitle Upload image for Germany
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\germany1.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Crop Photo for Germany
clickAndWait //input[@value='Save photo']
assertTitle Germany
verifyElementPresent //img[@title='click to view larger image']
verifyAttribute //img[@title='click to view larger image']@src /vivo/file/*/thumbnail_germany1.jpg
comment Change image to German flag
clickAndWait //img[@alt='edit']
assertTitle Replace image for Germany
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //img[@alt='Individual photo']
verifyTextPresent Replace Photo (JPEG, GIF or PNG)
comment Cancel out and verify original image still there
clickAndWait link=Cancel
assertTitle Germany
verifyElementPresent //img[@title='click to view larger image']
verifyAttribute //img[@title='click to view larger image']@src /vivo/file/*/thumbnail_germany1.jpg
comment Cancel out again, this time in cropping phase
clickAndWait //img[@alt='edit']
assertTitle Replace image for Germany
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\germany2.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Crop Photo for Germany
clickAndWait link=Cancel
assertTitle Germany
verifyElementPresent //img[@title='click to view larger image']
verifyAttribute //img[@title='click to view larger image']@src /vivo/file/*/thumbnail_germany1.jpg
comment Now really change the map to a flag
clickAndWait //img[@alt='edit']
assertTitle Replace image for Germany
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\germany2.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Crop Photo for Germany
clickAndWait //input[@value='Save photo']
assertTitle Germany
comment Verify image is changed
verifyElementPresent //img[@title='click to view larger image']
verifyAttribute //img[@title='click to view larger image']@src /vivo/file/*/thumbnail_germany2.jpg
comment Now delete the image
clickAndWait //img[@alt='delete']
assertConfirmation Are you sure you want to delete this photo?
waitForPageToLoad 5000
assertTitle Germany
comment Verify no image is present
verifyElementNotPresent //img[@title='click to view larger image']
comment Log out
clickAndWait link=Home
clickAndWait link=Log out
assertTitle VIVO