From c94f48c9f22dad18b815c8a23c5da58c63fcfa68 Mon Sep 17 00:00:00 2001 From: PriestJ Date: Thu, 13 Mar 2008 14:45:59 +0000 Subject: [PATCH] Updated after AH changed the way AMR field would be hidden. Added a non-tripartite exclusion to ensure that the tests worked as before (no amr displayed) git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3986 248e525c-4dfb-0310-94bc-949c084e9493 --- tests/constants.rb | 1 + tests/enquirytests.rb | 76 +++++++++++++++++++++++++++---------------- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/tests/constants.rb b/tests/constants.rb index 21b936a..e69ab56 100644 --- a/tests/constants.rb +++ b/tests/constants.rb @@ -32,6 +32,7 @@ ENQUIRY = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':32'+DEBUG BASE = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':50'+DEBUG HOUSING = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':54'+DEBUG MODULE = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':56'+DEBUG +TRIPARTITE = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':90'+DEBUG #URLs for party management screens MANAGE_PARTIES = PROTOCOL+MACHINE+'/'+DAD+'/f?p=' +APPLICATIONID+ ':60'+DEBUG CREATE_PARTY = PROTOCOL+MACHINE+'/'+DAD+'/f?p=' +APPLICATIONID+ ':61'+DEBUG diff --git a/tests/enquirytests.rb b/tests/enquirytests.rb index 5c0e8ed..d59781f 100644 --- a/tests/enquirytests.rb +++ b/tests/enquirytests.rb @@ -17,11 +17,28 @@ class Test_02_enquiry < Test::Unit::TestCase "Removal of non-Standard meter", "Request for OFGEM Meter Accuracy Test (OFMAT)"] @@savedenquiryid = '' + #Create a non-tripartite exclusion so we can test that the AMR option does not + #appear + def test_01_create_non_tripartite_exclusion + @@ie.goto(TRIPARTITE) + login(DEFAULT, DEFAULT_PWD) + assert(@@ie.contains_text('Non-Tripartite Exclusion'),'Non-Tripartite Exclusion screen not found') + assert(@@ie.select_list(:id,'P90_ENTY_CODE').exists?,'Could not find P90_ENTY_CODE select list') + assert(@@ie.select_list(:id,'P90_REGI_CODE').exists?,'Could not find P90_REGI_CODE select list') + assert(@@ie.select_list(:id,'P90_ADIT_CODE').exists?,'Could not find P90_ADIT_CODE select list') + assert(@@ie.button(:value, 'Create').exists?,'Could not find a Save button') + assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') + @@ie.select_list(:id,'P90_REGI_CODE').set'East of England' + @@ie.select_list(:id,'P90_ADIT_CODE').set'Automatic Meter Reading' + @@ie.button(:value, 'Create').click + @@ie.wait + assert(@@ie.contains_text('Exclusion saved.'),'Exclusion saved message not found') + end # #Test we can logon to the system using the webmip administrator user�s login credentials #and create a new enquiry screen # - def test_01_enquiry_screen_appears + def test_02_enquiry_screen_appears @@ie.goto(ENQUIRY) login(DEFAULT, DEFAULT_PWD) assert(@@ie.contains_text('Enquiry'),'The enquiry screen did not appear') @@ -75,7 +92,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.select_list(:id,'P32_HOUSING_REQUIRED').exists?,'Could not find P32_HOUSING_REQUIRED select list') assert(@@ie.select_list(:id,'P32_BASE_REQUIRED').exists?,'Could not find P32_BASE_REQUIRED select list') assert(@@ie.select_list(:id,'P32_CONVERTOR_REQUIRED').exists?,'Could not find P32_CONVERTOR_REQUIRED select list') - assert_equal(false,@@ie.select_list(:id,'P32_AMR_REQUIRED').exists?,'Found P32_AMR_REQUIRED select list') + assert(@@ie.select_list(:id,'P32_AMR_REQUIRED').exists?,'Could not find P32_AMR_REQUIRED select list') assert(@@ie.select_list(:id,'P32_EMS_REQUIRED').exists?,'Could not find P32_EMS_REQUIRED select list') assert(@@ie.select_list(:id,'P32_BYPASS_REQUIRED').exists?,'Could not find P32_BYPASS_REQUIRED select list') assert(@@ie.select_list(:id,'P32_LOAD_CONTROL_TYPE').exists?,'Could not find P32_LOAD_CONTROL_TYPE select list') @@ -98,7 +115,7 @@ class Test_02_enquiry < Test::Unit::TestCase #Ensure that the screen refreshes and displays the agents drop down list #when we choose a supplier # - def test_02_check_agent_appears_when_supplier_selected + def test_03_check_agent_appears_when_supplier_selected listofagents=["-Please select a value-","Fred Smith","Joe Bloggs"] @@ie.select_list(:id,'P32_MKTP_REF').set "Northern Supplies" @@ie.wait @@ -109,7 +126,7 @@ class Test_02_enquiry < Test::Unit::TestCase #Ensure that the screen refreshes and displays the agents contact mechanism drop down list #when we choose an agent # - def test_03_check_contact_mechs_appear_when_agent_selected + def test_04_check_contact_mechs_appear_when_agent_selected listofcontactmech=["-Please select a value-","Email","Fax","Mobile","Telephone"] @@ie.select_list(:id,'P32_AGENT_ID').set "Fred Smith" @@ie.wait @@ -119,7 +136,7 @@ class Test_02_enquiry < Test::Unit::TestCase # #Check that the contact value is displayed when the mechanism is selected # - def test_04_check_contact_mech_value_appears_when_mechanism_selected + def test_05_check_contact_mech_value_appears_when_mechanism_selected @@ie.select_list(:id,'P32_AGENT_COMT_CODE').set "Email" @@ie.wait assert(@@ie.text_field(:id,'P32_AGENT_CONTACT_VALUE').exists?,'Could not find P32_AGENT_CONTACT_VALUE field') @@ -128,7 +145,7 @@ class Test_02_enquiry < Test::Unit::TestCase #Check that the file upload is displayed when the mechanism #for delivering asset location notes is selected # - def test_05_check_file_upload_appears_when_asset_location_mechanism_selected + def test_06_check_file_upload_appears_when_asset_location_mechanism_selected listofcontactmech=["-Please select a value-","Post","Fax","Email","Upload"] @@ie.select_list(:id,'P32_ASSET_LOCATION_NOTES').set "Upload" @@ie.wait @@ -139,7 +156,7 @@ class Test_02_enquiry < Test::Unit::TestCase #Check that the contacts address appears if you select no (the contact #address is not the same as the site address) # - def test_06_check_contact_address_fields_appear_when_no_is_selected + def test_07_check_contact_address_fields_appear_when_no_is_selected listofoptions=["Yes","No"] @@ie.select_list(:id,'P32_INSTALL_ADDRESS').set "No" @@ie.wait @@ -155,7 +172,7 @@ class Test_02_enquiry < Test::Unit::TestCase #Check that the 2nd contacts address appears if you select yes (there # is a second contact address) # - def test_07_check_second_contact_address_fields_appear_when_no_is_selected + def test_08_check_second_contact_address_fields_appear_when_no_is_selected listofoptions=["Yes","No"] @@ie.select_list(:id,'P32_SECOND_CONTACT').set "Yes" @@ie.wait @@ -178,7 +195,10 @@ class Test_02_enquiry < Test::Unit::TestCase #Note: AMR should not be visible as none of the data load parties is set to be #a tripartite member # - def test_08_install_selected_check_fields_appear_available + def test_09_install_selected_check_fields_appear_available + #Set the postcode so that AMR should not appear for installs + # + @@ie.text_field(:id,'P32_INSTALL_POSTCODE').set 'LE11 3GR' @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[7] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -218,7 +238,7 @@ class Test_02_enquiry < Test::Unit::TestCase #Check all the correct fields are displayed when a standard job is selected #Note: AMR should not be visible as none of the data load parties is set to be #a tripartite member - def test_09_std_install_selected_check_fields_appear_available + def test_10_std_install_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[6] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -254,7 +274,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert_equal(false,@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Found P32_EXISTING_LOGGER select list') assert_equal(false,@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Found P32_EXISTING_CONVERTOR select list') end - def test_10_ofmat_selected_check_fields_appear_available + def test_11_ofmat_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[12] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -290,7 +310,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert_equal(false,@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Found P32_EXISTING_LOGGER select list') assert_equal(false,@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Found P32_EXISTING_CONVERTOR select list') end - def test_11_exchange_selected_check_fields_appear_available + def test_12_exchange_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[5] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -326,7 +346,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_12_std_exchange_selected_check_fields_appear_available + def test_13_std_exchange_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[4] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -362,7 +382,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_13_remove_selected_check_fields_appear_available + def test_14_remove_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[11] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -398,7 +418,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_14_std_remove_selected_check_fields_appear_available + def test_15_std_remove_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[10] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -434,7 +454,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_15_adversarial_selected_check_fields_appear_available + def test_16_adversarial_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[1] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -470,7 +490,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_16_alteration_selected_check_fields_appear_available + def test_17_alteration_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[2] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -506,7 +526,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_17_capacity_change_selected_check_fields_appear_available + def test_18_capacity_change_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[3] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -542,7 +562,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_18_addon_selected_check_fields_appear_available + def test_19_addon_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[9] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -578,7 +598,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_19_other_selected_check_fields_appear_available + def test_20_other_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[8] @@ie.wait assert_equal(@@enquirytypes,@@ie.select_list(:id, 'P32_ENTY_CODE').getAllContents ,'The expected list for job type was not found') @@ -614,7 +634,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') end - def test_20_logout_and_then_in_as_agent_check_enquiry_displays_correctly + def test_21_logout_and_then_in_as_agent_check_enquiry_displays_correctly menu('Logout') assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') @@ie.button(:value, 'Login').click @@ -701,7 +721,7 @@ class Test_02_enquiry < Test::Unit::TestCase # # Check that the customer service user does not have access to create an enquiry from the # menu. - def test_21_logout_and_then_in_as_Customer_Services_check_create_agent_displays_correctly + def test_22_logout_and_then_in_as_Customer_Services_check_create_agent_displays_correctly menu('Logout') assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') @@ie.button(:value, 'Login').click @@ -717,7 +737,7 @@ class Test_02_enquiry < Test::Unit::TestCase # #Supplier admin should be unable to create an enquiry via the menu. # - def test_22_logout_and_then_in_as_supplier_admin + def test_23_logout_and_then_in_as_supplier_admin menu('Logout') assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') @@ie.button(:value, 'Login').click @@ -732,7 +752,7 @@ class Test_02_enquiry < Test::Unit::TestCase # # Log in as agent and create and save an enquiry # - def test_23_login_as_agent_and_save_enquiry_then_change_apply_changes_request_for_quote + def test_24_login_as_agent_and_save_enquiry_then_change_apply_changes_request_for_quote menu('Logout') assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') @@ie.button(:value, 'Login').click @@ -842,7 +862,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert_nil(@@ie.contains_text('error'),'Error found (__LINE__) '+geterrormess(@@ie)) end - def test_24_find_saved_quote + def test_25_find_saved_quote menu('Enquiries') menu('Search for Enquiry') assert(@@ie.text_field(:id,'P30_ENQUIRY_ID').exists?,'Could not find P30_ENQUIRY_ID field') @@ -872,7 +892,7 @@ class Test_02_enquiry < Test::Unit::TestCase 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 + def test_26_upload_document_to_enquiry menu('Logout') assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') @@ie.button(:value, 'Login').click @@ -944,7 +964,7 @@ class Test_02_enquiry < Test::Unit::TestCase #assert(@@ie.link(:text,'Delete').exists?,'Could not find a Delete link') end - def test_26_upload_manual_quote + def test_27_upload_manual_quote menu('Logout') assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') @@ie.button(:value, 'Login').click @@ -1088,7 +1108,7 @@ class Test_02_enquiry < Test::Unit::TestCase end #Tripartite agreement(need to get data) #Test Manual quote, request for quote and upload file buttons - def test_27_check_the_meter_model_selection + def test_28_check_the_meter_model_selection fulllisofmetertypes=["-Please select a value-", "Coriolis", "Diaphragm",