AddFacultyMemberRoles1
comment Add grant roles for Jane Faculty--originally tested auto-complete but doesn't work well within Selenium
deleteAllVisibleCookies
open /vivo/
assertTitle VIVO
comment Must be logged off to start
clickAndWait link=Log in
assertTitle Log in to VIVO
comment Must login as the site admin
type loginName testAdmin
type loginPassword Password
clickAndWait loginForm
assertTitle VIVO
comment Navigate to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Faculty, Jane
assertTitle Faculty, Jane
comment Cancel out before adding Co-principal Investigator
clickAndWait //div[@id='hasCo-PrincipalInvestigatorRole']/a
assertTitle Edit
verifyTextPresent Create co-principal investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
clickAndWait link=Cancel
assertTitle Faculty, Jane
comment Enter invalid Co-principal Investigator role
clickAndWait //div[@id='hasCo-PrincipalInvestigatorRole']/a
assertTitle Edit
verifyTextPresent Create co-principal investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
type relatedIndLabel NIH VIVO
clickAndWait submit
verifyTextPresent This field must not be empty.
assertTitle Edit
comment Add good Co-principal Investigator role
verifyTextPresent Create co-principal investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
type relatedIndLabel NIH VIVO
type startYear 2009
type endYear 2010
clickAndWait submit
assertTitle Faculty, Jane
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Faculty, Jane
assertTitle Faculty, Jane
comment Verify Co-principal Investigator role is showing up
verifyElementPresent link=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
verifyTextPresent Create co-principal investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
type relatedIndLabel VIVO Cornell Grant
type startYear 2007
type endYear 2009
clickAndWait submit
assertTitle Faculty, Jane
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Faculty, Jane
assertTitle Faculty, Jane
comment Verify both Co-principal Investigator roles are showing up
verifyTextPresent VIVO Cornell Grant
verifyTextPresent 2007 - 2009
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li[1]/span
verifyElementPresent link=NIH VIVO
verifyTextPresent 2009 - 2010
verifyElementPresent //div[@id='hasCo-PrincipalInvestigatorRole']/ul/li[2]/span
comment Cancel out before adding Investigator
clickAndWait //div[@id='hasInvestigatorRole']/a
assertTitle Edit
verifyTextPresent Create investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
clickAndWait link=Cancel
assertTitle Faculty, Jane
comment Enter invalid Investigator role
clickAndWait //div[@id='hasInvestigatorRole']/a
assertTitle Edit
verifyTextPresent Create investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
type relatedIndLabel VIVO Cornell Grant Too
clickAndWait submit
assertTitle Edit
verifyTextPresent This field must not be empty.
comment Add good Investigator role
verifyTextPresent Create investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
type relatedIndLabel VIVO Cornell Grant Too
type startYear 2009
type endYear 2009
clickAndWait submit
assertTitle Faculty, Jane
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Faculty, Jane
assertTitle Faculty, Jane
comment Verify Investigator role is showing up
verifyTextPresent VIVO Cornell Grant Too
verifyTextPresent 2009
verifyElementPresent //div[@id='hasInvestigatorRole']/ul/li/span/a
comment Add Principal Investigator role
clickAndWait //div[@id='hasPrincipalInvestigatorRole']/a
assertTitle Edit
verifyTextPresent Create principal investigator entry for Faculty, Jane
verifyTextPresent Grant Name
verifyTextPresent Years of Participation in Grant
verifyTextPresent Start Year
verifyTextPresent End Year
type relatedIndLabel NIH VIVO Too
type startYear 2010
clickAndWait submit
assertTitle Faculty, Jane
comment Navigate back to Jane Faculty
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Faculty, Jane
assertTitle Faculty, Jane
comment Verify Principal Investigator role is showing up
verifyTextPresent NIH VIVO Too
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 Too
verifyTextPresent 2009
verifyElementPresent //div[@id='hasInvestigatorRole']/ul/li/span
verifyTextPresent NIH VIVO Too
verifyTextPresent 2010
verifyElementPresent //div[@id='hasPrincipalInvestigatorRole']/ul/li/span
comment Log out
clickAndWait link=Home
clickAndWait link=Log out
assertTitle VIVO