~artmello/gallery-app/gallery-app-start_on_event

« back to all changes in this revision

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

  • Committer: CI bot
  • Author(s): Arthur Mello, Bill Filler, Ugo Riboni
  • Date: 2014-03-19 20:19:57 UTC
  • mfrom: (912.3.20 multiple-bug-fixes)
  • Revision ID: ps-jenkins@lists.canonical.com-20140319201957-32sglr01gx1xx9e0
multiple gallery-app bug fixes Bug #907870: [desktop] Gallery does not display photos in sub folders, Bug #1221968: use libthumbnailer for gallery thumbnails, Bug #1268748: videos are not displayed when running on desktop, Bug #1271327: disable switching between camera and gallery on desktop, Bug #1287272: Black flash at the end of the zoom animation" Fixes: 907870, 1221968, 1268748, 1271327, 1287272

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from gallery_app.emulators.photos_view import PhotosView
20
20
 
21
21
from os.path import exists
22
 
from os import environ
23
 
 
 
22
from os import environ as env
24
23
import unittest
25
24
 
26
25
class TestPhotosView(GalleryTestCase):
32
31
 
33
32
    def setUp(self):
34
33
        self.ARGS = []
35
 
        self.envDesktopMode = environ.get("DESKTOP_MODE")
 
34
        self.envDesktopMode = env.get("DESKTOP_MODE")
36
35
 
37
36
        if model() == "Desktop":
38
 
            environ["DESKTOP_MODE"] = "1"
 
37
            env["DESKTOP_MODE"] = "1"
39
38
        else:
40
 
            environ["DESKTOP_MODE"] = "0"
 
39
            env["DESKTOP_MODE"] = "0"
41
40
 
42
41
        super(TestPhotosView, self).setUp()
43
42
        self.switch_to_photos_tab()
44
43
 
45
44
    def tearDown(self):
46
45
        if self.envDesktopMode:
47
 
            environ["DESKTOP_MODE"] = self.envDesktopMode
 
46
            env["DESKTOP_MODE"] = self.envDesktopMode
48
47
        else:
49
 
            del environ["DESKTOP_MODE"]
 
48
            del env["DESKTOP_MODE"]
50
49
 
51
50
        super(TestPhotosView, self).tearDown()
52
51
 
152
151
        self.assertThat(view.fullScreen, Eventually(Equals(False)))
153
152
        self.keyboard.press_and_release('Escape')
154
153
        self.assertThat(view.fullScreen, Eventually(Equals(False)))
 
154
 
 
155
    # Check if Camera Button is not visible at Desktop mode
 
156
    def test_camera_button_visible(self):
 
157
        self.main_view.open_toolbar()
 
158
        toolbar = self.main_view.get_toolbar()
 
159
        cameraButton = toolbar.select_single("ActionItem", objectName="cameraButton")
 
160
        if model() == "Desktop":
 
161
            self.assertThat(cameraButton.visible, Equals(False))
 
162
        else:
 
163
            self.assertThat(cameraButton.visible, Equals(True))