From 68ea79a43c05403953252cdc085463139e18b291 Mon Sep 17 00:00:00 2001 From: PriestJ Date: Fri, 29 Feb 2008 11:02:00 +0000 Subject: [PATCH] altered references to save buttons so that they refer to the class id of the button rather than the id or the value git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3774 248e525c-4dfb-0310-94bc-949c084e9493 --- tests/enquirytests.rb | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/enquirytests.rb b/tests/enquirytests.rb index 34974dc..fca5f55 100644 --- a/tests/enquirytests.rb +++ b/tests/enquirytests.rb @@ -31,9 +31,9 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.contains_text('Contact Details'),'The Contact Details region not found') assert(@@ie.contains_text('Job Info'),'The Job Info region not found') #check we've got the save and cancel buttons but not apply changes - assert(@@ie.button(:value, 'Save').exists?,'Could not find a Save button') + assert(@@ie.button(:class, 'save').exists?,'Could not find a Save button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') - assert_not_equal(@@ie.button(:id, 'update').exists?,true,'Found Save(update) button when it should have been hidden') + assert_not_equal(@@ie.button(:class, 'update').exists?,true,'Found Save(update) button when it should have been hidden') #make sure that the ID field is not accessable (a form object) #assert_not_equal(@@ie.text_field(:name, 'P32_ID').exists?,true,'Found Apply Changes button when it should have been hidden') assert(@@ie.text_field(:id,'P32_ID').exists?,'Could not find P32_ID field') @@ -620,9 +620,9 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.contains_text('Contact Details'),'The Contact Details region not found') assert(@@ie.contains_text('Job Info'),'The Job Info region not found') #check we've got the save and cancel buttons but not apply changes - assert(@@ie.button(:value, 'Save').exists?,'Could not find a Save button') + assert(@@ie.button(:class, 'save').exists?,'Could not find a Save button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') - assert_not_equal(@@ie.button(:id, 'update').exists?,true,'Found Save(update) button when it should have been hidden') + assert_not_equal(@@ie.button(:class, 'update').exists?,true,'Found Save(update) button when it should have been hidden') #make sure that the ID field is not accessable (a form object) #assert_not_equal(@@ie.text_field(:name, 'P32_ID').exists?,true,'Found Apply Changes button when it should have been hidden') #make sure that the ID field is not accessable (a form object) @@ -738,9 +738,9 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.contains_text('Contact Details'),'The Contact Details region not found') assert(@@ie.contains_text('Job Info'),'The Job Info region not found') #check we've got the save and cancel buttons but not apply changes - assert(@@ie.button(:value, 'Save').exists?,'Could not find a Save button') + assert(@@ie.button(:class, 'save').exists?,'Could not find a Save button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') - assert_not_equal(@@ie.button(:id, 'update').exists?,true,'Found Save(update) button when it should have been hidden') + assert_not_equal(@@ie.button(:class, 'update').exists?,true,'Found Save(update) button when it should have been hidden') #make sure that the ID field is not accessable (a form object) #assert_not_equal(@@ie.text_field(:name, 'P32_ID').exists?,true,'Found Apply Changes button when it should have been hidden') @@ie.select_list(:id,'P32_AGENT_COMT_CODE').set 'Fax' @@ -765,11 +765,11 @@ class Test_02_enquiry < Test::Unit::TestCase @@ie.text_field(:id,'P32_FIRST_CONTACT_TELEPHONE_2').set '123456789' @@ie.text_field(:id,'P32_FIRST_CONTACT_FAX').set '123456789' @@ie.text_field(:id,'P32_FIRST_CONTACT_EMAIL').set 'jamie.priest@advanticagroup.com' - @@ie.button(:value, 'Save').click + @@ie.button(:class, 'save').click @@ie.wait assert_nil(@@ie.contains_text('Error'),'Error found (__LINE__) '+geterrormess(@@ie)) - assert_equal(false,@@ie.button(:value, 'Save').exists?,'Found Save button when it should have been hidden') - assert(@@ie.button(:id, 'update').exists?,'Could not find a Save(update) button') + assert_equal(false,@@ie.button(:class, 'save').exists?,'Found Save button when it should have been hidden') + assert(@@ie.button(:class, 'update').exists?,'Could not find a Save(update) button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') assert(@@ie.button(:value, 'Upload File').exists?,'Could not find an Upload File button') assert(@@ie.text_field(:id,'P32_ID').to_s,'No value in the ID field') @@ -811,7 +811,7 @@ class Test_02_enquiry < Test::Unit::TestCase @@ie.text_field(:id,'P32_OTHER_INFORMATION').set '' #@@ie.text_field(:id,'P32_EXISTING_LOGGER').set '' #@@ie.text_field(:id,'P32_EXISTING_CONVERTOR').set '' - @@ie.button(:id, 'update').click + @@ie.button(:class, 'update').click @@ie.wait @@ie.button(:value, 'Upload File').click @@ -874,9 +874,9 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.contains_text('Contact Details'),'The Contact Details region not found') assert(@@ie.contains_text('Job Info'),'The Job Info region not found') #check we've got the save and cancel buttons but not apply changes - assert(@@ie.button(:value, 'Save').exists?,'Could not find a Save button') + assert(@@ie.button(:class, 'save').exists?,'Could not find a Save button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') - assert_not_equal(@@ie.button(:id, 'update').exists?,true,'Found Save(update) button when it should have been hidden') + assert_not_equal(@@ie.button(:class, 'update').exists?,true,'Found Save(update) button when it should have been hidden') #make sure that the ID field is not accessable (a form object) #assert_not_equal(@@ie.text_field(:name, 'P32_ID').exists?,true,'Found Apply Changes button when it should have been hidden') @@ie.select_list(:id,'P32_MKTP_REF').set 'Northern Supplies' @@ -905,10 +905,10 @@ class Test_02_enquiry < Test::Unit::TestCase @@ie.text_field(:id,'P32_FIRST_CONTACT_TELEPHONE_2').set '123456789' @@ie.text_field(:id,'P32_FIRST_CONTACT_FAX').set '123456789' @@ie.text_field(:id,'P32_FIRST_CONTACT_EMAIL').set 'jamie.priest@advanticagroup.com' - @@ie.button(:value, 'Save').click + @@ie.button(:class, 'save').click @@ie.wait assert_nil(@@ie.contains_text('Error'),'Error found '+geterrormess(@@ie)) - assert(@@ie.button(:id, 'update').exists?,'Could not find a Save(update) button') + assert(@@ie.button(:class, 'update').exists?,'Could not find a Save(update) button') assert(@@ie.button(:value, 'Upload File').exists?,'Could not find a Save button') @@ie.button(:value, 'Upload File').click @@ie.wait @@ -946,9 +946,9 @@ class Test_02_enquiry < Test::Unit::TestCase assert(@@ie.contains_text('Contact Details'),'The Contact Details region not found') assert(@@ie.contains_text('Job Info'),'The Job Info region not found') #check we've got the save and cancel buttons but not apply changes - assert(@@ie.button(:value, 'Save').exists?,'Could not find a Save button') + assert(@@ie.button(:class, 'save').exists?,'Could not find a Save button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') - assert_not_equal(@@ie.button(:id, 'update').exists?,true,'Found Save(update) button when it should have been hidden') + assert_not_equal(@@ie.button(:class, 'update').exists?,true,'Found Save(update) button when it should have been hidden') #make sure that the ID field is not accessable (a form object) #assert_not_equal(@@ie.text_field(:name, 'P32_ID').exists?,true,'Found Apply Changes button when it should have been hidden') @@ie.select_list(:id,'P32_MKTP_REF').set 'Northern Supplies' @@ -977,15 +977,15 @@ class Test_02_enquiry < Test::Unit::TestCase @@ie.text_field(:id,'P32_FIRST_CONTACT_TELEPHONE_2').set '123456789' @@ie.text_field(:id,'P32_FIRST_CONTACT_FAX').set '123456789' @@ie.text_field(:id,'P32_FIRST_CONTACT_EMAIL').set 'jamie.priest@advanticagroup.com' - @@ie.button(:value, 'Save').click + @@ie.button(:class, 'save').click @@ie.wait assert_nil(@@ie.contains_text('Error'),'Error found '+geterrormess(@@ie)) - assert(@@ie.button(:id, 'update').exists?,'Could not find a Save(update) button') + assert(@@ie.button(:class, 'update').exists?,'Could not find a Save(update) button') assert(@@ie.button(:value, 'Upload File').exists?,'Could not find a Save button') assert_nil(@@ie.contains_text('Error'),'Error found') - assert_equal(false,@@ie.button(:value, 'Save').exists?,'Found Save button when it should have been hidden') - assert(@@ie.button(:id, 'update').exists?,'Could not find a Save(update) button') + assert_equal(false,@@ie.button(:class, 'save').exists?,'Found Save button when it should have been hidden') + assert(@@ie.button(:class, 'update').exists?,'Could not find a Save(update) button') assert(@@ie.button(:value, 'Cancel').exists?,'Could not find a Cancel button') assert(@@ie.button(:value, 'Upload File').exists?,'Could not find an Upload File button') assert(@@ie.text_field(:id,'P32_ID').to_s,'No value in the ID field')