AddFacultyMemberRoles1
comment Add grant roles for Jane Faculty
deleteAllVisibleCookies
open /vivo/
assertTitle VIVO
comment Must be logged off to start
clickAndWait link=Log in
assertTitle VIVO Site Administration
comment Must login as the site admin
type loginName testAdmin
type loginPassword Password
clickAndWait loginForm
assertTitle VIVO Site Administration
comment Navigate to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Jane Faculty
assertTitle Jane Faculty
comment Cancel out before adding Co-principal Investigator
clickAndWait //div[@id='hasCo-PrincipalInvestigatorRole']/a
assertTitle Edit
clickAndWait link=Cancel
assertTitle Jane Faculty
comment Enter invalid Co-principal Investigator role
clickAndWait //div[@id='hasCo-PrincipalInvestigatorRole']/a
assertTitle Edit
type relatedIndLabel NIH VIVO
clickAndWait submit
assertTitle Edit
comment Add good Co-principal Investigator role
type relatedIndLabel NIH VIVO
type startYear 2009
type endYear 2010
clickAndWait submit
assertTitle NIH VIVO
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Jane Faculty
assertTitle Jane Faculty
comment Verify Co-principal Investigator role is showing up
verifyTextPresent NIH VIVO
verifyTextPresent 2009-2010
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li/span
comment Add second Co-principal Investigator role
clickAndWait //div[@id='hasCo-PrincipalInvestigatorRole']/a
assertTitle Edit
type relatedIndLabel VIVO Cornell Grant
type startYear 2007
type endYear 2009
clickAndWait submit
assertTitle VIVO Cornell Grant
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Jane Faculty
assertTitle Jane Faculty
comment Verify both Co-principal Investigator roles are showing up
verifyTextPresent NIH VIVO
verifyTextPresent 2009-2010
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li/span
verifyTextPresent VIVO Cornell Grant
verifyTextPresent 2007-2009
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li[2]/span
comment Cancel out before adding Investigator
clickAndWait //div[@id='hasInvestigatorRole']/a
assertTitle Edit
clickAndWait link=Cancel
assertTitle Jane Faculty
comment Enter invalid Investigator role
clickAndWait //div[@id='hasInvestigatorRole']/a
assertTitle Edit
type relatedIndLabel VIVO Cornell Grant
click ui-active-menuitem
click link=(Verify this match)
waitForPopUp verifyMatchWindow 30000
clickAndWait submit
assertTitle Edit
comment Add good Investigator role
clickAndWait //div[@id='hasInvestigatorRole']/a
type relatedIndLabel VIVO Cornell Grant
type startYear 2009
type endYear 2009
clickAndWait submit
assertTitle VIVO Cornell Grant
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Jane Faculty
assertTitle Jane Faculty
comment Verify Investigator role is showing up
verifyTextPresent VIVO Cornell Grant
verifyTextPresent 2009-2009
verifyElementPresent //div[@id='hasInvestigatorRole']/ul/li/span
comment Add Principal Investigator role
clickAndWait //div[@id='hasPrincipalInvestigatorRole']/a
assertTitle Edit
type relatedIndLabel NIH VIVO
click ui-active-menuitem
click link=(Verify this match)
waitForPopUp verifyMatchWindow 30000
type startYear 2010
clickAndWait submit
assertTitle NIH VIVO
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Jane Faculty
assertTitle Jane Faculty
comment Verify Principal Investigator role is showing up
verifyTextPresent NIH VIVO
verifyTextPresent 2010
verifyElementPresent //div[@id='hasPrincipalInvestigatorRole']/ul/li/span
comment Verify that all grant roles are still there
verifyTextPresent NIH VIVO
verifyTextPresent 2009-2010
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li/span
verifyTextPresent VIVO Cornell Grant
verifyTextPresent 2007-2009
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li[2]/span
verifyTextPresent VIVO Cornell Grant
verifyTextPresent 2009-2009
verifyElementPresent //div[@id='hasInvestigatorRole']/ul/li/span
verifyTextPresent NIH VIVO
verifyTextPresent 2010
verifyElementPresent //div[@id='hasPrincipalInvestigatorRole']/ul/li/span
comment Log out
clickAndWait link=Log out
assertTitle VIVO