~nskaggs/help-app/functional-test-template

« back to all changes in this revision

Viewing changes to internals/tests/functional/help_app/tests/__init__.py

  • Committer: nskaggs
  • Date: 2015-05-28 20:32:09 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20150528203209-lrij03bblv18a4n5
flake8 happiness

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
from ubuntuuitoolkit import fixture_setup
15
15
 
16
16
from autopilot import platform
17
 
from testtools.matchers import NotEquals, EndsWith
18
 
from autopilot.matchers import Eventually
19
17
from autopilot.testcase import AutopilotTestCase
20
18
 
21
19
CURRENT_ARCHITECTURE = subprocess.check_output(
45
43
                    DEFAULT_WEBVIEW_INSPECTOR_PORT)
46
44
            ))
47
45
 
48
 
    def tearDown(self):
49
 
        if self.driver:
50
 
            self.driver.close()
51
 
            self.driver.quit()
52
 
        # XXX: This should not be there but AP hangs
53
 
        # if we dont extra force the process to be killed
54
 
        # (although AP already tries to kill part of its teardown)
55
 
        if platform.model() == 'Desktop' \
56
 
           and self.app.app \
57
 
           and self.app.app.process:
58
 
            self.app.app.process.kill()
59
 
        super(HTML5TestCaseBase, self).tearDown()
60
 
 
61
46
    def launch_webdriver(self):
62
47
        options = Options()
63
48
        options.binary_location = ''
69
54
            executable_path=CHROMEDRIVER_EXEC_PATH,
70
55
            chrome_options=options)
71
56
 
72
 
    def launch_html5_app(self, path):
 
57
    def launch_app(self, path):
73
58
        return self.launch_test_application(
74
59
            'ubuntu-html5-app-launcher',
75
60
            '--www={}/{}'.format(
84
69
 
85
70
    def setUp(self):
86
71
        super(HelpAppTest, self).setUp()
87
 
        self.app = HelpApp(self.launch_html5_app('../../../../../build/app/www'))
 
72
        self.app = HelpApp(self.launch_app('../../../../../build/app/www'))
88
73
        self.driver = self.launch_webdriver()
89
74
 
90
75
 
94
79
 
95
80
    def setUp(self):
96
81
        super(HelpWebTest, self).setUp()
97
 
        self.app = HelpApp(self.launch_html5_app('../../../../../build/web/www'))
 
82
        self.app = HelpApp(self.launch_app('../../../../../build/web/www'))
98
83
        self.driver = self.launch_webdriver()