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@cornell.edu
type loginPassword Password
clickAndWait loginForm
clickAndWait link=Index
comment Find Lily Librarian via 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
clickAndWait //img[@alt='add']
assertTitle Upload image for Librarian, Lily
verifyTextPresent Photo Upload
verifyTextPresent Current Photo
verifyTextPresent Upload a photo (JPEG, GIF or PNG)
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
verifyTextPresent Upload a photo (JPEG, GIF or PNG)
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
verifyTextPresent Upload a photo (JPEG, GIF or PNG)
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 Current Photo
verifyTextPresent Upload a photo (JPEG, GIF or PNG)
verifyTextPresent The uploaded image should be at least 200 pixels high and 200 pixels wide.
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 Current Photo
verifyTextPresent Upload a photo (JPEG, GIF or PNG)
verifyTextPresent Please upload an image smaller than 6 megabytes
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 css=input.submit
assertTitle Crop Photo for Librarian, Lily
clickAndWait css=input.submit
assertTitle Librarian, Lily
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