1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
# Copyright 2012 Canonical
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License version 3, as published
6
# by the Free Software Foundation.
8
"""Calendar app autopilot tests."""
12
from autopilot.input import Mouse, Touch, Pointer
13
from autopilot.matchers import Eventually
14
from autopilot.platform import model
15
from autopilot.testcase import AutopilotTestCase
16
from testtools.matchers import Equals
18
from ubuntu_calendar_app.emulators.main_window import MainWindow
21
class CalendarTestCase(AutopilotTestCase):
23
"""A common test case class that provides several useful methods for
27
if model() == 'Desktop':
28
scenarios = [('with mouse', dict(input_device_class=Mouse))]
30
scenarios = [('with touch', dict(input_device_class=Touch))]
32
local_location = "../../calendar.qml"
35
self.pointing_device = Pointer(self.input_device_class.create())
36
super(CalendarTestCase, self).setUp()
37
if os.path.exists(self.local_location):
38
self.launch_test_local()
40
self.launch_test_installed()
42
def launch_test_local(self):
43
self.app = self.launch_test_application(
48
def launch_test_installed(self):
49
self.app = self.launch_test_application(
51
"/usr/share/ubuntu-calendar-app/ubuntu-calendar-app.qml",
52
"--desktop_file_hint=/usr/share/applications/ubuntu-calendar-app.desktop",
56
def main_window(self):
57
return MainWindow(self.app)