build the start page for the initial integration test suite, this will run all the integration tests and email any errors or failure to my mail box, will need to add other members of the team at a later date
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@2867 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -45,9 +45,3 @@ ICU = 'testagent'
|
||||
ICU_PWD = 'testagent'
|
||||
CS = 'testagent'
|
||||
CS_PWD = 'testagent'
|
||||
INORG = 'testagent'
|
||||
INORG_PWD = 'testagent'
|
||||
EXTORG = 'testagent'
|
||||
EXTORG_PWD = 'testagent'
|
||||
MEMBER = 'testagent'
|
||||
MEMBER_PWD = 'testagent'
|
||||
@@ -21,61 +21,61 @@ class Test_01_export_data < Test::Unit::TestCase
|
||||
#Check that all the appropriate tables are listed for export
|
||||
#
|
||||
def test_02_correct_list_of_tables_displayed
|
||||
listoftablestoexport= %W[ACCESS_CONTROLS
|
||||
ADDRESSES
|
||||
ASSET_LOCATION_TYPES
|
||||
BASES
|
||||
BYPASS_REASONS
|
||||
CARE_CATEGORIES
|
||||
CONNECTION_ORIENTATIONS
|
||||
CONNECTION_TYPES
|
||||
CONTACT_MECHANISMS
|
||||
CONTACT_MECHANISM_TYPES
|
||||
COSTS
|
||||
DATA_ITEMS
|
||||
DATA_ITEM_ROLES
|
||||
DATA_ITEM_ROLES_IMPORT
|
||||
DRAWINGS
|
||||
ENQUIRIES
|
||||
ENQUIRY_EVENTS
|
||||
ENQUIRY_ROLES
|
||||
ENQUIRY_STATUS_TYPES
|
||||
ENQUIRY_TYPES
|
||||
ERROR_LOGS
|
||||
EXCEPTION_MESSAGES
|
||||
FILTERS
|
||||
FILTER_TYPES
|
||||
HOUSINGS
|
||||
HOUSING_TYPES
|
||||
METERS
|
||||
METER_SIZE_CODES
|
||||
METER_TYPES
|
||||
MODULES
|
||||
PARTIES
|
||||
PARTY_ADDRESSES
|
||||
PARTY_ADDRESS_ROLES
|
||||
PARTY_CONTACT_MECHANISMS
|
||||
PARTY_CONTACT_MECHANISM_ROLES
|
||||
PARTY_RELATIONSHIPS
|
||||
PARTY_RELATIONSHIP_TYPES
|
||||
PARTY_ROLES
|
||||
PASSWORDS
|
||||
QUOTES
|
||||
QUOTE_EVENTS
|
||||
QUOTE_ITEMS
|
||||
QUOTE_ROLES
|
||||
QUOTE_STATUSES
|
||||
REGIONS
|
||||
REGULATORS
|
||||
REGULATOR_TYPES
|
||||
RELIEF_VALVES
|
||||
RELIEF_VALVE_TYPES
|
||||
ROLE_TYPES
|
||||
SERVICE_PRESSURES
|
||||
SERVICE_PRESSURE_TYPES
|
||||
SLAMSHUT_TYPES
|
||||
SLAMSHUT_VALVES]
|
||||
assert_equal(listoftablestoexport,@@ie.select_list(:id, 'P5_TABLES').getAllContents ,'The data export screen did not appear')
|
||||
listoftablestoexport= %W[ACCESS_CONTROLS
|
||||
ADDRESSES
|
||||
ASSET_LOCATION_TYPES
|
||||
BASES
|
||||
BYPASS_REASONS
|
||||
CARE_CATEGORIES
|
||||
CONNECTION_ORIENTATIONS
|
||||
CONNECTION_TYPES
|
||||
CONTACT_MECHANISMS
|
||||
CONTACT_MECHANISM_TYPES
|
||||
COSTS
|
||||
DATA_ITEMS
|
||||
DATA_ITEM_ROLES
|
||||
DATA_ITEM_ROLES_IMPORT
|
||||
DRAWINGS
|
||||
ENQUIRIES
|
||||
ENQUIRY_EVENTS
|
||||
ENQUIRY_ROLES
|
||||
ENQUIRY_STATUS_TYPES
|
||||
ENQUIRY_TYPES
|
||||
ERROR_LOGS
|
||||
EXCEPTION_MESSAGES
|
||||
FILTERS
|
||||
FILTER_TYPES
|
||||
HOUSINGS
|
||||
HOUSING_TYPES
|
||||
METERS
|
||||
METER_SIZE_CODES
|
||||
METER_TYPES
|
||||
MODULES
|
||||
PARTIES
|
||||
PARTY_ADDRESSES
|
||||
PARTY_ADDRESS_ROLES
|
||||
PARTY_CONTACT_MECHANISMS
|
||||
PARTY_CONTACT_MECHANISM_ROLES
|
||||
PARTY_RELATIONSHIPS
|
||||
PARTY_RELATIONSHIP_TYPES
|
||||
PARTY_ROLES
|
||||
PASSWORDS
|
||||
QUOTES
|
||||
QUOTE_EVENTS
|
||||
QUOTE_ITEMS
|
||||
QUOTE_ROLES
|
||||
QUOTE_STATUSES
|
||||
REGIONS
|
||||
REGULATORS
|
||||
REGULATOR_TYPES
|
||||
RELIEF_VALVES
|
||||
RELIEF_VALVE_TYPES
|
||||
ROLE_TYPES
|
||||
SERVICE_PRESSURES
|
||||
SERVICE_PRESSURE_TYPES
|
||||
SLAMSHUT_TYPES
|
||||
SLAMSHUT_VALVES]
|
||||
assert_equal(listoftablestoexport,@@ie.select_list(:id, 'P5_TABLES').getAllContents ,'The expected table list for export was not found')
|
||||
end
|
||||
|
||||
|
||||
|
||||
93
tests/webmipintegrationteststart.rb
Normal file
93
tests/webmipintegrationteststart.rb
Normal file
@@ -0,0 +1,93 @@
|
||||
#requires
|
||||
require 'watir'
|
||||
|
||||
#require our constants
|
||||
require 'constants'
|
||||
#require our useful helper methods
|
||||
require 'default_methods.rb'
|
||||
#email stuff
|
||||
require 'net/smtp'
|
||||
#require the test unit library
|
||||
require 'test/unit'
|
||||
require 'test/unit/ui/console/testrunner'
|
||||
require 'test/unit/testsuite'
|
||||
#include the integration test cases
|
||||
require 'exportdatatests'
|
||||
|
||||
#includes
|
||||
include Watir
|
||||
|
||||
|
||||
@@ie = 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
|
||||
|
||||
|
||||
#
|
||||
# Setup default config
|
||||
#
|
||||
# Remove the test data
|
||||
#
|
||||
#dosql('begin cleanup_testdata; commit; end;')
|
||||
#
|
||||
# Set the system submission deadline
|
||||
#
|
||||
#dosql('begin UPDATE system_configuration SET value = \'20:00\'
|
||||
# WHERE parameter = \'G_SUBMISSION_DEADLINE\'; commit; end; ')
|
||||
|
||||
#
|
||||
#Set up our contracts before we start serious testing
|
||||
#
|
||||
#require 'usefulscriptthatmightsetupdata'
|
||||
|
||||
#
|
||||
#Get our individual integration tests
|
||||
#
|
||||
class WebMipIntegrationTests
|
||||
def self.suite
|
||||
suite = Test::Unit::TestSuite.new('webMIP Integration tests')
|
||||
suite << Test_01_export_data.suite
|
||||
#copy the line above, inserting your test to add
|
||||
#more testcases into the integration test suite
|
||||
return suite
|
||||
end
|
||||
end
|
||||
|
||||
#set output from test runner to be verbose and output to a iostring
|
||||
sio = StringIO.new
|
||||
tr = Test::Unit::UI::Console::TestRunner.new(
|
||||
WebMipIntegrationTests, Test::Unit::UI::VERBOSE, sio )
|
||||
|
||||
#Set the test runner off
|
||||
passed = tr.start()
|
||||
|
||||
|
||||
|
||||
#if we have some test failures or errors then send the email
|
||||
if (passed.failure_count() > 0 or passed.error_count() > 0)
|
||||
#build the email
|
||||
from_addr = 'jamie.priest@advantica.com'
|
||||
to_addr = 'jamie.priest@advanticagroup.com'
|
||||
project = 'webMIP'
|
||||
errors = sio.string
|
||||
emailtext = <<END_EMAIL
|
||||
From: webMIP <#{from_addr}>
|
||||
To: Jamie Priest <#{to_addr}>
|
||||
Subject: #{project} automated test failure
|
||||
|
||||
An automated assertion failed for the project
|
||||
#{project}
|
||||
|
||||
#{errors}
|
||||
|
||||
END_EMAIL
|
||||
Net::SMTP.start('LOMAIL01') do |smtp|
|
||||
smtp.sendmail emailtext, from_addr, to_addr
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ie.wait
|
||||
@@ie.close
|
||||
Reference in New Issue
Block a user