~rpadovani/reminders-app/fixForReload

« back to all changes in this revision

Viewing changes to tests/autopilot/reminders-app/main/test_main.py

  • Committer: David Planella
  • Date: 2013-10-23 11:02:37 UTC
  • Revision ID: david.planella@ubuntu.com-20131023110237-lfqgn9ma4qxaon7g
Initial commit

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
 
 
3
"""Tests for the Hello World"""
 
4
 
 
5
from autopilot.matchers import Eventually
 
6
from textwrap import dedent
 
7
from testtools.matchers import Is, Not, Equals
 
8
from testtools import skip
 
9
import os
 
10
from reminders-app import UbuntuTouchAppTestCase
 
11
 
 
12
 
 
13
class GenericTests(UbuntuTouchAppTestCase):
 
14
    """Generic tests for the Hello World"""
 
15
 
 
16
    test_qml_file = "%s/%s.qml" % (os.path.dirname(os.path.realpath(__file__)),"../../../../reminders-app")
 
17
 
 
18
    def test_0_can_select_mainView(self):
 
19
        """Must be able to select the mainview."""
 
20
 
 
21
        mainView = self.get_mainview()
 
22
        self.assertThat(mainView.visible,Eventually(Equals(True)))
 
23
 
 
24
 
 
25
    def test_1_init_label(self):
 
26
        """Check the initial text of the label"""
 
27
 
 
28
        lbl = self.get_object(objectName="label")
 
29
        self.assertThat(lbl.text, Equals("Hello.."))
 
30
 
 
31
 
 
32
    def test_can_tap_button(self):
 
33
        """Must be able to tap the button"""
 
34
 
 
35
        lbl = self.get_object(objectName="label")
 
36
        self.mouse_click(objectName="button")
 
37
        self.assertThat(lbl.text, Eventually(Equals("..world!")))
 
38