~liu-xiao-guo/debiantrial/qmltest

« back to all changes in this revision

Viewing changes to tests/autopilot/qmltest/test_main.py

  • Committer: XiaoGuo, Liu
  • Date: 2015-05-27 06:38:40 UTC
  • Revision ID: xiaoguo.liu@canonical.com-20150527063840-ii4x0hprut15oltf
Initial release

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 testtools.matchers import Equals
 
7
 
 
8
import qmltest
 
9
 
 
10
 
 
11
class MainViewTestCase(qmltest.ClickAppTestCase):
 
12
    """Generic tests for the Hello World"""
 
13
 
 
14
    def test_initial_label(self):
 
15
        app = self.launch_application()
 
16
        label = app.main_view.select_single(objectName='label')
 
17
        self.assertThat(label.text, Equals('Hello..'))
 
18
 
 
19
    def test_click_button_should_update_label(self):
 
20
        app = self.launch_application()
 
21
        button = app.main_view.select_single(objectName='button')
 
22
        app.pointing_device.click_object(button)
 
23
        label = app.main_view.select_single(objectName='label')
 
24
        self.assertThat(label.text, Eventually(Equals('..world!')))
 
25