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 Log in to VIVO
comment Must log in as site admin
type loginName testAdmin
type loginPassword Password
clickAndWait loginForm
comment Find Lily Librarian via Index
clickAndWait link=Index
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 in the frontend
clickAndWait //img[@alt='add']
comment Select to upload an image
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //img[@alt='Individual photo']
comment Cancel out before adding a photo
clickAndWait link=Cancel
assertTitle Librarian, Lily
comment Select a photo to add and then cancel out
clickAndWait //img[@alt='add']
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //img[@alt='Individual photo']
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 //img[@alt='add']
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyElementPresent //img[@alt='Individual photo']
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 //img[@alt='add']
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 200 pixels high and 200 pixels wide.
verifyTextPresent Current Photo
verifyElementPresent //img[@alt='Individual photo']
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 //img[@alt='Individual photo']
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 Photo Upload
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