diff --git a/tests/basestests.rb b/tests/basestests.rb index 11934eb..5c09863 100644 --- a/tests/basestests.rb +++ b/tests/basestests.rb @@ -9,7 +9,7 @@ class Test_05_base_screen < Test::Unit::TestCase def test_01_bases_screen_appears @@ie.goto(BASE) #we'll need to login - login(DK, DK_PWD) + login(MIPADMIN, MIPADMIN_PWD) assert(@@ie.contains_text('Bases'),'The bases screen did not appear') assert(@@ie.contains_text('Base Description'),'The base description column did not appear') assert(@@ie.contains_text('Depth'),'The Depth column did not appear') @@ -300,6 +300,12 @@ class Test_05_base_screen < Test::Unit::TestCase assert(@@ie.contains_text('Error'),'An error was not generated') end + def test_50_logout + menu('Logout') + assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') + @@ie.button(:value, 'Login').click + @@ie.wait + end end diff --git a/tests/constants.rb b/tests/constants.rb index 91ff871..989c6dc 100644 --- a/tests/constants.rb +++ b/tests/constants.rb @@ -29,6 +29,7 @@ LOGIN = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':101' EXPORT_DATA = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':5' ENQUIRY = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':32' BASE = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':50' +HOUSING = PROTOCOL+MACHINE+'/'+DAD+'/f?p='+APPLICATIONID+':54' #URLs for party management screens MANAGE_PARTIES = PROTOCOL+MACHINE+'/'+DAD+'/f?p=' +APPLICATIONID+ ':60' CREATE_PARTY = PROTOCOL+MACHINE+'/'+DAD+'/f?p=' +APPLICATIONID+ ':61' diff --git a/tests/drawingtests.rb b/tests/drawingtests.rb index 17050e2..5b7cbec 100644 --- a/tests/drawingtests.rb +++ b/tests/drawingtests.rb @@ -1,7 +1,7 @@ #--- #This unit test checks the drawings screen. #--- -class Test_02_drawings_screen < Test::Unit::TestCase +class Test_04_drawings_screen < Test::Unit::TestCase # #Test we can logon to the system using the webmip administrator user’s login credentials and check that #all the columns required for the report appears with the button to create a new drawings record diff --git a/tests/exportdatatests.rb b/tests/exportdatatests.rb index 32e43bd..83464d5 100644 --- a/tests/exportdatatests.rb +++ b/tests/exportdatatests.rb @@ -4,7 +4,7 @@ #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 +class Test_07_export_data < Test::Unit::TestCase # #Test we can logon to the system using the webmip administrator user’s login credentials # diff --git a/tests/housingtests.rb b/tests/housingtests.rb index 17928e0..1019ec3 100644 --- a/tests/housingtests.rb +++ b/tests/housingtests.rb @@ -9,7 +9,7 @@ class Test_03_housings_screen < Test::Unit::TestCase def test_01_housing_screen_appears @@ie.goto(HOUSING) #we'll need to login - login(DK, DK_PWD) + login(MIPADMIN, MIPADMIN_PWD) assert(@@ie.contains_text('Housings'),'The housing screen did not appear') assert(@@ie.contains_text('Housing Code'),'The housing code column did not appear') assert(@@ie.contains_text('Housing Type'),'The housing type column did not appear') @@ -248,7 +248,12 @@ class Test_03_housings_screen < Test::Unit::TestCase #~ assert_nil(@@ie.contains_text('ACTARIS'),'The new record with manufacturer dresser did appear') #~ assert(@@ie.contains_text('Error'),'An error was not generated') #~ end - + def test_50_logout + menu('Logout') + assert(@@ie.button(:value, 'Login').exists?,'The Login button was not available') + @@ie.button(:value, 'Login').click + @@ie.wait + end end diff --git a/tests/moduletests.rb b/tests/moduletests.rb index eddfc90..558533c 100644 --- a/tests/moduletests.rb +++ b/tests/moduletests.rb @@ -1,7 +1,7 @@ #--- #This unit test checks the modules screen. #--- -class Test_04_modules_screen < Test::Unit::TestCase +class Test_08_modules_screen < Test::Unit::TestCase # #Test we can logon to the system using the webmip administrator user’s login credentials and check that #all the columns required for the report appears with the button to create a new module record diff --git a/tests/user_management.rb b/tests/user_management.rb index a3e39fd..36e0c34 100644 --- a/tests/user_management.rb +++ b/tests/user_management.rb @@ -21,7 +21,7 @@ # - test_02_edit_users # - test_03_edit_suppliers #--- -class Test_07_MIPADMIN_party_management< Test::Unit::TestCase +class Test_09_MIPADMIN_party_management< Test::Unit::TestCase # #Test we can logon to the system using the webmip administrator user’s login credentials and check that #all the fields required for creating parties in the system are correctly displayed. @@ -465,7 +465,7 @@ class Test_07_MIPADMIN_party_management< Test::Unit::TestCase end end -class Test_08_SUPPADMIN_party_management< Test::Unit::TestCase +class Test_10_SUPPADMIN_party_management< Test::Unit::TestCase # #Test we can create a user (AGENT) in the system when logged on as SUPPADMIN user. # @@ -522,7 +522,7 @@ class Test_08_SUPPADMIN_party_management< Test::Unit::TestCase end end -class Test_09_edit_parties< Test::Unit::TestCase +class Test_11_edit_parties< Test::Unit::TestCase # #Test we can edit a user (AGENT) in the system when logged on as MIPADMIN user. # diff --git a/tests/webmipintegrationteststart.rb b/tests/webmipintegrationteststart.rb index e5b982a..fdd41cd 100644 --- a/tests/webmipintegrationteststart.rb +++ b/tests/webmipintegrationteststart.rb @@ -12,6 +12,7 @@ require 'test/unit' require 'test/unit/ui/console/testrunner' require 'test/unit/testsuite' #include the integration test cases +require 'login_tests' require 'exportdatatests' #includes @@ -47,7 +48,17 @@ include Watir class WebMipIntegrationTests def self.suite suite = Test::Unit::TestSuite.new('webMIP Integration tests') - suite << Test_01_export_data.suite + suite << Test_01_login_screen.suite + suite << Test_02_enquiry.suite + suite << Test_03_housings_screen.suite + suite << Test_04_drawings_screen.suite + suite << Test_05_base_screen.suite + suite << Test_06_addon_screen.suite + suite << Test_07_export_data.suite + suite << Test_08_modules_screen.suite + suite << Test_09_MIPADMIN_party_management.suite + suite << Test_10_SUPPADMIN_party_management.suite + suite << Test_11_edit_parties.suite #copy the line above, inserting your test to add #more testcases into the integration test suite return suite