diff --git a/tests/login_tests.rb b/tests/login_tests.rb index 9bf16d3..e4b5f38 100644 --- a/tests/login_tests.rb +++ b/tests/login_tests.rb @@ -23,18 +23,21 @@ class Test_01_login_screen < Test::Unit::TestCase assert(@@ie.contains_text('Value must be specified.'),'Expected not null error on username.') # test that a password must be given @@ie.text_field(:id,'P101_USERNAME').set 'login_test' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait assert(@@ie.contains_text('Value must be specified.'),'Expected not null error on password.') # test that a valid user must be given @@ie.text_field(:id,'P101_USERNAME').set 'not_a_user' @@ie.text_field(:id,'P101_PASSWORD').set 'password' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait assert(@@ie.contains_text('Invalid username/password specified.'),'User specified does not exist in the system.') # test that a valid password must be given @@ie.text_field(:id,'P101_USERNAME').set 'login_test' @@ie.text_field(:id,'P101_PASSWORD').set 'incorrect' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait assert(@@ie.contains_text('Invalid username/password specified.'),'Valid password error message incorrect.') @@ -46,6 +49,7 @@ class Test_01_login_screen < Test::Unit::TestCase @@ie.goto(LOGIN) @@ie.text_field(:id,'P101_USERNAME').set 'login_test' @@ie.text_field(:id,'P101_PASSWORD').set 'password' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait assert(@@ie.contains_text('Search Enquiries'),'User specified does not exist in the system.') @@ -57,6 +61,7 @@ class Test_01_login_screen < Test::Unit::TestCase @@ie.goto(LOGIN) @@ie.text_field(:id,'P101_USERNAME').set 'expired_user' @@ie.text_field(:id,'P101_PASSWORD').set 'password' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait assert(@@ie.contains_text('Change Password'),'Expired user account not redirected correctly during logon.') @@ -68,6 +73,7 @@ class Test_01_login_screen < Test::Unit::TestCase @@ie.goto(LOGIN) @@ie.text_field(:id,'P101_USERNAME').set 'locked_user' @@ie.text_field(:id,'P101_PASSWORD').set 'password' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait assert(@@ie.contains_text('The user account specified is locked. Please contact the system administrator.'),'Locked user account not redirected correctly during logon.') @@ -79,6 +85,7 @@ class Test_01_login_screen < Test::Unit::TestCase @@ie.goto(LOGIN) @@ie.text_field(:id,'P101_USERNAME').set 'expired_user' @@ie.text_field(:id,'P101_PASSWORD').set 'password' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait #confirm we're at the right page @@ -86,6 +93,7 @@ class Test_01_login_screen < Test::Unit::TestCase #fill in some new password details - make sure that we follow security protocol for passwords... @@ie.text_field(:id,'P102_NEW_PASSWORD').set 'P4ssw0rd.' @@ie.text_field(:id,'P102_REPEAT_PASSWORD').set 'P4ssw0rd.' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Change Password').click @@ie.wait #confirm the password was updated correctly @@ -96,6 +104,7 @@ class Test_01_login_screen < Test::Unit::TestCase assert(@@ie.button(:value,'Login').exists?,'Not navigated back to login page.') @@ie.text_field(:id,'P101_USERNAME').set 'expired_user' @@ie.text_field(:id,'P101_PASSWORD').set 'P4ssw0rd.' + @@ie.radio( :id,'P101_TC_ACCEPTED_0').set #'I accept the Terms and Conditions of using this site' @@ie.button(:value,'Login').click @@ie.wait #confirm we're at the right page