diff options
author | alyssad@chromium.org <alyssad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-09 18:22:56 +0000 |
---|---|---|
committer | alyssad@chromium.org <alyssad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-09 18:22:56 +0000 |
commit | 55846ad8432f07ebc6fce2fafadffe60a5bab246 (patch) | |
tree | 502750d292fb9b9b184dc7671ad2ff4bd563302a /chrome/test/functional | |
parent | 756ef54543f64b1295ac6c93df4c7fb9e62ab435 (diff) | |
download | chromium_src-55846ad8432f07ebc6fce2fafadffe60a5bab246.zip chromium_src-55846ad8432f07ebc6fce2fafadffe60a5bab246.tar.gz chromium_src-55846ad8432f07ebc6fce2fafadffe60a5bab246.tar.bz2 |
New pyauto hook to set and get autofill profiles
Review URL: http://codereview.chromium.org/2836046
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/functional')
-rw-r--r-- | chrome/test/functional/PYAUTO_TESTS | 1 | ||||
-rw-r--r-- | chrome/test/functional/autofill.py | 53 |
2 files changed, 54 insertions, 0 deletions
diff --git a/chrome/test/functional/PYAUTO_TESTS b/chrome/test/functional/PYAUTO_TESTS index 87c70c3..85772d5 100644 --- a/chrome/test/functional/PYAUTO_TESTS +++ b/chrome/test/functional/PYAUTO_TESTS @@ -21,6 +21,7 @@ { 'all': [ + 'autofill', 'bookmark_bar', 'bookmarks', 'browser', diff --git a/chrome/test/functional/autofill.py b/chrome/test/functional/autofill.py new file mode 100644 index 0000000..0c68c22 --- /dev/null +++ b/chrome/test/functional/autofill.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import pyauto_functional # Must be imported before pyauto +import pyauto + + +class AutoFillTest(pyauto.PyUITest): + """Tests that autofill works correctly""" + + def testFillProfile(self): + """Test filling profiles and overwriting with new profiles""" + profiles = [{'label': 'Profile 1', 'NAME_FIRST': 'Bob', + 'NAME_LAST': 'Smith', 'ADDRESS_HOME_ZIP': '94043',}, + {'label': 'Profile 2', 'EMAIL_ADDRESS': 'sue@example.com', + 'COMPANY_NAME': 'Company X',}] + credit_cards = [{'label': 'Credit Card 1', + 'CREDIT_CARD_NUMBER': '6011111111111117', + 'CREDIT_CARD_EXP_MONTH': '12', + 'CREDIT_CARD_EXP_4_DIGIT_YEAR': '2011'}, + {'label': 'Credit Card 2', + 'CREDIT_CARD_NAME': 'Bob C. Smith', + 'CREDIT_CARD_TYPE': 'Visa'}] + + self.FillAutoFillProfile(profiles=profiles, credit_cards=credit_cards) + profile = self.GetAutoFillProfile() + self.assertEqual(profiles, profile['profiles']) + self.assertEqual(credit_cards, profile['credit_cards']) + + profiles = [ {'label': 'Profile3', 'NAME_FIRST': 'Larry'}] + self.FillAutoFillProfile(profiles=profiles) + profile = self.GetAutoFillProfile() + self.assertEqual(profiles, profile['profiles']) + self.assertEqual(credit_cards, profile['credit_cards']) + + def testFillProfileUnicode(self): + """Test filling profiles with unicode strings""" + profiles = [{'label': u'unic\u00F3de', 'NAME_FIRST': u'J\u00E4n', + 'ADDRESS_HOME_LINE1': u'123 R\u00F6d'}] + self.FillAutoFillProfile(profiles) + self.assertEqual(profiles, self.GetAutoFillProfile()['profiles']) + + def testGetProfilesEmpty(self): + """Test getting profiles when none have been filled""" + profile = self.GetAutoFillProfile() + self.assertEqual([], profile['profiles']) + self.assertEqual([], profile['credit_cards']) + + +if __name__ == '__main__': + pyauto_functional.Main() |