~knitzsche/+junk/tabtest

« back to all changes in this revision

Viewing changes to fix-page-tab-issue/tests/autopilot/ubuntu_html5_ui_toolkit/tests/test_rss_reader.py

  • Committer: Kyle Nitzsche
  • Date: 2014-02-28 21:45:04 UTC
  • Revision ID: kyle.nitzsche@canonical.com-20140228214504-nzkax4md3v35r6p2
working test

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
# Copyright 2013 Canonical
 
3
#
 
4
# This program is free software: you can redistribute it and/or modify it
 
5
# under the terms of the GNU Lesser General Public License version 3, as published
 
6
# by the Free Software Foundation.
 
7
 
 
8
from __future__ import absolute_import
 
9
 
 
10
import time
 
11
 
 
12
from testtools.matchers import Contains, Equals
 
13
from autopilot.matchers import Eventually
 
14
 
 
15
from ubuntu_html5_ui_toolkit.tests import UbuntuHTML5TestCaseBase, UbuntuThemeRemotePageTestCaseBase
 
16
 
 
17
class UbuntuThemeRSSReaderTestCase(UbuntuHTML5TestCaseBase):
 
18
    def setUp(self):
 
19
        super(UbuntuThemeRSSReaderTestCase, self).setUp()
 
20
        self.browse_to_app('rss-reader')
 
21
 
 
22
    def test_appDoesLoads(self):
 
23
        self.assertThat(self.get_title(), Contains("RSS Mobile Reader"))
 
24
 
 
25
    def test_initialState(self):
 
26
        self.assertThat(self.is_dom_node_visible('main'), Equals(True))
 
27
        self.assertThat(self.is_dom_node_visible('article'), Equals(False))
 
28
        self.assertThat(self.is_dom_node_visible('results'), Equals(False))
 
29
 
 
30
    def test_switchToFeedView(self):
 
31
        self.click_any_dom_node_by_selector('#yourfeeds li a')
 
32
        self.assertThat(lambda: self.is_dom_node_visible('main'), Eventually(Equals(False)))
 
33
        self.assertThat(self.is_dom_node_visible('article'), Equals(False))
 
34
        self.assertThat(self.is_dom_node_visible('results'), Equals(True))