From e9f1d17092c63d7f99d286ec8d1209177ac88207 Mon Sep 17 00:00:00 2001 From: "jamie.priest" Date: Tue, 18 Aug 2009 17:11:49 +0000 Subject: [PATCH] Altered tests so they run with the latest version of Watir(1.6.2) also added new assertions for the purging_required field on the enquiry screen git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@12271 248e525c-4dfb-0310-94bc-949c084e9493 --- tests/constants.rb | 4 ++-- tests/default_methods.rb | 1 + tests/enquirytests.rb | 14 +++++++++++++- tests/start.rb | 21 +++++++++++---------- tests/webmipintegrationteststart.rb | 4 ++-- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/tests/constants.rb b/tests/constants.rb index e69ab56..3115778 100644 --- a/tests/constants.rb +++ b/tests/constants.rb @@ -28,11 +28,11 @@ DEBUG=':::NO' START_URL = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':1::::::' LOGIN = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':101'+DEBUG EXPORT_DATA = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':5'+DEBUG -ENQUIRY = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':32'+DEBUG +ENQUIRY = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':32' 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 +TRIPARTITE = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':90' #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/default_methods.rb b/tests/default_methods.rb index fd30a12..4b0e07b 100644 --- a/tests/default_methods.rb +++ b/tests/default_methods.rb @@ -2,6 +2,7 @@ # #require 'oci8' #used to handle javascript popups +require 'watir/ie' require 'watir/contrib/enabled_popup' require 'watir/WindowHelper' # diff --git a/tests/enquirytests.rb b/tests/enquirytests.rb index 43372ae..38e6def 100644 --- a/tests/enquirytests.rb +++ b/tests/enquirytests.rb @@ -232,7 +232,8 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') 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') - #Now need to test for the following fields after AH made fix for ticket #404 + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') +#Now need to test for the following fields after AH made fix for ticket #404 assert(@@ie.select_list(:id,'P32_REQUIRED_SVCP_CODE').exists?,'Could not find P32_REQUIRED_SVCP_CODE select list') assert(@@ie.text_field(:id,'P32_REQUIRED_METERING_PRESSURE').exists?,'Could not find P32_REQUIRED_METERING_PRESSURE field') @@ -276,6 +277,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') 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') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_11_ofmat_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[12] @@ -312,6 +314,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert_equal(false,@@ie.text_field(:id,'P32_EXISTING_LOGGER').exists?,'Found P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not Find P32_EXISTING_CONVERTOR select list') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_12_exchange_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[5] @@ -348,6 +351,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_13_std_exchange_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[4] @@ -384,6 +388,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_14_remove_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[11] @@ -420,6 +425,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert(@@ie.select_list(:id,'P32_PURGING_REQUIRED').exists?,'Could not find P32_PURGING_REQUIRED select list') end def test_15_std_remove_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[10] @@ -456,6 +462,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert(@@ie.select_list(:id,'P32_PURGING_REQUIRED').exists?,'Could not find P32_PURGING_REQUIRED select list') end def test_16_adversarial_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[1] @@ -492,6 +499,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_17_alteration_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[2] @@ -528,6 +536,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert(@@ie.select_list(:id,'P32_PURGING_REQUIRED').exists?,'Could not find P32_PURGING_REQUIRED select list') end def test_18_capacity_change_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[3] @@ -564,6 +573,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_19_addon_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[9] @@ -600,6 +610,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert_equal(false,@@ie.text_field(:id,'P32_PURGING_REQUIRED').exists?,'Found P32_PURGING_REQUIRED select list') end def test_20_other_selected_check_fields_appear_available @@ie.select_list(:id,'P32_ENTY_CODE').set @@enquirytypes[8] @@ -636,6 +647,7 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.text_field(:id,'P32_OTHER_INFORMATION').exists?,'Could not find P32_OTHER_INFORMATION field') assert(@@ie.select_list(:id,'P32_EXISTING_LOGGER').exists?,'Could not find P32_EXISTING_LOGGER select list') assert(@@ie.select_list(:id,'P32_EXISTING_CONVERTOR').exists?,'Could not find P32_EXISTING_CONVERTOR select list') + assert(@@ie.select_list(:id,'P32_PURGING_REQUIRED').exists?,'Could not find P32_PURGING_REQUIRED select list') end def test_21_logout_and_then_in_as_agent_check_enquiry_displays_correctly menu('Logout') diff --git a/tests/start.rb b/tests/start.rb index 5c4fdfc..413be6d 100644 --- a/tests/start.rb +++ b/tests/start.rb @@ -1,15 +1,17 @@ #requires -require 'watir' +require 'rubygems' +#require 'watir' +runfromdir = "C:/webmip/trunk/tests/" #require the test unit library require 'test/unit' #require our constants require 'constants' #require our useful helper methods -require 'default_methods.rb' +require runfromdir +'default_methods.rb' #includes -include Watir -@@ie = IE.new +#include Watir +@@ie = Watir::IE.new @@ie.maximize #set the speed of watir, we'd also set the speed of light but that's supposed to be a constant @@ie.speed = :fast @@ -34,21 +36,20 @@ include Watir # #Get our individual integration tests # -<<<<<<< .mine + #require 'exportdatatests' #require 'drawingtests' #require 'housingtests' #require 'moduletests' #require 'basestests' #require 'addontests' -require 'quote_reports' -======= +#require 'quote_reports' #require 'exportdatatests' -#require 'enquirytests' +require runfromdir +'enquirytests' #require 'housingtests' #require 'basestests' #require 'drawingtests.rb' -require 'user_management.rb' ->>>>>>> .r3436 +#require 'user_management.rb' + #@@ie.wait #@@ie.close \ No newline at end of file diff --git a/tests/webmipintegrationteststart.rb b/tests/webmipintegrationteststart.rb index 32f681f..a982767 100644 --- a/tests/webmipintegrationteststart.rb +++ b/tests/webmipintegrationteststart.rb @@ -25,10 +25,10 @@ require runfromdir+'exportdatatests' require runfromdir+'moduletests' require runfromdir+'user_management' #includes -include Watir +#include Watir -@@ie = IE.new +@@ie = Watir::IE.new @@ie.maximize #set the speed of watir, we'd also set the speed of light but that's supposed to be a constant @@ie.speed = :fast