OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import pickle | 8 import pickle |
9 import re | 9 import re |
10 | 10 |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 page = settings.AutofillEditAddressDialog.FromNavigation(driver) | 767 page = settings.AutofillEditAddressDialog.FromNavigation(driver) |
768 non_duplicates = ['111-1111', '222-2222'] | 768 non_duplicates = ['111-1111', '222-2222'] |
769 duplicates = ['111-1111'] | 769 duplicates = ['111-1111'] |
770 page.Fill(phones=non_duplicates + duplicates) | 770 page.Fill(phones=non_duplicates + duplicates) |
771 self.assertEqual(non_duplicates, page.GetPhones(), | 771 self.assertEqual(non_duplicates, page.GetPhones(), |
772 msg='Duplicate phone number in prefs unexpectedly saved.') | 772 msg='Duplicate phone number in prefs unexpectedly saved.') |
773 | 773 |
774 def testDisplayLineItemForEntriesWithNoCCNum(self): | 774 def testDisplayLineItemForEntriesWithNoCCNum(self): |
775 """Verify Autofill creates a line item for CC entries with no CC number.""" | 775 """Verify Autofill creates a line item for CC entries with no CC number.""" |
776 driver = self.NewWebDriver() | 776 driver = self.NewWebDriver() |
777 self.NavigateToURL('chrome://settings/autofillEditCreditCard') | 777 self.NavigateToURL('chrome://settings-frame/autofillEditCreditCard') |
778 driver.find_element_by_id('name-on-card').send_keys('Jane Doe') | 778 driver.find_element_by_id('name-on-card').send_keys('Jane Doe') |
779 query_month = self._SelectOptionXpath('12') | 779 query_month = self._SelectOptionXpath('12') |
780 query_year = self._SelectOptionXpath('2014') | 780 query_year = self._SelectOptionXpath('2014') |
781 driver.find_element_by_id('expiration-month').find_element_by_xpath( | 781 driver.find_element_by_id('expiration-month').find_element_by_xpath( |
782 query_month).click() | 782 query_month).click() |
783 driver.find_element_by_id('expiration-year').find_element_by_xpath( | 783 driver.find_element_by_id('expiration-year').find_element_by_xpath( |
784 query_year).click() | 784 query_year).click() |
785 driver.find_element_by_id( | 785 driver.find_element_by_id( |
786 'autofill-edit-credit-card-apply-button').click() | 786 'autofill-edit-credit-card-apply-button').click() |
787 # Refresh the page to ensure the UI is up-to-date. | 787 # Refresh the page to ensure the UI is up-to-date. |
788 driver.refresh() | 788 driver.refresh() |
789 list_entry = driver.find_element_by_class_name('autofill-list-item') | 789 list_entry = driver.find_element_by_class_name('autofill-list-item') |
790 self.assertTrue(list_entry.is_displayed) | 790 self.assertTrue(list_entry.is_displayed) |
791 self.assertEqual('Jane Doe', list_entry.text, | 791 self.assertEqual('Jane Doe', list_entry.text, |
792 msg='Saved CC line item not same as what was entered.') | 792 msg='Saved CC line item not same as what was entered.') |
793 | 793 |
794 | 794 |
795 if __name__ == '__main__': | 795 if __name__ == '__main__': |
796 pyauto_functional.Main() | 796 pyauto_functional.Main() |
OLD | NEW |