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
This commit is contained in:
jamie.priest
2009-08-18 17:11:49 +00:00
parent 78a157791f
commit e9f1d17092
5 changed files with 29 additions and 15 deletions

View File

@@ -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

View File

@@ -2,6 +2,7 @@
#
#require 'oci8'
#used to handle javascript popups
require 'watir/ie'
require 'watir/contrib/enabled_popup'
require 'watir/WindowHelper'
#

View File

@@ -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')

View File

@@ -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

View File

@@ -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