UploadLibrarianImage
deleteAllVisibleCookies
setTimeout 100000
comment Upload image for Lily Librarian in the frontend
open /vivo/
assertTitle VIVO
comment Must not be logged in
clickAndWait link=Log in
assertTitle VIVO
comment Must log in as site admin
type loginName testAdmin
type loginPassword Password
clickAndWait loginForm
assertTitle VIVO
comment Find Lily Librarian via Index
clickAndWait link=Index
assertTitle Index to VIVO Contents
verifyTextPresent Librarian
clickAndWait link=Librarian
assertTitle Librarian
clickAndWait link=Librarian, Lily
assertTitle Librarian, Lily
comment Verify no photo currently exists
verifyElementPresent //img[@title='no image']
comment Select to update this individual's picture
clickAndWait //div[@id='dprop-vitro-image']/div/div/div/span/a
comment Select to upload an image
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //div[@id='photoUploadDefaultImageContainer']/img
comment Cancel out before adding a photo
clickAndWait link=Cancel
assertTitle Librarian, Lily
comment Select a photo to add and then cancel out
clickAndWait //div[@id='dprop-vitro-image']/div/div/div/span/a
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //div[@id='photoUploadDefaultImageContainer']/img
type datafile C:\VIVO\vivo-code\vivo\utilities\acceptance-tests\suites\CreatePeople\lily1.jpg
clickAndWait link=Cancel
assertTitle Librarian, Lily
comment Cancel after uploading the picture
clickAndWait //div[@id='dprop-vitro-image']/div/div/div/span/a
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //div[@id='photoUploadDefaultImageContainer']/img
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\lily1.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Crop Photo for Librarian, Lily
clickAndWait link=Cancel
assertTitle Librarian, Lily
comment Verify photo is not there
verifyElementPresent //img[@title='no image']
verifyElementNotPresent //img[@title='click to view larger image']
comment Try to add an image that is smaller than required
clickAndWait //div[@id='dprop-vitro-image']/div/div/div/span/a
assertTitle Upload image for Librarian, Lily
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\lilysmall.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent The uploaded image should be at least 115 pixels high and 115 pixels wide.
verifyTextPresent Current Photo
verifyElementPresent //div[@id='photoUploadDefaultImageContainer']/img
comment Try to add an image that is larger than allowed
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\lilylarge.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Please upload an image smaller than 6 megabytes
verifyTextPresent Current Photo
verifyElementPresent //div[@id='photoUploadDefaultImageContainer']/img
comment Now really add a photo
assertTitle Upload image for Librarian, Lily
type datafile C:\VIVO\vivo\utilities\acceptance-tests\suites\CreatePeople\lily1.jpg
clickAndWait //input[@value='Upload photo']
assertTitle Crop Photo for Librarian, Lily
verifyTextPresent Current Photo
verifyTextPresent Your profile photo will look like the image below.
verifyTextPresent To make adjustments, you can drag around and resize the photo to the right. When you are happy with your photo click the "Save Photo" button.
clickAndWait //input[@value='Save photo']
comment Verify photo is there
assertTitle Librarian, Lily
verifyAttribute //img[@title='click to view larger image']@src /vivo/file/*/thumbnail_lily1.jpg
comment Logout
clickAndWait link=Home
clickAndWait link=Log out
assertTitle VIVO