AddPositions
comment Validate this form and add positions
deleteAllVisibleCookies
open /vivo/
assertTitle VIVO
comment Must not be logged in already
clickAndWait link=Log in
assertTitle Log in to VIVO
comment Must log in as site admin
type loginName testAdmin
type loginPassword Password
clickAndWait loginForm
assertTitle VIVO
comment Navigate to test faculty member via Index
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Faculty, Jane
assertTitle Faculty, Jane
comment Select positions editing
clickAndWait //div[@id='personInPosition']/a
assertTitle Edit
verifyTextPresent Create position entry for Faculty, Jane
verifyTextPresent Organization Type
comment Cancel without adding anything
clickAndWait link=Cancel
clickAndWait //div[@id='personInPosition']/a
assertTitle Edit
comment Add only organization name, which results in error
select typeSelector label=College
type relatedIndLabel Carroll College
clickAndWait submit
assertTitle Edit
verifyTextPresent This field must not be empty.
comment Add position title, but leave position type and start year blank
type positionTitle Lecturer
clickAndWait submit
verifyTextPresent This field must not be empty.
assertTitle Edit
comment Enter in all fields except for end year
select positionType label=Faculty Administrative Position
type startYear 1971
clickAndWait submit
comment Verify first position is listed properly
assertTitle Faculty, Jane
verifyTextPresent Carroll College Lecturer, 1971 -
comment Add second position using same organization
clickAndWait //div[@id='personInPosition']/a
assertTitle Edit
select typeSelector label=College
type relatedIndLabel Carroll College
click ui-active-menuitem
type positionTitle Assistant Professor
select positionType label=Faculty Position
type startYear 1981
type endYear 1985
clickAndWait submit
assertTitle Faculty, Jane
comment Verify both positions are listed properly
verifyTextPresent Carroll College Lecturer, 1971 -
verifyTextPresent Carroll College Assistant Professor, 1981 - 1985
comment Add third position using new organization
clickAndWait //div[@id='personInPosition']/a
assertTitle Edit
select typeSelector label=University
type relatedIndLabel Cornell University
type positionTitle Assistant Professor
select positionType label=Faculty Position
type startYear 1986
type endYear 2010
clickAndWait submit
assertTitle Faculty, Jane
comment Verify all three positions show up
verifyTextPresent Carroll College Lecturer, 1971 -
verifyTextPresent Cornell University Assistant Professor, 1986 - 2010
verifyTextPresent Carroll College Assistant Professor, 1981 - 1985
comment Log out
clickAndWait link=Home
clickAndWait link=Log out
assertTitle VIVO