~schwann/+junk/gallery-shader-dead

« back to all changes in this revision

Viewing changes to tests/autopilot/gallery_app/tests/__init__.py

More robust way to switch to albums view in tests.

Approved by Olivier Tilloy, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
        In the testfarm, the application may take some time to show up."""
61
61
        self.assertThat(self.gallery_utils.get_qml_view().visible,
62
62
                        Eventually(Equals(True)))
63
 
 
 
63
        """Wait for the data to be loaded and displayed"""
64
64
        self.ensure_at_least_one_event()
 
65
        """FIXME somehow on the server gallery sometimes is not fully started
 
66
        for switching to the albums view. Therefore this hack of a second"""
 
67
        sleep(1)
65
68
 
66
69
    def launch_test_local(self):
67
70
        self.app = self.launch_test_application(
123
126
        self.assertThat(albums_tab_button.opacity, Eventually(GreaterThan(0.2)))
124
127
        self.click_item(albums_tab_button)
125
128
 
 
129
        albums_loader = self.gallery_utils.get_albums_viewer_loader()
 
130
        self.assertThat(albums_loader.progress, Eventually(Equals(1)))
 
131
 
 
132
        """The next check assumes that at least one album is available"""
 
133
        """Check if the albums are availabe - they need some time to load."""
 
134
        self.assertThat(lambda: len(self.gallery_utils.get_all_albums()),
 
135
                        Eventually(GreaterThan(0)))
 
136
 
126
137
        """FIXME find a (functional) way to test if the tabs still move"""
127
 
        sleep(1.5)
 
138
        sleep(1)
128
139
 
129
140
    def open_first_album(self):
130
141
        first_album = self.album_view.get_first_album()
138
149
        self.assertThat(view.visible, Eventually(Equals(True)))
139
150
        self.assertThat(animated_view.animationRunning,
140
151
                        Eventually(Equals(False)))
141