~ubuntu-calendar-dev/ubuntu-calendar-app/trunk

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Olivier Tilloy
  • Date: 2013-08-20 14:15:24 UTC
  • mfrom: (88.1.6 fix-ap-tests-new-event)
  • Revision ID: tarmac-20130820141524-sgeayo243rcgvnvb
Fix failing autopilot tests on devices. Fixes: https://bugs.launchpad.net/bugs/1213084.

Approved by Günter Schwann, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from testtools.matchers import Equals
18
18
 
19
 
from calendar_app.emulators.main_window import MainWindow
20
 
from calendar_app.emulators.ubuntusdk import ubuntusdk
 
19
from ubuntuuitoolkit import emulators as uitk
 
20
 
 
21
from calendar_app.emulators.main_view import MainView
21
22
 
22
23
 
23
24
class CalendarTestCase(AutopilotTestCase):
40
41
            self.launch_test_local()
41
42
        else:
42
43
            self.launch_test_installed()
43
 
        self.assertThat(self.ubuntusdk.get_qml_view().visible,
44
 
                        Eventually(Equals(True)))
 
44
        self.assertThat(self.main_view.visible, Eventually(Equals(True)))
45
45
 
46
46
    def launch_test_local(self):
47
47
        self.app = self.launch_test_application(
48
48
            "qmlscene",
49
49
            self.local_location,
50
 
            app_type='qt')
 
50
            app_type='qt',
 
51
            emulator_base=uitk.UbuntuUIToolkitEmulatorBase)
51
52
 
52
53
    def launch_test_installed(self):
53
54
        self.app = self.launch_test_application(
54
55
            "qmlscene",
55
56
            "/usr/share/calendar-app/calendar.qml",
56
57
            "--desktop_file_hint=/usr/share/applications/calendar-app.desktop",
57
 
            app_type='qt')
58
 
 
59
 
    @property
60
 
    def main_window(self):
61
 
        return MainWindow(self.app)
62
 
 
63
 
    @property
64
 
    def ubuntusdk(self):
65
 
        return ubuntusdk(self, self.app)
 
58
            app_type='qt',
 
59
            emulator_base=uitk.UbuntuUIToolkitEmulatorBase)
 
60
 
 
61
    @property
 
62
    def main_view(self):
 
63
        return self.app.select_single(MainView)