~ubuntu-clock-dev/ubuntu-clock-app/reboot-packaging

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntu_clock_app/tests/test_clock.py

Setup autopilot infrastructure and added alarm test

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2014 Canonical Ltd
 
2
#
 
3
# This file is part of Ubuntu Clock App
 
4
#
 
5
# Ubuntu Clock App is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# Ubuntu Clock App is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
"""
 
18
Tests for the Clock App, main window.
 
19
"""
 
20
 
 
21
from __future__ import absolute_import
 
22
 
 
23
from testtools.matchers import Equals
 
24
from autopilot.matchers import Eventually
 
25
 
 
26
from ubuntu_clock_app.tests import ClockAppTestCase
 
27
 
 
28
 
 
29
class TestClock(ClockAppTestCase):
 
30
 
 
31
    """Test the clock page features."""
 
32
 
 
33
    def setUp(self):
 
34
        """This is needed to wait for the application to start.
 
35
 
 
36
        In the testfarm, the application may take some time to show up.
 
37
 
 
38
        """
 
39
 
 
40
        super(TestClock, self).setUp()
 
41
        self.assertThat(
 
42
            self.main_view.visible, Eventually(Equals(True)))
 
43
 
 
44
        self.page = self.main_view.open_clock()