Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Runs sample updater test using two Chrome builds. | 6 """Runs sample updater and install tests using one or more Chrome builds. |
|
kkania
2012/10/24 23:44:05
Change this comment to
"""Tests that demonstrate u
nkang
2012/10/24 23:52:46
Changed first line as suggested. Removed all other
| |
| 7 | 7 |
| 8 Test requires two arguments: build url and chrome versions to be used, rest of | 8 Test requires two arguments: build url and chrome versions to be used, rest of |
| 9 the arguments are optional. Builds must be specified in ascending order, with | 9 the arguments are optional. Builds must be specified in ascending order, with |
| 10 the lower version first and the higher version last, each separated by commas. | 10 the lower version first and the higher version last, each separated by commas. |
| 11 The setUp method creates a ChromeDriver instance, which can be used to run | 11 Separate arguments are required for install and update test scenarios. The |
| 12 tests. ChromeDriver is shutdown, upon completion of the testcase. | 12 setUp method creates a ChromeDriver instance, which can be used to run tests. |
| 13 ChromeDriver is shutdown upon completion of the testcase. | |
| 13 | 14 |
| 14 Example: | 15 Example: |
| 15 $ python sample_updater.py --url=<URL> --builds=19.0.1069.0,19.0.1070.0 | 16 $ python sample_updater.py --url=<URL> --builds=19.0.1069.0,19.0.1070.0 |
| 16 """ | 17 """ |
| 17 | 18 |
| 18 import os | 19 import os |
| 19 import sys | 20 import sys |
| 20 import unittest | 21 import unittest |
| 21 | 22 |
| 22 from install_test import InstallTest | 23 from install_test import InstallTest |
| 23 from install_test import Main | |
| 24 | 24 |
| 25 | 25 |
| 26 class SampleUpdater(InstallTest): | 26 class SampleUpdater(InstallTest): |
| 27 """Sample update tests.""" | 27 """Sample update tests.""" |
| 28 | 28 |
| 29 def testCanOpenGoogle(self): | 29 def testCanOpenGoogle(self): |
| 30 """Simple Navigation.""" | 30 """Simple Navigation. |
| 31 | |
| 32 This test case illustrates how to run an update test. Update tests require | |
| 33 two or more builds. | |
| 34 """ | |
| 35 self.Install(self.GetUpdateBuilds()[0]) | |
| 31 self.StartChrome() | 36 self.StartChrome() |
| 32 self._driver.get('http://www.google.com/') | 37 self._driver.get('http://www.google.com/') |
| 33 self.UpdateBuild() | 38 self.Install(self.GetUpdateBuilds()[1]) |
| 34 self.StartChrome() | 39 self.StartChrome() |
| 35 self._driver.get('http://www.google.org/') | 40 self._driver.get('http://www.google.org/') |
| 36 | 41 |
| 42 def testCanOpenGoogleOrg(self): | |
| 43 """Simple Navigation. | |
| 37 | 44 |
| 38 if __name__ == '__main__': | 45 This test case illustrates how to run a fresh install test. Simple install |
| 39 Main() | 46 tests, unlike update test, require only a single build. |
| 47 """ | |
| 48 self.Install(self.GetInstallBuild()) | |
| 49 self.StartChrome() | |
| 50 self._driver.get('http://www.google.org/') | |
| OLD | NEW |