Files
mip/tests/exportdatatests.rb

82 lines
3.6 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#---
#This unit test checks the export data function of webmip
#should check that all the tables are available for export
#may have some issues with the file downloads as I'm not sure how
#we handle these with ie and watir
#---
class Test_01_export_data < Test::Unit::TestCase
#
#Test we can logon to the system using the webmip administrator users login credentials
#
def test_01_data_export_screen_appears
@@ie.goto(EXPORT_DATA)
#we'll need to login
login(JAMIE, JAMIE_PWD)
assert(@@ie.contains_text('Data Export'),'The data export screen did not appear')
assert(@@ie.select_list(:id, 'P5_TABLES').exists?,'The tables field was not available')
assert(@@ie.select_list(:id, 'P5_COLUMN_NAMES').exists?,'The column headings field was not available')
assert(@@ie.button(:id, 'Export Data').exists?,'The export data button was not available')
end
#
#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 expected table list for export was not found')
end
end