OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """The testing Environment class.""" | 5 """The testing Environment class.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import shutil | 8 import shutil |
| 9 import sys |
9 import time | 10 import time |
10 import traceback | 11 import traceback |
11 from xml.etree import ElementTree | 12 from xml.etree import ElementTree |
12 from xml.sax.saxutils import escape | 13 from xml.sax.saxutils import escape |
13 | 14 |
| 15 sys.path.insert(0, '../../../../third_party/webdriver/pylib/') |
| 16 |
14 from selenium import webdriver | 17 from selenium import webdriver |
15 from selenium.common.exceptions import NoSuchElementException | 18 from selenium.common.exceptions import NoSuchElementException |
16 from selenium.common.exceptions import WebDriverException | 19 from selenium.common.exceptions import WebDriverException |
17 from selenium.webdriver.chrome.options import Options | 20 from selenium.webdriver.chrome.options import Options |
18 | 21 |
19 | 22 |
20 # Message strings to look for in chrome://password-manager-internals | 23 # Message strings to look for in chrome://password-manager-internals |
21 MESSAGE_ASK = "Message: Decision: ASK the user" | 24 MESSAGE_ASK = "Message: Decision: ASK the user" |
22 MESSAGE_SAVE = "Message: Decision: SAVE the password" | 25 MESSAGE_SAVE = "Message: Decision: SAVE the password" |
23 | 26 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 except Exception: | 387 except Exception: |
385 successful = False | 388 successful = False |
386 error = traceback.format_exc() | 389 error = traceback.format_exc() |
387 self.tests_results.append(TestResult(websitetest.name, "prompt", | 390 self.tests_results.append(TestResult(websitetest.name, "prompt", |
388 successful, escape(error))) | 391 successful, escape(error))) |
389 | 392 |
390 def Quit(self): | 393 def Quit(self): |
391 """Closes the tests.""" | 394 """Closes the tests.""" |
392 # Close the webdriver. | 395 # Close the webdriver. |
393 self.driver.quit() | 396 self.driver.quit() |
OLD | NEW |