ValidateProfessionalServiceForm
comment Validate Professional Service custom form error checking
deleteAllVisibleCookies
open /vivo/
assertTitle VIVO
comment Must not be logged in already
clickAndWait link=Log in
assertTitle VIVO Site Administration
comment Must log in as site admin
type username testAdmin
type password Password
clickAndWait loginSubmitMode
assertTitle VIVO Site Administration
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=Jane Faculty
assertTitle Jane Faculty
comment Make sure activity doesn't already exist
verifyTextNotPresent This is a test name
verifyTextNotPresent This is a test role
clickAndWait //div[@id='oprop-core-hasProfessionalServiceActivity']/a
comment Don't enter data in any fields
assertTitle Edit
clickAndWait submit
verifyTextPresent This field must not be empty.
comment Enter only the name
assertTitle Edit
type label This is a test name
comment Enter only the name and description
clickAndWait submit
assertTitle Edit
verifyTextPresent This field must not be empty.
type description This is a test description
clickAndWait submit
comment Enter name, description, and role but no dates
assertTitle Edit
verifyTextPresent This field must not be empty.
type role This is a test role
clickAndWait submit
comment Verify that the new activity was added
assertTitle Jane Faculty
verifyTextPresent This is a test name
verifyTextPresent This is a test role
clickAndWait //div[@id='oprop-core-hasProfessionalServiceActivity']/ul/li/span/span/a[1]
comment Edit activity to add dates
assertTitle Edit
comment Add invalid start date
type startYearMonth 99-02
clickAndWait submit
assertTitle Edit
verifyTextPresent Please correct this value: must be a valid year and month (YYYY-MM).
comment Add correct start date with invalid end date
type startYearMonth 1999-02
type endYearMonth 99-12
clickAndWait submit
assertTitle Edit
verifyTextPresent Please correct this value: must be a valid year and month (YYYY-MM).
comment Add correct end date
type endYearMonth 1999-12
clickAndWait submit
comment Verify that date fields are appearing now
assertTitle Jane Faculty
verifyTextPresent This is a test name
verifyTextPresent This is a test role
verifyTextPresent 02/1999 - 12/1999
comment Open up activity entry
clickAndWait link=This is a test name
assertTitle This is a test name
comment Verify that all fields are there
verifyTextPresent Jane Faculty
verifyTextPresent Assistant Professor
verifyTextPresent This is a test role
verifyTextPresent This is a test description
verifyTextPresent 1999-02
verifyTextPresent 1999-12
assertTitle This is a test name
clickAndWait //div[@id='dprop-core-role']/div/div/span/span/a[1]
assertTitle Edit
comment Change the role text
type tinymce This is a test role 2
clickAndWait submit
comment Change the name text
assertTitle This is a test name
clickAndWait //div[@id='dprop-core-startYearMonth']/div/div/span/span/a[1]
assertTitle Edit
comment Change the start and end date, with errors first
type tinymce 99-01
clickAndWait submit
assertTitle Edit
verifyTextPresent Please correct this value: must be a valid year and month (YYYY-MM).
type tinymce 1999-01
clickAndWait submit
assertTitle This is a test name
verifyTextPresent 1999-01
clickAndWait //div[@id='dprop-core-endYearMonth']/div/div/span/span/a[1]
assertTitle Edit
type tinymce 99-11
clickAndWait submit
assertTitle Edit
verifyTextPresent Please correct this value: must be a valid year and month (YYYY-MM).
type tinymce 1999-11
clickAndWait submit
assertTitle This is a test name
verifyTextPresent 1999-11
assertTitle This is a test name
comment Delete activity one field at a time
clickAndWait //div[@id='dprop-core-endYearMonth']/div/div/span/span/a[2]
assertTitle Edit
clickAndWait submit
assertTitle This is a test name
clickAndWait //div[@id='dprop-core-startYearMonth']/div/div/span/span/a[2]
assertTitle Edit
clickAndWait submit
assertTitle This is a test name
clickAndWait //div[@id='dprop-vitro-description']/div/div/div/span/a[2]
assertTitle Edit
clickAndWait submit
assertTitle This is a test name
clickAndWait //div[@id='dprop-core-role']/div/div/span/span/a[2]
assertTitle Edit
clickAndWait submit
pause 10000
assertTitle This is a test name
clickAndWait link=edit this individual
comment Delete activity form
assertTitle Individual Control Panel
clickAndWait //input[@value='Edit This Individual']
assertTitle Individual Editing Form
click _delete
assertConfirmation Are you SURE you want to delete this entity? If in doubt, CANCEL.
waitForPageToLoad 5000
assertTitle VIVO Site Administration
comment Navigate back to test faculty member to verify activity is gone
clickAndWait link=Index
assertTitle Index to VIVO Contents
clickAndWait link=Faculty Member
assertTitle Faculty Member
clickAndWait link=Jane Faculty
assertTitle Jane Faculty
comment Verify activity was deleted
verifyTextNotPresent This is a test name
verifyTextNotPresent This is a test role
verifyTextNotPresent 1999-01
verifyTextNotPresent 1999-11
comment Log out
clickAndWait link=Log out
assertTitle VIVO