~michael-sheldon/webbrowser-app/implement-download-folder

« back to all changes in this revision

Viewing changes to tests/autopilot/webbrowser_app/tests/__init__.py

  • Committer: Michael Sheldon
  • Date: 2015-10-21 11:29:40 UTC
  • mfrom: (1106.25.70 webbrowser-app)
  • Revision ID: michael.sheldon@canonical.com-20151021112940-vhu9bb83kdc2q2fa
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
        if not os.path.exists(self.cache_location):
83
83
            os.makedirs(self.cache_location)
84
84
 
85
 
    def setUp(self):
 
85
    def setUp(self, launch=True):
86
86
        self.create_temporary_profile()
87
87
        self.pointing_device = uitk.get_pointing_device()
88
88
        super(BrowserTestCaseBase, self).setUp()
89
 
        self.app = self.launch_app()
 
89
        if (launch):
 
90
            self.launch_app()
90
91
 
91
92
    def launch_app(self):
92
93
        if os.path.exists(self.local_location):
93
 
            return self.launch_test_local()
 
94
            self.app = self.launch_test_local()
94
95
        else:
95
 
            return self.launch_test_installed()
 
96
            self.app = self.launch_test_installed()
96
97
        self.main_window.visible.wait_for(True)
97
98
 
98
99
    def launch_test_local(self):
247
248
    are executed, thus making them more robust.
248
249
    """
249
250
 
250
 
    def setUp(self, path="/test1"):
 
251
    def setUp(self, path="/test1", launch=True):
251
252
        self.http_server = http_server.HTTPServerInAThread()
252
253
        self.ping_server(self.http_server)
253
254
        self.addCleanup(self.http_server.cleanup)
258
259
        self.base_url = "http://" + self.base_domain
259
260
        self.url = self.base_url + path
260
261
        self.ARGS = self.ARGS + [self.url]
261
 
        super(StartOpenRemotePageTestCaseBase, self).setUp()
 
262
        super(StartOpenRemotePageTestCaseBase, self).setUp(launch)
 
263
        if (launch):
 
264
            self.assert_home_page_eventually_loaded()
 
265
 
 
266
    def launch_and_wait_for_page_loaded(self):
 
267
        self.launch_app()
262
268
        self.assert_home_page_eventually_loaded()
263
269
 
264
270
    def assert_home_page_eventually_loaded(self):