Added test for upload file, via upload file screen, also checks that the delete link is displayed

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3472 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
PriestJ
2008-02-05 17:27:37 +00:00
parent 7ff72a4506
commit 34d7c4b2c9

View File

@@ -840,16 +840,84 @@ class Test_02_enquiry < Test::Unit::TestCase
assert(@@ie.contains_text('Job Info'),'The Job Info region not found')
assert_equal(@@savedenquiryid,@@ie.text_field(:id,'P32_ID').value,' Enquiry screen for'+@@savedenquiryid+' not found')
assert(@@ie.hidden(:id,'P32_ACCESS_PASSWORD').exists?,'Password field is not read only, it should be!')
end
def test_25_upload_document_to_enquiry
menu('Logout')
assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available')
@@ie.button(:value, 'Login').click
@@ie.wait
end
login(MIPADMIN, MIPADMIN_PWD)
menu('Enquiries')
menu('Create Enquiry')
assert(@@ie.contains_text('Enquiry'),'The Enquiry screen did not appear')
#check the regions appear
assert(@@ie.contains_text('Site Detail'),'Site Detail region not found')
assert(@@ie.contains_text('Site Address'),'The Site Address region not found')
assert(@@ie.contains_text('Contact Details'),'The Contact Details region not found')
assert(@@ie.contains_text('Job Info'),'The Job Info region not found')
#check we've got the save and cancel buttons but not apply changes
assert(@@ie.button(:value, 'Save').exists?,'Could not find a Save button')
assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button')
assert_not_equal(@@ie.button(:value, 'Apply Changes').exists?,true,'Found Apply Changes button when it should have been hidden')
#make sure that the ID field is not accessable (a form object)
#assert_not_equal(@@ie.text_field(:name, 'P32_ID').exists?,true,'Found Apply Changes button when it should have been hidden')
@@ie.select_list(:id,'P32_MKTP_REF').set 'Northern Supplies'
@@ie.wait
@@ie.select_list(:id,'P32_AGENT_ID').set 'Fred Smith'
@@ie.wait
@@ie.select_list(:id,'P32_AGENT_COMT_CODE').set 'Fax'
@@ie.wait
@@ie.text_field(:id,'P32_AGENT_CONTACT_VALUE').set '1234567890'
@@ie.select_list(:id,'P32_ALTY_CODE').set 'Office'
@@ie.select_list(:id,'P32_CACA_CODE').set 'Blind'
@@ie.select_list(:id,'P32_ASSET_LOCATION_NOTES').set 'Post'
@@ie.text_field(:id,'P32_ACCESS_PASSWORD').set 'Test 25'
@@ie.text_field(:id,'P32_ACCESS_ADDITIONAL').set 'no more info'
@@ie.text_field(:id,'P32_MPRN').set '12345678910'
@@ie.text_field(:id,'P32_TRANSACTION_REFERENCE').set 'this is test 23'
@@ie.text_field(:id,'P32_INSTALL_SUB_BUILDING').set ADDRESSB[0]
@@ie.text_field(:id,'P32_INSTALL_BUILDING').set ADDRESSB[1]
@@ie.text_field(:id,'P32_INSTALL_STREET').set ADDRESSB[2]
@@ie.text_field(:id,'P32_INSTALL_CITY').set ADDRESSB[3]
@@ie.text_field(:id,'P32_INSTALL_POSTCODE').set ADDRESSB[4]
@@ie.text_field(:id,'P32_FIRST_CONTACT_NAME').set 'Charlie Test25'
@@ie.text_field(:id,'P32_FIRST_CONTACT_TELEPHONE_1').set '123456789'
@@ie.text_field(:id,'P32_FIRST_CONTACT_TELEPHONE_2').set '123456789'
@@ie.text_field(:id,'P32_FIRST_CONTACT_FAX').set '123456789'
@@ie.button(:value, 'Save').click
@@ie.wait
assert_nil(@@ie.contains_text('Error'),'Error found')
assert(@@ie.button(:value, 'Apply Changes').exists?,'Could not find a Save button')
assert(@@ie.button(:value, 'Upload File').exists?,'Could not find a Save button')
@@ie.button(:value, 'Upload File').click
@@ie.wait
#check the regions appear
assert(@@ie.contains_text('Current Files'),'Current Files region not found')
assert(@@ie.contains_text('Upload File'),'Upload File region not found')
#we know InstallMIP.cmd is around
@@ie.file_field(:id, 'P41_FILE_UPLOAD').set(WORKINGDIR+'\\InstallMIP.cmd')
@@ie.button(:value, 'Upload').click
@@ie.wait
assert(@@ie.contains_text('File for enquiry uploaded'),'Upload success message not found')
assert(@@ie.button(:value, 'Delete File').exists?,'Could not find a Delete File button')
@@ie.button(:value, 'Delete File').click
@@ie.wait
#check the regions appear
assert(@@ie.contains_text('Current Files'),'Current Files region not found')
assert(@@ie.contains_text('Upload File'),'Upload File region not found')
assert(@@ie.link(:text,'Delete').exists?,'Could not find a Delete link')
end
#Check asterisk on correct fields
#Amend an existing enquiry
#Is dash doing this?Copy an existing enquiry to a new enquiry
#Tripartite agreement(need to get data)
#Test Manual quote, request for quote and upload file buttons
def test_50_logout
menu('Logout')
assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available')
@@ie.button(:value, 'Login').click
@@ie.wait
end
end