UploadNonPersonImage
deleteAllVisibleCookies
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
type loginPassword Password
clickAndWait loginForm
assertTitle VIVO
comment Navigate to non-person
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Country
assertTitle Country
clickAndWait link=Germany
assertTitle Germany
verifyTextPresent image
comment Make sure no image exists
verifyElementNotPresent //img[@title='no image']
verifyTextNotPresent //img[@title='click to view larger image']
comment Select to add an image
clickAndWait link=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 link=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 link=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 //div[@id='dprop-vitro-image']/div/div/div/span/a[1]
assertTitle Replace image for Germany
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //div[@id='photoUploadDefaultImageContainer']/img
verifyElementPresent link=Delete 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 //div[@id='dprop-vitro-image']/div/div/div/span/a[1]
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 //div[@id='dprop-vitro-image']/div/div/div/span/a[1]
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 link=delete
assertConfirmation Are you sure you want to delete your photo?
refreshAndWait 10000
assertTitle Germany
verifyTextPresent image
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