| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """Chrome Autofill Test Flow |
| 6 |
| 7 Execute a set of autofill tasks in a fresh ChromeDriver instance that has been |
| 8 pre-loaded with some default profile. |
| 9 |
| 10 Requires: |
| 11 - Selenium python bindings |
| 12 http://selenium-python.readthedocs.org/ |
| 13 |
| 14 - ChromeDriver |
| 15 https://sites.google.com/a/chromium.org/chromedriver/downloads |
| 16 The ChromeDriver executable must be available on the search PATH. |
| 17 |
| 18 - Chrome (>= 53) |
| 19 """ |
| 20 |
| 21 # Local Imports |
| 22 from task_flow import TaskFlow |
| 23 |
| 24 |
| 25 class AutofillTestFlow(TaskFlow): |
| 26 """Represents an executable set of Autofill Tasks. |
| 27 |
| 28 Note: currently the test flows consist of a single AutofillTask |
| 29 |
| 30 Used for automated autofill integration testing. |
| 31 |
| 32 Attributes: |
| 33 task_class: AutofillTask to use for the test. |
| 34 profile: Dict of profile data that acts as the master source for |
| 35 validating autofill behaviour. |
| 36 debug: Whether debug output should be printed (False if not specified). |
| 37 """ |
| 38 def __init__(self, task_class, profile, debug=False): |
| 39 self._task_class = task_class |
| 40 super(AutofillTestFlow, self).__init__(profile, debug) |
| 41 |
| 42 def _generate_task_sequence(self): |
| 43 """Generates a set of executable tasks that will be run in ChromeDriver. |
| 44 |
| 45 Returns: |
| 46 A list of AutofillTask instances that are to be run in ChromeDriver. |
| 47 |
| 48 These tasks are to be run in order. |
| 49 """ |
| 50 |
| 51 task = self._task_class(self._profile, self._debug) |
| 52 return [task] |
| 53 |
| 54 def __str__(self): |
| 55 if self._tasks: |
| 56 return 'Autofill Test Flow using \'%s\'' % self._tasks[0] |
| 57 else: |
| 58 return 'Empty Autofill Test Flow' |
| OLD | NEW |