~xeranas/ubuntu-docviewer-app/unknown_file_type_test

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Granger Anthony, nskaggs
  • Date: 2013-07-03 20:33:26 UTC
  • mfrom: (11.1.3 autopilot-hacking)
  • Revision ID: tarmac-20130703203326-6l232tsj1khrmw8i
Base for all future autopilot testcases.

Approved by Ubuntu Phone Apps Jenkins Bot, Anthony Granger.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
import os.path
11
11
 
 
12
from pprint import pprint
 
13
 
12
14
from autopilot.input import Mouse, Touch, Pointer
13
15
from autopilot.platform import model
14
16
from autopilot.testcase import AutopilotTestCase
15
17
 
16
18
from ubuntu_docviewer_app.emulators.main_window import MainWindow
17
 
 
 
19
from ubuntu_docviewer_app.emulators.ubuntusdk import ubuntusdk
18
20
 
19
21
class DocviewerTestCase(AutopilotTestCase):
20
22
 
22
24
    docviewer-app tests.
23
25
 
24
26
    """
 
27
 
25
28
    if model() == 'Desktop':
26
29
        scenarios = [('with mouse', dict(input_device_class=Mouse))]
27
30
    else:
28
31
        scenarios = [('with touch', dict(input_device_class=Touch))]
29
32
 
30
 
    local_location = "../../ubuntu-docviewer-app.qml"
 
33
    local_location = "../../ubuntu-docviewer-app"
31
34
 
32
35
    def setUp(self):
33
36
        self.pointing_device = Pointer(self.input_device_class.create())
34
37
        super(DocviewerTestCase, self).setUp()
35
 
        if os.path.exists(self.local_location):
36
 
            self.launch_test_local()
37
 
        else:
38
 
            self.launch_test_installed()
39
 
 
40
 
    def launch_test_local(self):
 
38
    
 
39
    def launch_test_local(self, arg):
41
40
        self.app = self.launch_test_application(
42
 
            "qmlscene",
43
41
            self.local_location,
 
42
            arg,
44
43
            app_type='qt')
45
44
 
46
 
    def launch_test_installed(self):
 
45
    def launch_test_installed(self, arg):
47
46
        self.app = self.launch_test_application(
48
47
            "qmlscene",
49
48
            "/usr/share/ubuntu-docviewer-app/ubuntu-docviewer-app.qml",
50
49
            "--desktop_file_hint=/usr/share/applications/ubuntu-docviewer-app.desktop",
 
50
            arg,
51
51
            app_type='qt')
52
52
 
53
53
    @property
54
54
    def main_window(self):
55
55
        return MainWindow(self.app)
 
56
 
 
57
    @property
 
58
    def ubuntusdk(self):
 
59
        return ubuntusdk(self, self.app)
 
60