~abreu-alexandre/qtcreator-plugin-ubuntu/fix-html5-app-launch-1504

« back to all changes in this revision

Viewing changes to share/qtcreator/templates/wizards/ubuntu/backend-app-qmake/appName/tests/autopilot/displayName/__init__.py

  • Committer: CI Train Bot
  • Author(s): nskaggs, Nicholas Skaggs
  • Date: 2015-06-16 14:47:50 UTC
  • mfrom: (391.1.14 update-qml-autopilot)
  • Revision ID: ci-train-bot@canonical.com-20150616144750-yh4z1evebap3sty2
Update qml based templates to best practicies
Approved by: Zoltan Balogh, PS Jenkins bot, Max Brustkern

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
 
2
"""Application autopilot helpers."""
 
3
 
 
4
import logging
 
5
import ubuntuuitoolkit
 
6
 
 
7
logger = logging.getLogger(__name__)
 
8
 
 
9
 
 
10
class AppException(ubuntuuitoolkit.ToolkitException):
 
11
 
 
12
    """Exception raised when there are problems with the Application."""
 
13
 
 
14
 
 
15
class TouchApp(object):
 
16
 
 
17
    """Autopilot helper object for the application."""
 
18
 
 
19
    def __init__(self, app_proxy, test_type):
 
20
        self.app = app_proxy
 
21
        self.test_type = test_type
 
22
        self.main_view = self.app.select_single(MainView)
 
23
 
 
24
    @property
 
25
    def pointing_device(self):
 
26
        return self.app.pointing_device
 
27
 
 
28
 
 
29
class MainView(ubuntuuitoolkit.MainView):
 
30
 
 
31
    """A helper that makes it easy to interact with the mainview"""
 
32
 
 
33
    def __init__(self, *args):
 
34
        super(MainView, self).__init__(*args)
 
35
        self.visible.wait_for(True, 30)
 
36
 
 
37
    def get_button(self):
 
38
        return self.select_single('Button', objectName="button")
 
39
 
 
40
    def get_label(self):
 
41
        return self.select_single('Label', objectName="label")
 
 
b'\\ No newline at end of file'