~djfun/catchpodder/trunk

« back to all changes in this revision

Viewing changes to tests/autopilot/Catchpodder/tests/test_episodelistview.py

  • Committer: Martin Kaistra
  • Date: 2013-07-27 13:38:33 UTC
  • Revision ID: martin@djfun.de-20130727133833-nvfykhgjap80i555
updated tests using the new sdk autopilot emulator

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from Catchpodder.tests import CatchpodderTestCase, DatabaseMixin, HTTPServerInAThread
23
23
 
24
 
import os
25
 
import thread
26
 
from time import sleep
27
 
 
28
24
class TestsCatchpodderEpisodelistview(CatchpodderTestCase, DatabaseMixin):
29
25
 
30
26
    def setUp(self):
32
28
        self.server.start()
33
29
        self.setup_db_for_test(self.server.getPort(), with_episodes=True)
34
30
        super(TestsCatchpodderEpisodelistview, self).setUp()
35
 
        self.assertThat(
36
 
            self.main_window.get_qml_view().visible, Eventually(Equals(True)))
 
31
        self.assertThat(self.main_view.visible, Eventually(Equals(True)))
37
32
 
38
33
    def tearDown(self):
39
34
        super(TestsCatchpodderEpisodelistview, self).tearDown()
42
37
 
43
38
    def test_show_episodelistview(self):
44
39
        # Test clicking on 'All podcasts' to get to PodcastListPage
 
40
        
 
41
        podcastlistpage = self.main_view.get_podcastlistpage()
45
42
 
46
43
        # click on 'All podcasts'
47
 
        all_podcasts = self.main_window.get_object("ListItemPodcast", "podcastlist_allpodcasts")
 
44
        all_podcasts = podcastlistpage.get_all_podcasts()
48
45
        self.pointing_device.click_object(all_podcasts)
49
46
 
50
47
        # verify that EpisodeListPage becomes visible
51
 
        episodelistpage = self.main_window.get_object("EpisodeListPage", "episodelistpage")
 
48
        episodelistpage = self.main_view.get_episodelistpage()
52
49
        self.assertThat(episodelistpage.visible, Eventually(Equals(True)))
53
50
 
54
51
        # verify that episode element is visible
55
 
        list_item = self.app.select_single("ListItemEpisode", episode_title="title")
 
52
        list_item = episodelistpage.get_episode_element("title")
56
53
        self.assertThat(list_item.visible, Eventually(Equals(True)))